Repository navigation
feat(helm): render nodeSelector, tolerations, and affinity on the componentized chart migrations Job - #39843
Conversation
…ponentized chart migrations Job
Greptile SummaryThis PR adds independently configurable scheduling controls to the componentized chart’s migrations Job.
Confidence Score: 5/5The PR appears safe to merge; the scheduling options are opt-in, render in the correct pod-spec location, and have focused regression coverage. No actionable new issues remain. The prior documentation-policy finding was correctly withdrawn after mateo-berri explained that values.yaml serves as the chart’s configuration reference, and the thread is resolved.
|
| Filename | Overview |
|---|---|
| helm/litellm/templates/migrations-job.yaml | Correctly renders optional migration Job scheduling fields at the pod-spec level. |
| helm/litellm/tests/migration_job_tests.yaml | Adds focused coverage for default omission, configured scheduling, and non-inheritance from gateway values. |
| helm/litellm/values.yaml | Adds backward-compatible empty defaults and useful configuration guidance for migration Job scheduling. |
Reviews (4): Last reviewed commit: "Merge remote-tracking branch 'origin/lit..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…itellm_lit_7015_migration_job_node_selector
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3b9568b. Configure here.
aea5358
into
litellm_internal_staging
TLDR
Problem this solves:
gateway,backend, anduitakenodeSelector;migrationJobhas no such keyHow it solves it:
migrationJob.nodeSelector,migrationJob.tolerations, andmigrationJob.affinitytohelm/litellmgateway.*User Flow
Before: an operator pins every LiteLLM pod to their
intent: no-csi-nodesnode pool, and the migrations Job is the one pod that still schedules anywherenodeSelector: {intent: no-csi-nodes}undergateway,backend,ui, andmigrationJobin their values file for the componentized chart athelm/litellmhelm template litellm helm/litellm -f values.yamlnodeSelector: {intent: no-csi-nodes}; thelitellm-litellm-migrationsJob renders nonodeSelector,tolerations, oraffinityat all, andvalues.yamlhas no such keys undermigrationJobto sethelm upgrade --install litellm helm/litellm -f values.yaml -n litellm; the pre-upgrade migrations Job is created without a node selector, so its pod (4 CPU / 12Gi in their values) can land on any node in the cluster instead of the pool they sized for itAfter: the same values file pins the migrations Job to the pool too
nodeSelector: {intent: no-csi-nodes}undergateway,backend,ui, andmigrationJobin their values file for the componentized chart athelm/litellmhelm template litellm helm/litellm -f values.yamllitellm-litellm-migrationsJob rendernodeSelector: {intent: no-csi-nodes};migrationJob.tolerationsandmigrationJob.affinityrender on the Job the same way, and all three keys are documented undermigrationJobinvalues.yamlhelm upgrade --install litellm helm/litellm -f values.yaml -n litellm; the migrations Job pod carries the node selector, so it can only be placed on theintent: no-csi-nodespoolRelevant issues
Linear ticket
Resolves LIT-7015
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
helm unittest helm/litellm -f 'tests/*.yaml'(13 suites, 121 tests)@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Shared setup: a values file shaped like an operator's real one, with the same
intent: no-csi-nodesselector on every component, plus tolerations and affinity on the Job to show all three fieldsLive cluster leg: a one-node kind cluster (
kind create cluster --name lit7015), the same values file,helm upgrade --install litellm <chart> -f pin-values.yaml -n <ns> --create-namespace --timeout 40son each side (the pre-install hook times out on purpose because there is no database, and the Job it created stays behind for inspection)Before (41c8c2f)
helm template litellm helm/litellm -f pin-values.yaml | python3 scheduling_per_pod.pyhelm template litellm helm/litellm -f pin-values.yaml -s templates/migrations-job.yaml | python3 -c 'import sys,yaml; print(sorted(yaml.safe_load(sys.stdin)["spec"]["template"]["spec"].keys()))'Live cluster: the Job renders without scheduling fields, so the pod is assigned to the unlabeled node right away, and once that node carries the pool taint the pod cannot schedule at all because the chart renders no tolerations
After (2674934)
The tip is 3b9568b, a merge of
litellm_internal_staginginto this branch to pick up its CI fixes; it touches nothing underhelm/, so it cannot change the rendered chart and the run above standshelm template litellm helm/litellm -f pin-values.yaml | python3 scheduling_per_pod.pyhelm template litellm helm/litellm -f pin-values.yaml -s templates/migrations-job.yaml | python3 -c 'import sys,yaml; d=yaml.safe_load(sys.stdin)["spec"]["template"]["spec"]; print(yaml.safe_dump({k: d.get(k) for k in ("nodeSelector","tolerations","affinity")}, sort_keys=False))'helm lint helm/litellm --set database.writer.host=h --set database.writer.dbname=dreports1 chart(s) linted, 0 chart(s) failed, andhelm unittest helm/litellm -f 'tests/*.yaml'reports 13 suites and 121 tests passing. With the template change reverted and the new tests kept, the positive render test fails, so the tests do catch a regressionLive cluster: the Job carries all three fields, the API server accepts them, the pod stays Pending until a node matches the selector, and once the node is labeled and tainted as the pool the pod is assigned there (the toleration is honored)
Type
🆕 New Feature
Caveats (if any)
Low
gateway.nodeSelector; setmigrationJob.nodeSelectorexplicitlylitellm-helmchart uses top-level keys insteadnodeSelectormatching no node leaves the hook Job Pendinghelm upgradethen fails at its--timeoutbefore touching running podsFinal Attestation
The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
2674934 passes /live-pr-risk