[Feature]: Support affinity / nodeSelector for operand DaemonSets in ClusterPolicy spec.daemonsets
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- go, helm, kubernetes
- Domain
- devops, infrastructure
Research direction
Start at the ClusterPolicy spec.daemonsets API and the Helm daemonsets values, then trace how the common DaemonSet configuration reaches each listed operand. Verify that empty defaults preserve current behavior and that configured affinity and nodeSelector apply to all operand DaemonSets alongside existing NFD selection. Done means the API and chart expose both fields and the behavior is covered across the operands.
Written by the indexing model from the issue text.
Description
Feature description
Add affinity and nodeSelector to the common DaemonSet config in ClusterPolicy
(spec.daemonsets), surfaced in the Helm chart as daemonsets.affinity /
daemonsets.nodeSelector (default empty). When set, apply them to all operand
DaemonSets (driver, container-toolkit, device-plugin, dcgm-exporter, gfd,
mig-manager, …), on top of the operator's existing NFD-based node selection.
Motivation
spec.daemonsets already exposes tolerations but has no affinity/nodeSelector.
That's an asymmetry: tolerations only permit scheduling onto tainted nodes — they
can't restrict where operands land. On a cloud cluster (EKS/GKE/AKS) with several
autoscaled node pools where only one has GPUs, I want to declaratively pin operands to
that pool via a label it already carries (e.g. karpenter.sh/nodepool=gpu).
The documented alternatives don't cover this well:
nvidia.com/gpu.deploy.<operand>=disabledlabels / node taints (how #547 was
closed) are subtractive: you must label or taint every node you want to exclude.
In autoscaled clusters (Karpenter, managed nodegroups) where nodes churn constantly,
that doesn't scale and is race-prone.- NFD gating keeps operands off non-GPU nodes, but can't target a specific GPU
pool and doesn't apply when NFD is disabled.
A first-class affinity/nodeSelector is declarative, applies automatically to new
nodes, and is consistent with the operator's own NvidiaDriver CRD, which already
exposes spec.affinity and spec.nodeSelector.
Prior art
#547 requested essentially this and was closed pointing at the subtractive workarounds
above; a community MR to add nodeSelector to the common daemonset config was referenced
there but never landed.
Proposed API
# ClusterPolicy
spec:
daemonsets:
nodeSelector: # proposed
karpenter.sh/nodepool: gpu
affinity: {} # proposed
# Helm values.yaml
daemonsets:
affinity: {} # default: unchanged behavior
nodeSelector: {} # default: unchanged behavior
User-supplied values should be merged (AND) with the operator's NFD-based selection so
GPU detection still applies.
- Dominant language
- Go
- Stars
- 2.9k
- Forks
- 569
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 76
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/gpu-operator
-
[Bug]: Driver upgrade does not evict pods that use nvidia.com/gpu only in a native sidecarPossibly taken A pull request linked to this issue is open or already merged. Openbug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/gpu-operator#3026 ·
Maintainers usually reply within 1 day
-
[Bug]: GPUCluster common name label breaks DRA validator selectorPossibly taken @ajavanma claimed this 19 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NVIDIA/gpu-operator#2955 · 1 comment ·
Maintainers usually reply within 1 day
-
feature lifecycle/frozen needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 25/100
NVIDIA/gpu-operator#3035 · 1 reaction ·
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
NVIDIA/gpu-operator#3027 ·
Maintainers usually reply within 1 day
-
Ensure automated backport commits have verified signaturesPossibly taken @asivanadi0 claimed this 10 days ago. Opengood-first-issue
Difficulty 4/5 3-5 days Newbie friendliness 55/100
NVIDIA/gpu-operator#2997 · 1 comment ·
Maintainers usually reply within 1 day
All issues in NVIDIA/gpu-operator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
AvengeMedia/DankMaterialShell#3761 ·
Maintainers usually reply within 1 day
-
docs: clarify replacement for outdated Terms of Service URL in readme.mdPossibly taken @mohitjoshi-hey claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SocialGouv/iterion#2320 ·
Maintainers usually reply within 1 day
-
helm chart: the first upgrade after install restarts the filer and S3 gateway although nothing changedPossibly taken @egezamb claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[mesheryctl] Potential runtime panic (index out of range) in system status when pod container statuses are partially populatedPossibly taken @Ayush-AM claimed this today. Opencomponent/mesheryctl kind/bug language/go
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
meshery/meshery#22312 · 2 comments ·
Maintainers usually reply within 1 day