Skip to content

fix(helm): mount gateway config.yaml on backend Deployment - #29634

Closed
yassin-berriai wants to merge 2 commits into
litellm_internal_stagingfrom
litellm_fix/mount-config-yaml-backend
Closed

fix(helm): mount gateway config.yaml on backend Deployment#29634
yassin-berriai wants to merge 2 commits into
litellm_internal_stagingfrom
litellm_fix/mount-config-yaml-backend

Conversation

@yassin-berriai

Copy link
Copy Markdown
Contributor

Summary

  • The componentized chart's backend Deployment never mounted {fullname}-gateway-config or set CONFIG_FILE_PATH, so anything declared in gateway.config.proxy_config.litellm_settings (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 the existing ConfigMap: when true, the backend now also gets CONFIG_FILE_PATH=/app/config/config.yaml, the gateway-config volume + volumeMount, and a checksum/config pod annotation so ConfigMap edits roll backend pods alongside gateway pods.
  • No values.yaml change. No new toggle. When gateway.config.create=false, the backend Deployment is byte-identical to before.

Why reuse the gateway ConfigMap?

The litellm proxy reads a single config.yaml; splitting per-component would let the two drift and break shared settings (callbacks, cache, guardrails) on whichever side forgets to set them. Reusing keeps a single source of truth and matches runtime reality.

Test plan

  • helm template with gateway.config.create=true shows the backend Deployment now contains CONFIG_FILE_PATH, the gateway-config volumeMount + volume, and a checksum/config annotation pointing at {release}-litellm-gateway-config.
  • helm template with gateway.config.create=false produces a backend Deployment with no CONFIG_FILE_PATH, no volumeMounts, no volumes, and no checksum/config annotation (identical to main).
  • Deploy to a cluster, edit litellm-gateway-config to add a callback, confirm backend pods roll and the new callback is registered in backend logs.

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.
@CLAassistant

CLAassistant commented Jun 3, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ claude
❌ yassin-berriai
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the backend Deployment in the componentized Helm chart so it mounts and reads the same gateway-config ConfigMap that the gateway process already uses, ensuring shared settings (callbacks, cache, guardrails) apply to both processes.

  • When gateway.config.create=true, the backend Deployment now receives CONFIG_FILE_PATH=/app/config/config.yaml, a gateway-config volumeMount/volume referencing the existing ConfigMap, and a checksum/config pod annotation that rolls backend pods whenever the ConfigMap changes — mirroring the gateway Deployment exactly.
  • When gateway.config.create=false, the implementation is functionally equivalent to the original, though a bare annotations: key is now always emitted in the pod spec regardless of whether backend.podAnnotations is populated.

Confidence Score: 4/5

The change is safe to merge; the new mount, env var, and checksum annotation are only active when the user explicitly opted in via gateway.config.create=true, and the implementation faithfully mirrors the gateway Deployment.

The core logic — volume, volumeMount, env var, and checksum annotation — is correct and matches the gateway Deployment exactly. The one cosmetic discrepancy is a bare annotations: key that is now always emitted even when there is nothing to annotate, which disagrees with the PR description's byte-identical claim but causes no runtime problem.

helm/litellm/templates/backend/deployment.yaml — the unconditional annotations block

Important Files Changed

Filename Overview
helm/litellm/templates/backend/deployment.yaml Adds gateway ConfigMap mount, CONFIG_FILE_PATH env, and checksum/config annotation to backend Deployment when gateway.config.create=true; unconditionally emits an annotations: block that was previously absent when podAnnotations is empty

Reviews (1): Last reviewed commit: "fix(helm): mount gateway config.yaml on ..." | Re-trigger Greptile

Comment thread helm/litellm/templates/backend/deployment.yaml
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.
@mateo-berri

Copy link
Copy Markdown
Contributor

Superceded by #29605. Thanks

@mateo-berri mateo-berri closed this Jun 4, 2026
@mateo-berri
mateo-berri deleted the litellm_fix/mount-config-yaml-backend branch June 4, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants