Support NVIDIADriver reconciliation and driver upgrades without a ClusterPolicy#2572
Support NVIDIADriver reconciliation and driver upgrades without a ClusterPolicy#2572karthikvetrivel wants to merge 3 commits into
Conversation
8ffcfc3 to
479562c
Compare
5691bbc to
e5dcecd
Compare
479562c to
0e75d4c
Compare
3b7cc55 to
4ad2c9d
Compare
1a06b01 to
b101993
Compare
0e75d4c to
7f38f41
Compare
b101993 to
7f26b3c
Compare
c4a3751 to
3c9eb31
Compare
afefc58 to
3be4304
Compare
7f38f41 to
fdb7c6e
Compare
d5ef70f to
a063aa9
Compare
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
fdb7c6e to
a9629e2
Compare
| hostRoot = gpuCluster.Spec.HostPaths.RootFS | ||
| default: | ||
| err := fmt.Errorf("no ClusterPolicy or GPUCluster object found in the cluster") | ||
| logger.Error(err, "failed to get a cluster-wide configuration object") |
There was a problem hiding this comment.
| logger.Error(err, "failed to get a cluster-wide configuration object") | |
| logger.Error(err, "failed to retrieve hostPaths information. No ClusterPolicy or GPUCluster object found in the cluster") |
| return reconcile.Result{}, err | ||
| } | ||
|
|
||
| if clusterPolicy == nil { |
There was a problem hiding this comment.
We can merge two if blocks into one with this change
| if clusterPolicy == nil { | |
| if clusterPolicy == nil || clusterPolicy.Spec.Driver.UseNvidiaDriverCRDType() { |
There was a problem hiding this comment.
Actually, isn't it possible now to have both ClusterPolicy-backed drivers and NVIDIADriver-backed drivers (we can continue to debate whether this is actually desired or not in a separate thread)? IIUC the upgrade-controller, as currently implemented, does not account for that use case -- it only calls reconcileNVIDIADriverUpgrades() OR reconcileClusterPolicyDriverUpgrades.
There was a problem hiding this comment.
The problematic scenario -- ClusterPolicy and GPUCluster exist; clusterpolicy.spec.driver.useNvidiaDriverCRD=false; NVIDIADriver CRs exist which target DRA nodes. In this case, the upgrade-controller will not be able to manage the upgrades for both the ClusterPolicy-owned driver daemonsets and the NVIDIADriver-owned driver daemonsets.
| } | ||
| hostRoot = clusterPolicy.Spec.HostPaths.RootFS | ||
| case gpuCluster != nil: | ||
| hostRoot = gpuCluster.Spec.HostPaths.RootFS |
There was a problem hiding this comment.
Correct me if I am wrong, but in the scenario where both ClusterPolicy and GPUCluster exist, will the .spec.hostPaths.rootFS from GPUCluster have the higher order of precedence?
|
Thanks @karthikvetrivel! Can you also squash your commit history here? |
Summary
This PR lets the NVIDIADriver controller reconcile without a ClusterPolicy, so a GPUCluster (the DRA stack) can use operator-managed drivers standalone.
InfoTypeHostRootcatalog entry rather than reading the ClusterPolicy directly, which decouples it from thegpuv1types. When both CRs exist, the ClusterPolicy'shostPaths.rootFStakes precedence. Otherwise the GPUCluster's value is used.useNvidiaDriverCRD) or a GPUCluster exists, the NVIDIADriver reconciles normally. If a ClusterPolicy is present but not delegating and no GPUCluster exists, the NVIDIADriver goesdisabled("useNvidiaDriverCRD is not enabled in ClusterPolicy and no GPUCluster exists"). If neither CR exists, it goesnotReady("no ClusterPolicy or GPUCluster object found in the cluster").gpuclusters.Testing
There is unit coverage for the host-root sourcing and the gate transitions, plus two live validations on a single-node Tesla T4 cluster (Kubernetes 1.34, containerd 2.2).
devRoot=/run/nvidia/driver) and published its DeviceClasses and ResourceSlice. A pod with a DRA claim rannvidia-smiagainst the operator-installed driver..status.statetransitions on a cluster converted from a released operator install. A ClusterPolicy that is not delegating with no GPUCluster produceddisabled. A GPUCluster alone producedready. With neither CR, the NVIDIADriver wentnotReadywith the expected message. The ClusterPolicy plus GPUCluster coexistence path is covered by the unit tests.