helm: add nodeSelector to upgrade-crd hook Job to prevent Windows scheduling#2640
helm: add nodeSelector to upgrade-crd hook Job to prevent Windows scheduling#2640iacker wants to merge 2 commits into
Conversation
…eduling The pre-upgrade CRD hook Job lacked a nodeSelector, so on mixed-OS clusters with untainted Windows nodes the hook pod could be scheduled onto Windows and hang in ContainerCreating forever, blocking Helm upgrades. This commit adds a nodeSelector block that renders .Values.operator.nodeSelector if set, or defaults to kubernetes.io/os: linux as a safe fallback. Fixes: NVIDIA#2608 Signed-off-by: Billard <82095453+iacker@users.noreply.github.com>
| nodeSelector: | ||
| {{- if .Values.operator.nodeSelector }} | ||
| {{- toYaml .Values.operator.nodeSelector | nindent 8 }} | ||
| {{- else }} |
There was a problem hiding this comment.
instead of the else block, can we add just a default value for this parameter in values.yaml ?
|
Thanks @iacker ! Can we also make the change in |
Address maintainer review feedback to apply the same nodeSelector pattern to the cleanup-crd hook Job so pre-delete hooks avoid Windows scheduling as well. Matches the fix in upgrade-crd Job. Co-requested-by: Tariq Ibrahim <tariq1890> Signed-off-by: Billard <82095453+iacker@users.noreply.github.com>
|
@tariq1890 Done! I've added the same Both hooks are now consistent. |
|
@iacker can you please squash your commits into 1. Overall, the changes looks fine to me. |
|
@rahulait The commits have been squashed into a single commit locally (message below). However, my setup blocks force-pushes as a safety measure. Would you prefer:
Let me know which you prefer and I'll proceed immediately! Squashed commit message: |
|
@iacker , yes please force push the branch with just 1 commit. Also make sure that commit addresses comment from @tariq1890 and then I can run CI to make sure everything passes. |
What this PR does / why we need it:
The pre-upgrade CRD hook Job (
deployments/gpu-operator/templates/upgrade_crd.yaml) renderstolerationsfrom.Values.operator.tolerationsbut nonodeSelector, so on mixed-OS clusters with untainted Windows nodes the hook pod can be scheduled onto a Windows node and hang inContainerCreatingforever, blocking Helm upgrades.This commit adds a
nodeSelectorblock to the Job's pod template that:.Values.operator.nodeSelectorif the user has set it (for consistency with the operator Deployment and user-controlled node targeting)kubernetes.io/os: linuxwhen no user nodeSelector is provided, ensuring the hook always lands on LinuxWhich issue(s) this PR fixes:
Fixes #2608
Special notes for reviewers:
helm template(no live cluster available).kubernetes.io/os: linuxis safe and standard for Linux-only container images.