helm: add nodeSelector to upgrade-crd hook Job to prevent Windows scheduling - #2640
Conversation
| 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 |
|
@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. |
e9d6cc3 to
19ee69c
Compare
Add the operator nodeSelector to the upgrade-crd and cleanup-crd hook Jobs. When it is unset, default to kubernetes.io/os: linux so these Linux-only Jobs cannot be scheduled onto untainted Windows nodes in mixed-OS clusters. Add the default nodeSelector value to values.yaml. Fixes: NVIDIA#2608 Co-requested-by: Tariq Ibrahim <tariq1890> Signed-off-by: Billard <82095453+iacker@users.noreply.github.com> Signed-off-by: Rahul Sharma <rahulsharm@nvidia.com>
19ee69c to
8c43105
Compare
|
/ok to test 8c43105 |
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.