From f9142d79610125a7d7232b013f86056ddd113561 Mon Sep 17 00:00:00 2001 From: tin-berri Date: Thu, 4 Jun 2026 12:07:19 -0700 Subject: [PATCH] fix(helm): Enable Backend Deployment to mount Gateway config.yaml (#29605) * change deployment configs to include a litellm.cache for litellm-backend pod mirroring litellm-gateway pod * omit backend annotations block when config and podAnnotations are both empty * reuse gateway config/configmap for backend instead of separate backend config --------- Co-authored-by: shin-berri Co-authored-by: yuneng-jiang Co-authored-by: Tin Chi Lo Co-authored-by: Tin Chi Lo --- .../litellm/templates/backend/deployment.yaml | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/helm/litellm/templates/backend/deployment.yaml b/helm/litellm/templates/backend/deployment.yaml index 3b59c58c8b..b355db4354 100644 --- a/helm/litellm/templates/backend/deployment.yaml +++ b/helm/litellm/templates/backend/deployment.yaml @@ -12,9 +12,14 @@ spec: {{- include "litellm.backend.selectorLabels" . | nindent 6 }} template: metadata: - {{- with .Values.backend.podAnnotations }} + {{- 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 }} + {{- end }} + {{- with .Values.backend.podAnnotations }} {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} labels: {{- include "litellm.backend.selectorLabels" . | nindent 8 }} @@ -35,7 +40,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 +61,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 }}