From a7397b2459aa3fb92dcf51d7910814dee423fcb4 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Thu, 13 Aug 2026 00:41:36 -0700 Subject: [PATCH] fix(helm): render nodeSelector on the migrations job (#36747) The template rendered affinity and tolerations but never nodeSelector, so a values file that pinned the chart to a node pool got the gateway and every subchart placed correctly while the migration Job silently fell through to whatever the cluster's default pool was. That is worse than an outright failure. On EKS Auto Mode the default pool hands out 3 GiB nodes and the migration container needs roughly 3.6 GB, so the Job was OOM-killed on a pool it was never meant to run on, while the values file that would have placed it on a large enough node looked correct. The new test fails against the old template with "unknown path spec.template.spec.nodeSelector". --- .../templates/migrations-job.yaml | 4 ++++ .../tests/migrations-job_tests.yaml | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/helm/litellm-helm/templates/migrations-job.yaml b/helm/litellm-helm/templates/migrations-job.yaml index 7bc1a133883..f8a660e23f8 100644 --- a/helm/litellm-helm/templates/migrations-job.yaml +++ b/helm/litellm-helm/templates/migrations-job.yaml @@ -105,6 +105,10 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} restartPolicy: OnFailure + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/helm/litellm-helm/tests/migrations-job_tests.yaml b/helm/litellm-helm/tests/migrations-job_tests.yaml index 6bfc1f38adc..cb962118a25 100644 --- a/helm/litellm-helm/tests/migrations-job_tests.yaml +++ b/helm/litellm-helm/tests/migrations-job_tests.yaml @@ -290,3 +290,27 @@ tests: value: allowPrivilegeEscalation: false readOnlyRootFilesystem: true + - it: should schedule onto the same nodes as the gateway + template: migrations-job.yaml + set: + migrationJob: + enabled: true + nodeSelector: + karpenter.sh/nodepool: litellm-e2e + tolerations: + - key: workload + operator: Equal + value: litellm-e2e + effect: NoSchedule + asserts: + - equal: + path: spec.template.spec.nodeSelector + value: + karpenter.sh/nodepool: litellm-e2e + - equal: + path: spec.template.spec.tolerations + value: + - key: workload + operator: Equal + value: litellm-e2e + effect: NoSchedule