Add GPUCluster CRD and controller for DRA-based stack#2571
Conversation
5691bbc to
e5dcecd
Compare
a4c09b7 to
6b5ac48
Compare
3b7cc55 to
4ad2c9d
Compare
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
48e44d8 to
86cd1a1
Compare
| // its own driver rather than delegating to NVIDIADriver CRs), device-plugin nodes get no owner: | ||
| // their driver comes from the ClusterPolicy DaemonSet, and assigning an owner would land a second | ||
| // driver DaemonSet on them. On success, it returns true when any node owner label was changed. | ||
| func AssignOwners(ctx context.Context, c client.Client, classicClusterPolicyDriver bool) (bool, error) { |
There was a problem hiding this comment.
Not a blocker, but I am having trouble grokking this. My intuition is telling me we should only call AssignOwners() when drivers are managed by the NVIDIADriver controller. But here we are calling it even when ClusterPolicy is managing the driver daemonsets. What's the rationale here?
From the comment:
// When classicClusterPolicyDriver is true (a ClusterPolicy manages
// its own driver rather than delegating to NVIDIADriver CRs), device-plugin nodes get no owner:
// their driver comes from the ClusterPolicy DaemonSet, and assigning an owner would land a second
// driver DaemonSet on them.
If ClusterPolicy is managing the driver daemonsets, doesn't our NVIDIADriver controller's Reconcile() return early and not render any daemonsets in that case?
There was a problem hiding this comment.
The classicClusterPolicyDriver=true path only exists for the mixed cluster where ClusterPolicy coexists with GPUCluster. Here, the NVIDIADriver controller is active because DRA-mode nodes get their driver from NVIDIADriver CRs, so AssignOwners() must still run to label those nodes, and the flag just makes it skip (and clear) the owner label on device-plugin-mode nodes so the ClusterPolicy's own driver DaemonSet isn't joined by a second, NVIDIADriver-rendered one.
There was a problem hiding this comment.
Here, the NVIDIADriver controller is active because DRA-mode nodes get their driver from NVIDIADriver CRs
This is the source of my confusion -- A) I was under the impression that the NVIDIADriver controller is never active whenever a ClusterPolicy-backed driver is active (since the ClusterPolicy-backed driver would target ALL gpu nodes), and B) I was under the impression that the DRA-mode did not strictly require that the NVIDIADriver controller was used for driver management (it is agnostic to how drivers are installed).
3b99f8c to
22ef265
Compare
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
6f3a74f to
db850c5
Compare
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
3fbf7cd to
d5ef70f
Compare
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
d5ef70f to
a063aa9
Compare
|
To add to what others have said here already - EXCELLENT work! This looks to be in a good shape to merge. We can address the other outstanding comments in follow-ups |
1. Overview
We introduce a new CRD named
GPUClusterand a new controller for reconciling it. LikeClusterPolicytoday, it is a singleton, cluster-scoped CRD that configures the operands needed to enable GPUs in Kubernetes.GPUClusterrepresents the new DRA-based software-enablement stack; it is an evolution ofClusterPolicy. UnlikeClusterPolicy, it does not manage the driver or a device plugin: the driver is either preinstalled on the host or managed byNVIDIADriverCRs, and GPUs are surfaced to workloads through DRA.A
GPUClustermay coexist with aClusterPolicyin the same cluster, with every GPU node served by exactly one of the two stacks.2. Testing
Unit tests cover the new API, operand rendering, controller status handling, and the node-labeling logic. I also tested this end-to-end on a 2-node heterogeneous cluster (A100 + T4, Kubernetes v1.34):
For compute domains, I created a ComputeDomain CR with
numNodes: 2and a channel ResourceClaimTemplate, then ran a 2-pod indexed Job with pod anti-affinity so one pod landed on each GB200 node. I gave each pod a resource claim against the channel template, and inside each container I listed/dev/nvidia-caps-imex-channels/to confirm containerd injected channel0 via CDI. Note that compute domains functionality requires containerd 2.x+.3. Misc Design Notes
The driver daemonset deployed by the NVIDIADriver CR is not gated on the deploy
modeso that it is not evicted and re-scheduled when the user switches modes.The DRA kubelet-plugin daemonset is gated on
nvidia.com/gpu.deploy.dra-driverrather than the mode label. The kubelet plugin must outlive every pod holding a gpu.nvidia.com ResourceClaim. Unpreparing a claim requires the plugin, so if it unregisters before the claim holders are gone, those pods get stuck in aTerminatingstate. Gating the daemonset on the mode label would evict the plugin at the instant of a mode switch, before the workloads drained by that switch have terminated. Instead, the node-labeling controller defers removal of the gpu.deploy.dra-driver label until no pod on the node still holds a GPU claim (terminating pods and admin-access claims count, since unpreparing them also requires the plugin), so the kubelet plugin is always the last DRA component to leave the node.4. Next Steps
PRs to land:
After we have a new validator daemonset, this PR can be marked as ready: