From 56352c3cbfeac5ceedc35d2b82a3b4d90ab530d4 Mon Sep 17 00:00:00 2001 From: Yassin Kortam Date: Wed, 3 Jun 2026 16:07:26 -0700 Subject: [PATCH 1/2] fix(helm): mount gateway config.yaml on backend Deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The componentized chart's backend Deployment never mounted {fullname}-gateway-config or set CONFIG_FILE_PATH, so any litellm_settings declared in gateway.config.proxy_config (callbacks, cache, guardrails, ...) only loaded on the gateway process — even though the backend runs the same proxy code and needs the same callbacks to fire for management-API and proxy-level OTel spans. Reuse the existing gateway.config.create toggle and ConfigMap: when true, the backend now also gets CONFIG_FILE_PATH, the gateway-config volume + volumeMount, and a checksum/config pod annotation so ConfigMap edits roll backend pods alongside gateway pods. No values.yaml or new toggle is introduced; when gateway.config.create=false the backend Deployment is byte- identical to before. --- .../litellm/templates/backend/deployment.yaml | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/helm/litellm/templates/backend/deployment.yaml b/helm/litellm/templates/backend/deployment.yaml index 3b59c58c8bf3..c8f3ad4cd864 100644 --- a/helm/litellm/templates/backend/deployment.yaml +++ b/helm/litellm/templates/backend/deployment.yaml @@ -12,10 +12,13 @@ spec: {{- include "litellm.backend.selectorLabels" . | nindent 6 }} template: metadata: - {{- with .Values.backend.podAnnotations }} annotations: + {{- if .Values.gateway.config.create }} + checksum/config: {{ include (print $.Template.BasePath "/gateway/configmap.yaml") . | sha256sum }} + {{- end }} + {{- with .Values.backend.podAnnotations }} {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} labels: {{- include "litellm.backend.selectorLabels" . | nindent 8 }} spec: @@ -35,7 +38,17 @@ spec: protocol: TCP env: {{- include "litellm.serverEnv" (dict "root" $ "component" .Values.backend) | nindent 12 }} + {{- if .Values.gateway.config.create }} + - name: CONFIG_FILE_PATH + value: /app/config/config.yaml + {{- end }} {{- include "litellm.envFrom" .Values.backend | nindent 10 }} + {{- if .Values.gateway.config.create }} + volumeMounts: + - name: gateway-config + mountPath: /app/config/config.yaml + subPath: config.yaml + {{- end }} {{- with .Values.backend.livenessProbe }} livenessProbe: {{- toYaml . | nindent 12 }} @@ -46,6 +59,12 @@ spec: {{- end }} resources: {{- toYaml .Values.backend.resources | nindent 12 }} + {{- if .Values.gateway.config.create }} + volumes: + - name: gateway-config + configMap: + name: {{ include "litellm.gateway.fullname" . }}-config + {{- end }} {{- with .Values.backend.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} From 3cbf090fd197ea7dfd676c3036660e2aee1e02f4 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 4 Jun 2026 01:12:46 +0000 Subject: [PATCH 2/2] fix(helm): only render backend annotations block when non-empty Guard the backend Deployment's annotations: key behind or(gateway.config.create, backend.podAnnotations) so it is suppressed entirely when neither is set, keeping output byte- identical to before this PR when gateway.config.create=false and no podAnnotations are configured. --- helm/litellm/templates/backend/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helm/litellm/templates/backend/deployment.yaml b/helm/litellm/templates/backend/deployment.yaml index c8f3ad4cd864..b355db435404 100644 --- a/helm/litellm/templates/backend/deployment.yaml +++ b/helm/litellm/templates/backend/deployment.yaml @@ -12,6 +12,7 @@ spec: {{- include "litellm.backend.selectorLabels" . | nindent 6 }} template: metadata: + {{- if or .Values.gateway.config.create .Values.backend.podAnnotations }} annotations: {{- if .Values.gateway.config.create }} checksum/config: {{ include (print $.Template.BasePath "/gateway/configmap.yaml") . | sha256sum }} @@ -19,6 +20,7 @@ spec: {{- with .Values.backend.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} + {{- end }} labels: {{- include "litellm.backend.selectorLabels" . | nindent 8 }} spec: