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 <shin-laptop@berri.ai>
Co-authored-by: yuneng-jiang <yuneng@berri.ai>
Co-authored-by: Tin Chi Lo <tin@Tins-MBP.localdomain>
Co-authored-by: Tin Chi Lo <tin@Tins-MacBook-Pro.local>
This commit is contained in:
tin-berri 2026-06-04 12:07:19 -07:00 committed by GitHub
parent 568d291b99
commit f9142d7961
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,10 +12,15 @@ spec:
{{- include "litellm.backend.selectorLabels" . | nindent 6 }} {{- include "litellm.backend.selectorLabels" . | nindent 6 }}
template: template:
metadata: metadata:
{{- with .Values.backend.podAnnotations }} {{- if or .Values.gateway.config.create .Values.backend.podAnnotations }}
annotations: annotations:
{{- if .Values.gateway.config.create }}
checksum/config: {{ include (print $.Template.BasePath "/gateway/configmap.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.backend.podAnnotations }}
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- end }}
labels: labels:
{{- include "litellm.backend.selectorLabels" . | nindent 8 }} {{- include "litellm.backend.selectorLabels" . | nindent 8 }}
spec: spec:
@ -35,7 +40,17 @@ spec:
protocol: TCP protocol: TCP
env: env:
{{- include "litellm.serverEnv" (dict "root" $ "component" .Values.backend) | nindent 12 }} {{- 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 }} {{- 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 }} {{- with .Values.backend.livenessProbe }}
livenessProbe: livenessProbe:
{{- toYaml . | nindent 12 }} {{- toYaml . | nindent 12 }}
@ -46,6 +61,12 @@ spec:
{{- end }} {{- end }}
resources: resources:
{{- toYaml .Values.backend.resources | nindent 12 }} {{- 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 }} {{- with .Values.backend.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}