Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/model-engine/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.9
version: 0.2.10

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
10 changes: 9 additions & 1 deletion charts/model-engine/templates/gateway_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,15 @@ spec:
- -m
- model_engine_server.entrypoints.start_fastapi_server
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- /* The gateway proxies async-task results inline, so its memory profile is
unrelated to the cacher and endpoint-builder that share .Values.resources.
gateway.resources deep-merges OVER that shared block, so a memory-only
override keeps the shared cpu / ephemeral-storage requests.
deepCopy is required: mergeOverwrite mutates its first argument, and
.Values.resources is also rendered into the cacher and endpoint-builder. */}}
{{- $base := .Values.resources | default dict }}
{{- $gatewayResources := (.Values.gateway | default dict).resources | default dict }}
{{- toYaml (mergeOverwrite (deepCopy $base) $gatewayResources) | nindent 12 }}
{{- include "modelEngine.gatewayEnv" . | indent 10 }}
{{- include "modelEngine.volumeMounts" . | indent 10 }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
Expand Down
2 changes: 1 addition & 1 deletion charts/model-engine/templates/gateway_vpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ spec:
maxAllowed:
cpu: {{ .Values.autoscaling.vertical.maxAllowed.cpu }}
memory: {{ .Values.autoscaling.vertical.maxAllowed.memory }}
controlledResources: ["cpu", "memory"]
controlledResources: {{ (.Values.gateway | default dict).vpaControlledResources | default (list "cpu" "memory") | toJson }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/model-engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ gateway:
attempts: 3
retryOn: connect-failure,unavailable,502,504
perTryTimeout: null
# resources deep-merges over the top-level `resources` for the gateway container only.
# That top-level block is shared with the cacher and endpoint-builder, which run a
# handful of pods each and sit near 1GiB; the gateway runs the whole fleet and holds
# task results in memory while it proxies them. Sizing all three off one block means
# either under-declaring the gateway or over-reserving for the other two.
# Keys set here win; keys absent here fall through to `resources`, so a memory-only
# override keeps the shared cpu and ephemeral-storage requests. Leave empty to inherit
# `resources` unchanged.
resources: {}

@lorenzo-norcini-scale lorenzo-norcini-scale Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prod enables the gateway VPA in Initial mode with memory controlled and capped at 8Gi. Does this conflict with 32GB and what's the behavior?

# vpaControlledResources sets the gateway VPA's controlledResources. The VPA runs in
# updateMode: Initial, so it rewrites requests at pod creation and clamps them to
# autoscaling.vertical.maxAllowed — which would silently override any memory request
# pinned in `gateway.resources` above. Set to ["cpu"] when pinning memory statically,
# so the VPA keeps managing CPU and stops managing memory.
vpaControlledResources: ["cpu", "memory"]

# rateLimits [optional] per-pod Envoy local_ratelimit token buckets on the gateway
# sidecars (inbound). Overflow returns 429 at the proxy without reaching a gateway
Expand Down