• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NVIDIA / gpu-operator / 16360201712

18 Jul 2025 01:50AM UTC coverage: 18.589% (+0.2%) from 18.433%
16360201712

Pull #1541

github

cdesiniotis
Integrate NVIDIA DRA Driver for GPUs as an operand

Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
Pull Request #1541: Integrate NVIDIA DRA Driver for GPUs as a operand

69 of 276 new or added lines in 6 files covered. (25.0%)

1227 existing lines in 4 files now uncovered.

2179 of 11722 relevant lines covered (18.59%)

0.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/api/nvidia/v1/clusterpolicy_types.go
1
/*
2
Copyright 2021.
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7

8
    http://www.apache.org/licenses/LICENSE-2.0
9

10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16

17
package v1
18

19
import (
20
        "fmt"
21
        "os"
22
        "strings"
23

24
        kata_v1alpha1 "github.com/NVIDIA/k8s-kata-manager/api/v1alpha1/config"
25
        upgrade_v1alpha1 "github.com/NVIDIA/k8s-operator-libs/api/upgrade/v1alpha1"
26
        promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
27
        corev1 "k8s.io/api/core/v1"
28
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
29
)
30

31
// EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
32
// NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
33

34
const (
35
        ClusterPolicyCRDName = "ClusterPolicy"
36
)
37

38
// ClusterPolicySpec defines the desired state of ClusterPolicy
39
type ClusterPolicySpec struct {
40
        // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
41
        // Important: Run "make" to regenerate code after modifying this file
42

43
        // Operator component spec
44
        Operator OperatorSpec `json:"operator"`
45
        // Daemonset defines common configuration for all Daemonsets
46
        Daemonsets DaemonsetsSpec `json:"daemonsets"`
47
        // Driver component spec
48
        Driver DriverSpec `json:"driver"`
49
        // Toolkit component spec
50
        Toolkit ToolkitSpec `json:"toolkit"`
51
        // DevicePlugin component spec
52
        DevicePlugin DevicePluginSpec `json:"devicePlugin"`
53
        // DRADriver component spec
54
        DRADriver DRADriverSpec `json:"draDriver"`
55
        // DCGMExporter spec
56
        DCGMExporter DCGMExporterSpec `json:"dcgmExporter"`
57
        // DCGM component spec
58
        DCGM DCGMSpec `json:"dcgm"`
59
        // NodeStatusExporter spec
60
        NodeStatusExporter NodeStatusExporterSpec `json:"nodeStatusExporter"`
61
        // GPUFeatureDiscovery spec
62
        GPUFeatureDiscovery GPUFeatureDiscoverySpec `json:"gfd"`
63
        // MIG spec
64
        MIG MIGSpec `json:"mig,omitempty"`
65
        // MIGManager for configuration to deploy MIG Manager
66
        MIGManager MIGManagerSpec `json:"migManager,omitempty"`
67
        // Deprecated: Pod Security Policies are no longer supported. Please use PodSecurityAdmission instead
68
        // PSP defines spec for handling PodSecurityPolicies
69
        PSP PSPSpec `json:"psp,omitempty"`
70
        // PSA defines spec for PodSecurityAdmission configuration
71
        PSA PSASpec `json:"psa,omitempty"`
72
        // Validator defines the spec for operator-validator daemonset
73
        Validator ValidatorSpec `json:"validator,omitempty"`
74
        // GPUDirectStorage defines the spec for GDS components(Experimental)
75
        GPUDirectStorage *GPUDirectStorageSpec `json:"gds,omitempty"`
76
        // GDRCopy component spec
77
        GDRCopy *GDRCopySpec `json:"gdrcopy,omitempty"`
78
        // SandboxWorkloads defines the spec for handling sandbox workloads (i.e. Virtual Machines)
79
        SandboxWorkloads SandboxWorkloadsSpec `json:"sandboxWorkloads,omitempty"`
80
        // VFIOManager for configuration to deploy VFIO-PCI Manager
81
        VFIOManager VFIOManagerSpec `json:"vfioManager,omitempty"`
82
        // SandboxDevicePlugin component spec
83
        SandboxDevicePlugin SandboxDevicePluginSpec `json:"sandboxDevicePlugin,omitempty"`
84
        // VGPUManager component spec
85
        VGPUManager VGPUManagerSpec `json:"vgpuManager,omitempty"`
86
        // VGPUDeviceManager spec
87
        VGPUDeviceManager VGPUDeviceManagerSpec `json:"vgpuDeviceManager,omitempty"`
88
        // CDI configures how the Container Device Interface is used in the cluster
89
        CDI CDIConfigSpec `json:"cdi,omitempty"`
90
        // KataManager component spec
91
        KataManager KataManagerSpec `json:"kataManager,omitempty"`
92
        // CCManager component spec
93
        CCManager CCManagerSpec `json:"ccManager,omitempty"`
94
        // HostPaths defines various paths on the host needed by GPU Operator components
95
        HostPaths HostPathsSpec `json:"hostPaths,omitempty"`
96
}
97

98
// Runtime defines container runtime type
99
type Runtime string
100

101
// RuntimeClass defines the runtime class to use for GPU-enabled pods
102
type RuntimeClass string
103

104
const (
105
        // Docker runtime
106
        Docker Runtime = "docker"
107
        // CRIO runtime
108
        CRIO Runtime = "crio"
109
        // Containerd runtime
110
        Containerd Runtime = "containerd"
111
)
112

113
func (r Runtime) String() string {
×
114
        switch r {
×
115
        case Docker:
×
116
                return "docker"
×
117
        case CRIO:
×
118
                return "crio"
×
119
        case Containerd:
×
120
                return "containerd"
×
121
        default:
×
122
                return ""
×
123
        }
124
}
125

126
// OperatorSpec describes configuration options for the operator
127
type OperatorSpec struct {
128
        // +kubebuilder:validation:Enum=docker;crio;containerd
129
        // +kubebuilder:default=docker
130
        DefaultRuntime Runtime `json:"defaultRuntime"`
131
        // +kubebuilder:default=nvidia
132
        RuntimeClass  string            `json:"runtimeClass,omitempty"`
133
        InitContainer InitContainerSpec `json:"initContainer,omitempty"`
134

135
        // Optional: Map of string keys and values that can be used to organize and categorize
136
        // (scope and select) objects. May match selectors of replication controllers
137
        // and services.
138
        Labels map[string]string `json:"labels,omitempty"`
139

140
        // Optional: Annotations is an unstructured key value map stored with a resource that may be
141
        // set by external tools to store and retrieve arbitrary metadata. They are not
142
        // queryable and should be preserved when modifying objects.
143
        Annotations map[string]string `json:"annotations,omitempty"`
144

145
        // UseOpenShiftDriverToolkit indicates if DriverToolkit image should be used on OpenShift to build and install driver modules
146
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
147
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="On OpenShift, enable DriverToolkit image to build and install driver modules"
148
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
149
        UseOpenShiftDriverToolkit *bool `json:"use_ocp_driver_toolkit,omitempty"`
150
}
151

152
// HostPathsSpec defines various paths on the host needed by GPU Operator components
153
type HostPathsSpec struct {
154
        // RootFS represents the path to the root filesystem of the host.
155
        // This is used by components that need to interact with the host filesystem
156
        // and as such this must be a chroot-able filesystem.
157
        // Examples include the MIG Manager and Toolkit Container which may need to
158
        // stop, start, or restart systemd services.
159
        RootFS string `json:"rootFS,omitempty"`
160

161
        // DriverInstallDir represents the root at which driver files including libraries,
162
        // config files, and executables can be found.
163
        DriverInstallDir string `json:"driverInstallDir,omitempty"`
164
}
165

166
// EnvVar represents an environment variable present in a Container.
167
type EnvVar struct {
168
        // Name of the environment variable.
169
        Name string `json:"name"`
170

171
        // Value of the environment variable.
172
        Value string `json:"value,omitempty"`
173
}
174

175
// ResourceRequirements describes the compute resource requirements.
176
type ResourceRequirements struct {
177
        // Limits describes the maximum amount of compute resources allowed.
178
        // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
179
        // +optional
180
        Limits corev1.ResourceList `json:"limits,omitempty"`
181
        // Requests describes the minimum amount of compute resources required.
182
        // If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
183
        // otherwise to an implementation-defined value. Requests cannot exceed Limits.
184
        // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
185
        // +optional
186
        Requests corev1.ResourceList `json:"requests,omitempty"`
187
}
188

189
// SandboxWorkloadsSpec describes configuration for handling sandbox workloads (i.e. Virtual Machines)
190
type SandboxWorkloadsSpec struct {
191
        // Enabled indicates if the GPU Operator should manage additional operands required
192
        // for sandbox workloads (i.e. VFIO Manager, vGPU Manager, and additional device plugins)
193
        Enabled *bool `json:"enabled,omitempty"`
194
        // DefaultWorkload indicates the default GPU workload type to configure
195
        // worker nodes in the cluster for
196
        // +kubebuilder:validation:Enum=container;vm-passthrough;vm-vgpu
197
        // +kubebuilder:default=container
198
        DefaultWorkload string `json:"defaultWorkload,omitempty"`
199
}
200

201
// PSPSpec describes configuration for PodSecurityPolicies to apply for all Pods
202
type PSPSpec struct {
203
        // Enabled indicates if PodSecurityPolicies needs to be enabled for all Pods
204
        Enabled *bool `json:"enabled,omitempty"`
205
}
206

207
// PSASpec describes configuration for PodSecurityAdmission to apply for all Pods
208
type PSASpec struct {
209
        // Enabled indicates if PodSecurityAdmission configuration needs to be enabled for all Pods
210
        Enabled *bool `json:"enabled,omitempty"`
211
}
212

213
// DaemonsetsSpec indicates common configuration for all Daemonsets managed by GPU Operator
214
type DaemonsetsSpec struct {
215
        // Optional: Map of string keys and values that can be used to organize and categorize
216
        // (scope and select) objects. May match selectors of replication controllers
217
        // and services.
218
        Labels map[string]string `json:"labels,omitempty"`
219

220
        // Optional: Annotations is an unstructured key value map stored with a resource that may be
221
        // set by external tools to store and retrieve arbitrary metadata. They are not
222
        // queryable and should be preserved when modifying objects.
223
        Annotations map[string]string `json:"annotations,omitempty"`
224

225
        // Optional: Set tolerations
226
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
227
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Tolerations"
228
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:io.kubernetes:Tolerations"
229
        Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
230

231
        // +kubebuilder:validation:Optional
232
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
233
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="PriorityClassName"
234
        PriorityClassName string `json:"priorityClassName,omitempty"`
235

236
        // +kubebuilder:validation:Optional
237
        // +kubebuilder:default=RollingUpdate
238
        // +kubebuilder:validation:Enum=RollingUpdate;OnDelete
239
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
240
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="UpdateStrategy for all Daemonsets"
241
        UpdateStrategy string `json:"updateStrategy,omitempty"`
242

243
        // Optional: Configuration for rolling update of all DaemonSet pods
244
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
245
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Rolling update configuration for all DaemonSet pods"
246
        RollingUpdate *RollingUpdateSpec `json:"rollingUpdate,omitempty"`
247
}
248

249
// InitContainerSpec describes configuration for initContainer image used with all components
250
type InitContainerSpec struct {
251
        // Repository represents image repository path
252
        Repository string `json:"repository,omitempty"`
253

254
        // Image represents image name
255
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
256
        Image string `json:"image,omitempty"`
257

258
        // Version represents image tag(version)
259
        Version string `json:"version,omitempty"`
260

261
        // Image pull policy
262
        // +kubebuilder:validation:Optional
263
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
264

265
        // Image pull secrets
266
        // +kubebuilder:validation:Optional
267
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
268
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
269
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
270
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
271
}
272

273
// ValidatorSpec describes configuration options for validation pod
274
type ValidatorSpec struct {
275
        // Plugin validator spec
276
        Plugin PluginValidatorSpec `json:"plugin,omitempty"`
277

278
        // Toolkit validator spec
279
        Toolkit ToolkitValidatorSpec `json:"toolkit,omitempty"`
280

281
        // Toolkit validator spec
282
        Driver DriverValidatorSpec `json:"driver,omitempty"`
283

284
        // CUDA validator spec
285
        CUDA CUDAValidatorSpec `json:"cuda,omitempty"`
286

287
        // VfioPCI validator spec
288
        VFIOPCI VFIOPCIValidatorSpec `json:"vfioPCI,omitempty"`
289

290
        // VGPUManager validator spec
291
        VGPUManager VGPUManagerValidatorSpec `json:"vgpuManager,omitempty"`
292

293
        // VGPUDevices validator spec
294
        VGPUDevices VGPUDevicesValidatorSpec `json:"vgpuDevices,omitempty"`
295

296
        // Validator image repository
297
        // +kubebuilder:validation:Optional
298
        Repository string `json:"repository,omitempty"`
299

300
        // Validator image name
301
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
302
        Image string `json:"image,omitempty"`
303

304
        // Validator image tag
305
        // +kubebuilder:validation:Optional
306
        Version string `json:"version,omitempty"`
307

308
        // Image pull policy
309
        // +kubebuilder:validation:Optional
310
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
311
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
312
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
313
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
314

315
        // Image pull secrets
316
        // +kubebuilder:validation:Optional
317
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
318
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
319
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
320
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
321

322
        // Optional: Define resources requests and limits for each pod
323
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
324
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
325
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
326
        Resources *ResourceRequirements `json:"resources,omitempty"`
327

328
        // Optional: List of arguments
329
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
330
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
331
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
332
        Args []string `json:"args,omitempty"`
333

334
        // Optional: List of environment variables
335
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
336
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
337
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
338
        Env []EnvVar `json:"env,omitempty"`
339
}
340

341
// PluginValidatorSpec defines validator spec for NVIDIA Device Plugin
342
type PluginValidatorSpec struct {
343
        // Optional: List of environment variables
344
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
345
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
346
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
347
        Env []EnvVar `json:"env,omitempty"`
348
}
349

350
// ToolkitValidatorSpec defines validator spec for NVIDIA Container Toolkit
351
type ToolkitValidatorSpec struct {
352
        // Optional: List of environment variables
353
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
354
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
355
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
356
        Env []EnvVar `json:"env,omitempty"`
357
}
358

359
// DriverValidatorSpec defines validator spec for NVIDIA Driver validation
360
type DriverValidatorSpec struct {
361
        // Optional: List of environment variables
362
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
363
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
364
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
365
        Env []EnvVar `json:"env,omitempty"`
366
}
367

368
// CUDAValidatorSpec defines validator spec for CUDA validation workload pod
369
type CUDAValidatorSpec struct {
370
        // Optional: List of environment variables
371
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
372
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
373
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
374
        Env []EnvVar `json:"env,omitempty"`
375
}
376

377
// VFIOPCIValidatorSpec defines validator spec for NVIDIA VFIO-PCI device validation
378
type VFIOPCIValidatorSpec struct {
379
        // Optional: List of environment variables
380
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
381
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
382
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
383
        Env []EnvVar `json:"env,omitempty"`
384
}
385

386
// VGPUManagerValidatorSpec defines validator spec for NVIDIA vGPU Manager
387
type VGPUManagerValidatorSpec struct {
388
        // Optional: List of environment variables
389
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
390
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
391
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
392
        Env []EnvVar `json:"env,omitempty"`
393
}
394

395
// VGPUDevicesValidatorSpec defines validator spec for NVIDIA vGPU device validator
396
type VGPUDevicesValidatorSpec struct {
397
        // Optional: List of environment variables
398
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
399
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
400
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
401
        Env []EnvVar `json:"env,omitempty"`
402
}
403

404
// MIGSpec defines the configuration for MIG support
405
type MIGSpec struct {
406
        // Optional: MIGStrategy to apply for GFD and NVIDIA Device Plugin
407
        // +kubebuilder:validation:Enum=none;single;mixed
408
        Strategy MIGStrategy `json:"strategy,omitempty"`
409
}
410

411
// DriverManagerSpec describes configuration for NVIDIA Driver Manager(initContainer)
412
type DriverManagerSpec struct {
413
        // Repository represents Driver Managerrepository path
414
        Repository string `json:"repository,omitempty"`
415

416
        // Image represents NVIDIA Driver Manager image name
417
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
418
        Image string `json:"image,omitempty"`
419

420
        // Version represents NVIDIA Driver Manager image tag(version)
421
        Version string `json:"version,omitempty"`
422

423
        // Image pull policy
424
        // +kubebuilder:validation:Optional
425
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
426

427
        // Image pull secrets
428
        // +kubebuilder:validation:Optional
429
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
430
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
431
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
432
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
433

434
        // Optional: List of environment variables
435
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
436
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
437
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
438
        Env []EnvVar `json:"env,omitempty"`
439
}
440

441
// ContainerProbeSpec defines the properties for configuring container probes
442
type ContainerProbeSpec struct {
443
        // Number of seconds after the container has started before liveness probes are initiated.
444
        // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
445
        // +kubebuilder:validation:Optional
446
        InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`
447
        // Number of seconds after which the probe times out.
448
        // Defaults to 1 second. Minimum value is 1.
449
        // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
450
        // +kubebuilder:validation:Optional
451
        // +kubebuilder:validation:Minimum=1
452
        TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
453
        // How often (in seconds) to perform the probe.
454
        // Default to 10 seconds. Minimum value is 1.
455
        // +kubebuilder:validation:Optional
456
        // +kubebuilder:validation:Minimum=1
457
        PeriodSeconds int32 `json:"periodSeconds,omitempty"`
458
        // Minimum consecutive successes for the probe to be considered successful after having failed.
459
        // Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
460
        // +kubebuilder:validation:Optional
461
        // +kubebuilder:validation:Minimum=1
462
        SuccessThreshold int32 `json:"successThreshold,omitempty"`
463
        // Minimum consecutive failures for the probe to be considered failed after having succeeded.
464
        // Defaults to 3. Minimum value is 1.
465
        // +kubebuilder:validation:Optional
466
        // +kubebuilder:validation:Minimum=1
467
        FailureThreshold int32 `json:"failureThreshold,omitempty"`
468
}
469

470
// DriverSpec defines the properties for NVIDIA Driver deployment
471
type DriverSpec struct {
472
        // UseNvidiaDriverCRD indicates if the deployment of NVIDIA Driver is managed by the NVIDIADriver CRD type
473
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
474
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA Driver deployment through NVIDIADriver CRD type"
475
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
476
        UseNvidiaDriverCRD *bool `json:"useNvidiaDriverCRD,omitempty"`
477

478
        // UsePrecompiled indicates if deployment of NVIDIA Driver using pre-compiled modules is enabled
479
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
480
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA Driver deployment using pre-compiled modules"
481
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
482
        UsePrecompiled *bool `json:"usePrecompiled,omitempty"`
483

484
        // Deprecated: This field is no longer honored by the gpu-operator. Please use KernelModuleType instead.
485
        // UseOpenKernelModules indicates if the open GPU kernel modules should be used
486
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
487
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable use of open GPU kernel modules"
488
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch,urn:alm:descriptor:com.tectonic.ui:hidden"
489
        UseOpenKernelModules *bool `json:"useOpenKernelModules,omitempty"`
490

491
        // KernelModuleType represents the type of driver kernel modules to be used when installing the GPU driver.
492
        // Accepted values are auto, proprietary and open. NOTE: If auto is chosen, it means that the recommended kernel module
493
        // type is chosen based on the GPU devices on the host and the driver branch used
494
        // +kubebuilder:validation:Enum=auto;open;proprietary
495
        // +kubebuilder:default=auto
496
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Kernel Module Type"
497
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.description="Kernel Module Type"
498
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:select:auto,urn:alm:descriptor:com.tectonic.ui:select:open,urn:alm:descriptor:com.tectonic.ui:select:proprietary"
499
        KernelModuleType string `json:"kernelModuleType,omitempty"`
500

501
        // Enabled indicates if deployment of NVIDIA Driver through operator is enabled
502
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
503
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA Driver deployment through GPU Operator"
504
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
505
        Enabled *bool `json:"enabled,omitempty"`
506

507
        // NVIDIA Driver container startup probe settings
508
        StartupProbe *ContainerProbeSpec `json:"startupProbe,omitempty"`
509

510
        // NVIDIA Driver container liveness probe settings
511
        LivenessProbe *ContainerProbeSpec `json:"livenessProbe,omitempty"`
512

513
        // NVIDIA Driver container readiness probe settings
514
        ReadinessProbe *ContainerProbeSpec `json:"readinessProbe,omitempty"`
515

516
        GPUDirectRDMA *GPUDirectRDMASpec `json:"rdma,omitempty"`
517

518
        // Driver auto-upgrade settings
519
        UpgradePolicy *upgrade_v1alpha1.DriverUpgradePolicySpec `json:"upgradePolicy,omitempty"`
520

521
        // NVIDIA Driver image repository
522
        // +kubebuilder:validation:Optional
523
        Repository string `json:"repository,omitempty"`
524

525
        // NVIDIA Driver image name
526
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
527
        Image string `json:"image,omitempty"`
528

529
        // NVIDIA Driver image tag
530
        // +kubebuilder:validation:Optional
531
        Version string `json:"version,omitempty"`
532

533
        // Image pull policy
534
        // +kubebuilder:validation:Optional
535
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
536
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
537
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
538
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
539

540
        // Image pull secrets
541
        // +kubebuilder:validation:Optional
542
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
543
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
544
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
545
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
546

547
        // Manager represents configuration for NVIDIA Driver Manager initContainer
548
        Manager DriverManagerSpec `json:"manager,omitempty"`
549

550
        // Optional: Define resources requests and limits for each pod
551
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
552
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
553
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
554
        Resources *ResourceRequirements `json:"resources,omitempty"`
555

556
        // Optional: List of arguments
557
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
558
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
559
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
560
        Args []string `json:"args,omitempty"`
561

562
        // Optional: List of environment variables
563
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
564
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
565
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
566
        Env []EnvVar `json:"env,omitempty"`
567

568
        // Optional: Custom repo configuration for NVIDIA Driver container
569
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
570
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Custom Repo Configuration For NVIDIA Driver Container"
571
        RepoConfig *DriverRepoConfigSpec `json:"repoConfig,omitempty"`
572

573
        // Optional: Custom certificates configuration for NVIDIA Driver container
574
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
575
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Custom Certificates Configuration For NVIDIA Driver Container"
576
        CertConfig *DriverCertConfigSpec `json:"certConfig,omitempty"`
577

578
        // Optional: Licensing configuration for NVIDIA vGPU licensing
579
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
580
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Licensing Configuration For NVIDIA vGPU Driver Container"
581
        LicensingConfig *DriverLicensingConfigSpec `json:"licensingConfig,omitempty"`
582

583
        // Optional: Virtual Topology Daemon configuration for NVIDIA vGPU drivers
584
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
585
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Custom Virtual Topology Daemon Configuration For vGPU Driver Container"
586
        VirtualTopology *VirtualTopologyConfigSpec `json:"virtualTopology,omitempty"`
587

588
        // Optional: Kernel module configuration parameters for the NVIDIA Driver
589
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
590
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Kernel module configuration parameters for the NVIDIA driver"
591
        KernelModuleConfig *KernelModuleConfigSpec `json:"kernelModuleConfig,omitempty"`
592
}
593

594
// VGPUManagerSpec defines the properties for the NVIDIA vGPU Manager deployment
595
type VGPUManagerSpec struct {
596
        // Enabled indicates if deployment of NVIDIA vGPU Manager through operator is enabled
597
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
598
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable vgpu host driver deployment through GPU Operator"
599
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
600
        Enabled *bool `json:"enabled,omitempty"`
601

602
        // NVIDIA vGPU Manager image repository
603
        // +kubebuilder:validation:Optional
604
        Repository string `json:"repository,omitempty"`
605

606
        // NVIDIA vGPU Manager  image name
607
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
608
        Image string `json:"image,omitempty"`
609

610
        // NVIDIA vGPU Manager image tag
611
        // +kubebuilder:validation:Optional
612
        Version string `json:"version,omitempty"`
613

614
        // Image pull policy
615
        // +kubebuilder:validation:Optional
616
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
617
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
618
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
619
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
620

621
        // Image pull secrets
622
        // +kubebuilder:validation:Optional
623
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
624
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
625
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
626
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
627

628
        // Optional: Define resources requests and limits for each pod
629
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
630
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
631
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
632
        Resources *ResourceRequirements `json:"resources,omitempty"`
633

634
        // Optional: List of arguments
635
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
636
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
637
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
638
        Args []string `json:"args,omitempty"`
639

640
        // Optional: List of environment variables
641
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
642
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
643
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
644
        Env []EnvVar `json:"env,omitempty"`
645

646
        // DriverManager represents configuration for NVIDIA Driver Manager initContainer
647
        DriverManager DriverManagerSpec `json:"driverManager,omitempty"`
648
}
649

650
// ToolkitSpec defines the properties for NVIDIA Container Toolkit deployment
651
type ToolkitSpec struct {
652
        // Enabled indicates if deployment of NVIDIA Container Toolkit through operator is enabled
653
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
654
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA Container Toolkit deployment through GPU Operator"
655
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
656
        Enabled *bool `json:"enabled,omitempty"`
657

658
        // NVIDIA Container Toolkit image repository
659
        // +kubebuilder:validation:Optional
660
        Repository string `json:"repository,omitempty"`
661

662
        // NVIDIA Container Toolkit image name
663
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
664
        Image string `json:"image,omitempty"`
665

666
        // NVIDIA Container Toolkit image tag
667
        // +kubebuilder:validation:Optional
668
        Version string `json:"version,omitempty"`
669

670
        // Image pull policy
671
        // +kubebuilder:validation:Optional
672
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
673
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
674
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
675
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
676

677
        // Image pull secrets
678
        // +kubebuilder:validation:Optional
679
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
680
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
681
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
682
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
683

684
        // Optional: Define resources requests and limits for each pod
685
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
686
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
687
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
688
        Resources *ResourceRequirements `json:"resources,omitempty"`
689

690
        // Optional: List of arguments
691
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
692
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
693
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
694
        Args []string `json:"args,omitempty"`
695

696
        // Optional: List of environment variables
697
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
698
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
699
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
700
        Env []EnvVar `json:"env,omitempty"`
701

702
        // Toolkit install directory on the host
703
        // +kubebuilder:validation:Optional
704
        // +kubebuilder:default=/usr/local/nvidia
705
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
706
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Toolkit install directory on the host"
707
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
708
        InstallDir string `json:"installDir,omitempty"`
709
}
710

711
// DevicePluginSpec defines the properties for NVIDIA Device Plugin deployment
712
type DevicePluginSpec struct {
713
        // Enabled indicates if deployment of NVIDIA Device Plugin through operator is enabled
714
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
715
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA Device Plugin deployment through GPU Operator"
716
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
717
        Enabled *bool `json:"enabled,omitempty"`
718

719
        // NVIDIA Device Plugin image repository
720
        // +kubebuilder:validation:Optional
721
        Repository string `json:"repository,omitempty"`
722

723
        // NVIDIA Device Plugin image name
724
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
725
        Image string `json:"image,omitempty"`
726

727
        // NVIDIA Device Plugin image tag
728
        // +kubebuilder:validation:Optional
729
        Version string `json:"version,omitempty"`
730

731
        // Image pull policy
732
        // +kubebuilder:validation:Optional
733
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
734
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
735
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
736
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
737

738
        // Image pull secrets
739
        // +kubebuilder:validation:Optional
740
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
741
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
742
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
743
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
744

745
        // Optional: Define resources requests and limits for each pod
746
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
747
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
748
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
749
        Resources *ResourceRequirements `json:"resources,omitempty"`
750

751
        // Optional: List of arguments
752
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
753
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
754
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
755
        Args []string `json:"args,omitempty"`
756

757
        // Optional: List of environment variables
758
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
759
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
760
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
761
        Env []EnvVar `json:"env,omitempty"`
762

763
        // Optional: Configuration for the NVIDIA Device Plugin via the ConfigMap
764
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
765
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Configuration for the NVIDIA Device Plugin via the ConfigMap"
766
        Config *DevicePluginConfig `json:"config,omitempty"`
767

768
        // Optional: MPS related configuration for the NVIDIA Device Plugin
769
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
770
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="MPS related configuration for the NVIDIA Device Plugin"
771
        MPS *MPSConfig `json:"mps,omitempty"`
772
}
773

774
// DevicePluginConfig defines ConfigMap name for NVIDIA Device Plugin config
775
type DevicePluginConfig struct {
776
        // ConfigMap name for NVIDIA Device Plugin config including shared config between plugin and GFD
777
        // +kubebuilder:validation:Optional
778
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
779
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap name for NVIDIA Device Plugin including shared config between plugin and GFD"
780
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
781
        Name string `json:"name,omitempty"`
782
        // Default config name within the ConfigMap for the NVIDIA Device Plugin  config
783
        // +kubebuilder:validation:Optional
784
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
785
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Default config name within the ConfigMap for the NVIDIA Device Plugin config"
786
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
787
        Default string `json:"default,omitempty"`
788
}
789

790
// MPSConfig defines MPS related configuration for the NVIDIA Device Plugin
791
type MPSConfig struct {
792
        // Root defines the MPS root path on the host
793
        // +kubebuilder:validation:Optional
794
        // +kubebuilder:default=/run/nvidia/mps
795
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
796
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="MPS root path on the host"
797
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
798
        Root string `json:"root,omitempty"`
799
}
800

801
// SandboxDevicePluginSpec defines the properties for the NVIDIA Sandbox Device Plugin deployment
802
type SandboxDevicePluginSpec struct {
803
        // Enabled indicates if deployment of NVIDIA Sandbox Device Plugin through operator is enabled
804
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
805
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA Sandbox Device Plugin deployment through GPU Operator"
806
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
807
        Enabled *bool `json:"enabled,omitempty"`
808

809
        // NVIDIA Sandbox Device Plugin image repository
810
        // +kubebuilder:validation:Optional
811
        Repository string `json:"repository,omitempty"`
812

813
        // NVIDIA Sandbox Device Plugin image name
814
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
815
        Image string `json:"image,omitempty"`
816

817
        // NVIDIA Sandbox Device Plugin image tag
818
        // +kubebuilder:validation:Optional
819
        Version string `json:"version,omitempty"`
820

821
        // Image pull policy
822
        // +kubebuilder:validation:Optional
823
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
824
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
825
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
826
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
827

828
        // Image pull secrets
829
        // +kubebuilder:validation:Optional
830
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
831
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
832
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
833
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
834

835
        // Optional: Define resources requests and limits for each pod
836
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
837
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
838
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
839
        Resources *ResourceRequirements `json:"resources,omitempty"`
840

841
        // Optional: List of arguments
842
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
843
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
844
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
845
        Args []string `json:"args,omitempty"`
846

847
        // Optional: List of environment variables
848
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
849
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
850
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
851
        Env []EnvVar `json:"env,omitempty"`
852
}
853

854
// DRADriverSpec defines the properties for the NVIDIA DRA Driver deployment
855
type DRADriverSpec struct {
856
        // NVIDIA DRA Driver image repository
857
        // +kubebuilder:validation:Optional
858
        Repository string `json:"repository,omitempty"`
859

860
        // NVIDIA DRA Driver image name
861
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
862
        Image string `json:"image,omitempty"`
863

864
        // NVIDIA DRA Driver image tag
865
        // +kubebuilder:validation:Optional
866
        Version string `json:"version,omitempty"`
867

868
        // Image pull policy
869
        // +kubebuilder:validation:Optional
870
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
871
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
872
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
873
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
874

875
        // Image pull secrets
876
        // +kubebuilder:validation:Optional
877
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
878
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
879
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
880
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
881

882
        // GPUs defines configuration for GPUs in the NVIDIA DRA Driver
883
        GPUs DRADriverGPUs `json:"gpus,omitempty"`
884

885
        // ComputeDomains defines configuration for ComputeDomains in the NVIDIA DRA Driver
886
        ComputeDomains DRADriverComputeDomains `json:"computeDomains,omitempty"`
887
}
888

889
// DRADriverGPUs defines configuration for GPUs in the NVIDIA DRA Driver
890
type DRADriverGPUs struct {
891
        // Enabled indicates if GPUs are enabled in the NVIDIA DRA Driver
892
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
893
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable GPUs in the NVIDIA DRA Driver"
894
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
895
        Enabled *bool `json:"enabled,omitempty"`
896

897
        // KubeletPlugin defines configuration for the NVIDIA DRA Driver kubelet plugin
898
        KubeletPlugin DRADriverKubeletPlugin `json:"kubeletPlugin,omitempty"`
899
}
900

901
// DRADriverComputeDomains defines configuration for ComputeDomains in the NVIDIA DRA Driver
902
type DRADriverComputeDomains struct {
903
        // Enabled indicates if ComputeDomains are enabled in the NVIDIA DRA Driver
904
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
905
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable ComputeDomains in the NVIDIA DRA Driver"
906
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
907
        Enabled *bool `json:"enabled,omitempty"`
908

909
        // Controller defines configuration for the NVIDIA DRA Driver controller
910
        Controller DRADriverController `json:"controller,omitempty"`
911

912
        // KubeletPlugin defines configuration for the NVIDIA DRA Driver kubelet plugin
913
        KubeletPlugin DRADriverKubeletPlugin `json:"kubeletPlugin,omitempty"`
914
}
915

916
// DRADriverController defines configuration for the NVIDIA DRA Driver controller
917
type DRADriverController struct {
918
        // Optional: List of environment variables
919
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
920
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
921
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
922
        Env []EnvVar `json:"env,omitempty"`
923

924
        // Optional: Define resources requests and limits
925
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
926
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
927
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
928
        Resources *ResourceRequirements `json:"resources,omitempty"`
929

930
        // Optional: Set tolerations
931
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
932
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Tolerations"
933
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:io.kubernetes:Tolerations"
934
        Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
935
}
936

937
// DRADriverKubeletPlugin defines configuration for the NVIDIA DRA Driver kubelet plugin
938
type DRADriverKubeletPlugin struct {
939
        // Optional: List of environment variables
940
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
941
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
942
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
943
        Env []EnvVar `json:"env,omitempty"`
944

945
        // Optional: Define resources requests and limits
946
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
947
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
948
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
949
        Resources *ResourceRequirements `json:"resources,omitempty"`
950
}
951

952
// DCGMExporterSpec defines the properties for NVIDIA DCGM Exporter deployment
953
type DCGMExporterSpec struct {
954
        // Enabled indicates if deployment of NVIDIA DCGM Exporter through operator is enabled
955
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
956
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA DCGM Exporter deployment through GPU Operator"
957
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
958
        Enabled *bool `json:"enabled,omitempty"`
959

960
        // NVIDIA DCGM Exporter image repository
961
        // +kubebuilder:validation:Optional
962
        Repository string `json:"repository,omitempty"`
963

964
        // NVIDIA DCGM Exporter image name
965
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
966
        Image string `json:"image,omitempty"`
967

968
        // NVIDIA DCGM Exporter image tag
969
        // +kubebuilder:validation:Optional
970
        Version string `json:"version,omitempty"`
971

972
        // Image pull policy
973
        // +kubebuilder:validation:Optional
974
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
975
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
976
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
977
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
978

979
        // Image pull secrets
980
        // +kubebuilder:validation:Optional
981
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
982
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
983
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
984
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
985

986
        // Optional: Define resources requests and limits for each pod
987
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
988
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
989
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
990
        Resources *ResourceRequirements `json:"resources,omitempty"`
991

992
        // Optional: List of arguments
993
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
994
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
995
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
996
        Args []string `json:"args,omitempty"`
997

998
        // Optional: List of environment variables
999
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1000
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1001
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1002
        Env []EnvVar `json:"env,omitempty"`
1003

1004
        // Optional: Custom metrics configuration for NVIDIA DCGM Exporter
1005
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1006
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Custom Metrics Configuration For DCGM Exporter"
1007
        MetricsConfig *DCGMExporterMetricsConfig `json:"config,omitempty"`
1008

1009
        // Optional: ServiceMonitor configuration for NVIDIA DCGM Exporter
1010
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1011
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ServiceMonitor configuration for NVIDIA DCGM Exporter"
1012
        ServiceMonitor *DCGMExporterServiceMonitorConfig `json:"serviceMonitor,omitempty"`
1013

1014
        // Optional: Service configuration for NVIDIA DCGM Exporter
1015
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1016
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Service configuration for NVIDIA DCGM Exporter"
1017
        ServiceSpec *DCGMExporterServiceConfig `json:"service,omitempty"`
1018
}
1019

1020
// DCGMExporterMetricsConfig defines metrics to be collected by NVIDIA DCGM Exporter
1021
type DCGMExporterMetricsConfig struct {
1022
        // ConfigMap name with file dcgm-metrics.csv for metrics to be collected by NVIDIA DCGM Exporter
1023
        // +kubebuilder:validation:Optional
1024
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1025
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap name with file dcgm-metrics.csv"
1026
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1027
        Name string `json:"name,omitempty"`
1028
}
1029

1030
// DCGMExporterServiceConfig defines the configuration options for the Kubernetes Service deployed for DCGM Exporter
1031
type DCGMExporterServiceConfig struct {
1032
        // Type represents the ServiceType which describes ingress methods for a service
1033
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1034
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ServiceType for the DCGM Exporter K8s Service"
1035
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1036
        Type corev1.ServiceType `json:"type,omitempty"`
1037

1038
        // InternalTrafficPolicy describes how nodes distribute service traffic they receive on the ClusterIP.
1039
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1040
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Internal Traffic Policy for the DCGM Exporter K8s Service"
1041
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1042
        InternalTrafficPolicy *corev1.ServiceInternalTrafficPolicy `json:"internalTrafficPolicy,omitempty"`
1043
}
1044

1045
// DCGMExporterServiceMonitorConfig defines configuration options for the ServiceMonitor
1046
// deployed for DCGM Exporter
1047
type DCGMExporterServiceMonitorConfig struct {
1048
        // Enabled indicates if ServiceMonitor is deployed for NVIDIA DCGM Exporter
1049
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1050
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable deployment of NVIDIA DCGM Exporter ServiceMonitor"
1051
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1052
        Enabled *bool `json:"enabled,omitempty"`
1053

1054
        // Interval which metrics should be scraped from NVIDIA DCGM Exporter. If not specified Prometheus’ global scrape interval is used.
1055
        // Supported units: y, w, d, h, m, s, ms
1056
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1057
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Interval which metrics should be scraped from NVDIA DCGM Exporter"
1058
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1059
        Interval promv1.Duration `json:"interval,omitempty"`
1060

1061
        // HonorLabels chooses the metric’s labels on collisions with target labels.
1062
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1063
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Choose the metric's label on collisions with target labels"
1064
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1065
        HonorLabels *bool `json:"honorLabels,omitempty"`
1066

1067
        // AdditionalLabels to add to ServiceMonitor instance for NVIDIA DCGM Exporter
1068
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1069
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Additional labels to add to ServiceMonitor instance for NVIDIA DCGM Exporter"
1070
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1071
        AdditionalLabels map[string]string `json:"additionalLabels,omitempty"`
1072

1073
        // Relabelings allows to rewrite labels on metric sets for NVIDIA DCGM Exporter
1074
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1075
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Relabelings allows to rewrite labels on metric sets for NVIDIA DCGM Exporter"
1076
        Relabelings []*promv1.RelabelConfig `json:"relabelings,omitempty"`
1077
}
1078

1079
// DCGMSpec defines the properties for NVIDIA DCGM deployment
1080
type DCGMSpec struct {
1081
        // Enabled indicates if deployment of NVIDIA DCGM Hostengine as a separate pod is enabled.
1082
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1083
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA DCGM hostengine as a separate Pod"
1084
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1085
        Enabled *bool `json:"enabled,omitempty"`
1086

1087
        // NVIDIA DCGM image repository
1088
        // +kubebuilder:validation:Optional
1089
        Repository string `json:"repository,omitempty"`
1090

1091
        // NVIDIA DCGM image name
1092
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1093
        Image string `json:"image,omitempty"`
1094

1095
        // NVIDIA DCGM image tag
1096
        // +kubebuilder:validation:Optional
1097
        Version string `json:"version,omitempty"`
1098

1099
        // Image pull policy
1100
        // +kubebuilder:validation:Optional
1101
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1102
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1103
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1104
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1105

1106
        // Image pull secrets
1107
        // +kubebuilder:validation:Optional
1108
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1109
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1110
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1111
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1112

1113
        // Optional: Define resources requests and limits for each pod
1114
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1115
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
1116
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
1117
        Resources *ResourceRequirements `json:"resources,omitempty"`
1118

1119
        // Optional: List of arguments
1120
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1121
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1122
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1123
        Args []string `json:"args,omitempty"`
1124

1125
        // Optional: List of environment variables
1126
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1127
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1128
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1129
        Env []EnvVar `json:"env,omitempty"`
1130

1131
        // Deprecated: HostPort represents host port that needs to be bound for DCGM engine (Default: 5555)
1132
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Host port to bind for DCGM engine"
1133
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:number"
1134
        HostPort int32 `json:"hostPort,omitempty"`
1135
}
1136

1137
// NodeStatusExporterSpec defines the properties for node-status-exporter state
1138
type NodeStatusExporterSpec struct {
1139
        // Enabled indicates if deployment of Node Status Exporter is enabled.
1140
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1141
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable Node Status Exporter deployment through GPU Operator"
1142
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1143
        Enabled *bool `json:"enabled,omitempty"`
1144

1145
        // Node Status Exporterimage repository
1146
        // +kubebuilder:validation:Optional
1147
        Repository string `json:"repository,omitempty"`
1148

1149
        // Node Status Exporter image name
1150
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1151
        Image string `json:"image,omitempty"`
1152

1153
        // Node Status Exporterimage tag
1154
        // +kubebuilder:validation:Optional
1155
        Version string `json:"version,omitempty"`
1156

1157
        // Image pull policy
1158
        // +kubebuilder:validation:Optional
1159
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1160
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1161
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1162
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1163

1164
        // Image pull secrets
1165
        // +kubebuilder:validation:Optional
1166
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1167
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1168
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1169
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1170

1171
        // Optional: Define resources requests and limits for each pod
1172
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1173
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
1174
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
1175
        Resources *ResourceRequirements `json:"resources,omitempty"`
1176

1177
        // Optional: List of arguments
1178
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1179
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1180
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1181
        Args []string `json:"args,omitempty"`
1182

1183
        // Optional: List of environment variables
1184
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1185
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1186
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1187
        Env []EnvVar `json:"env,omitempty"`
1188
}
1189

1190
// DriverRepoConfigSpec defines custom repo configuration for NVIDIA Driver container
1191
type DriverRepoConfigSpec struct {
1192
        // +kubebuilder:validation:Optional
1193
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1194
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap Name"
1195
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1196
        ConfigMapName string `json:"configMapName,omitempty"`
1197
}
1198

1199
// DriverCertConfigSpec defines custom certificates configuration for NVIDIA Driver container
1200
type DriverCertConfigSpec struct {
1201
        // +kubebuilder:validation:Optional
1202
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1203
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap Name"
1204
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1205
        Name string `json:"name,omitempty"`
1206
}
1207

1208
// DriverLicensingConfigSpec defines licensing server configuration for NVIDIA Driver container
1209
type DriverLicensingConfigSpec struct {
1210
        // +kubebuilder:validation:Optional
1211
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1212
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap Name"
1213
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1214
        ConfigMapName string `json:"configMapName,omitempty"`
1215

1216
        // NLSEnabled indicates if NVIDIA Licensing System is used for licensing.
1217
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1218
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA Licensing System licensing"
1219
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1220
        NLSEnabled *bool `json:"nlsEnabled,omitempty"`
1221
}
1222

1223
// VirtualTopologyConfigSpec defines virtual topology daemon configuration with NVIDIA vGPU
1224
type VirtualTopologyConfigSpec struct {
1225
        // Optional: Config name representing virtual topology daemon configuration file nvidia-topologyd.conf
1226
        // +kubebuilder:validation:Optional
1227
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1228
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap Name"
1229
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1230
        Config string `json:"config,omitempty"`
1231
}
1232

1233
// KernelModuleConfigSpec defines custom configuration parameters for the NVIDIA Driver
1234
type KernelModuleConfigSpec struct {
1235
        // +kubebuilder:validation:Optional
1236
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1237
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap Name"
1238
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1239
        Name string `json:"name,omitempty"`
1240
}
1241

1242
// RollingUpdateSpec defines configuration for the rolling update of all DaemonSet pods
1243
type RollingUpdateSpec struct {
1244
        // +kubebuilder:validation:Optional
1245
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1246
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Maximum number of nodes to simultaneously apply Daemonset pod updates on. Default 1"
1247
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1248
        MaxUnavailable string `json:"maxUnavailable,omitempty"`
1249
}
1250

1251
// GPUFeatureDiscoverySpec defines the properties for GPU Feature Discovery Plugin
1252
type GPUFeatureDiscoverySpec struct {
1253
        // Enabled indicates if deployment of GPU Feature Discovery Plugin is enabled.
1254
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1255
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable GPU Feature Discovery Plugin deployment through GPU Operator"
1256
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1257
        Enabled *bool `json:"enabled,omitempty"`
1258

1259
        // GFD image repository
1260
        // +kubebuilder:validation:Optional
1261
        Repository string `json:"repository,omitempty"`
1262

1263
        // GFD image name
1264
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1265
        Image string `json:"image,omitempty"`
1266

1267
        // GFD image tag
1268
        // +kubebuilder:validation:Optional
1269
        Version string `json:"version,omitempty"`
1270

1271
        // Image pull policy
1272
        // +kubebuilder:validation:Optional
1273
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1274
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1275
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1276
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1277

1278
        // Image pull secrets
1279
        // +kubebuilder:validation:Optional
1280
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1281
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1282
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1283
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1284

1285
        // Optional: Define resources requests and limits for each pod
1286
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1287
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
1288
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
1289
        Resources *ResourceRequirements `json:"resources,omitempty"`
1290

1291
        // Optional: List of arguments
1292
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1293
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1294
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1295
        Args []string `json:"args,omitempty"`
1296

1297
        // Optional: List of environment variables
1298
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1299
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1300
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1301
        Env []EnvVar `json:"env,omitempty"`
1302
}
1303

1304
// MIGManagerSpec defines the properties for deploying NVIDIA MIG Manager
1305
type MIGManagerSpec struct {
1306
        // Enabled indicates if deployment of NVIDIA MIG Manager is enabled
1307
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1308
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA MIG Manager deployment through GPU Operator"
1309
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1310
        Enabled *bool `json:"enabled,omitempty"`
1311

1312
        // NVIDIA MIG Manager image repository
1313
        // +kubebuilder:validation:Optional
1314
        Repository string `json:"repository,omitempty"`
1315

1316
        // NVIDIA MIG Manager image name
1317
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1318
        Image string `json:"image,omitempty"`
1319

1320
        // NVIDIA MIG Manager image tag
1321
        // +kubebuilder:validation:Optional
1322
        Version string `json:"version,omitempty"`
1323

1324
        // Image pull policy
1325
        // +kubebuilder:validation:Optional
1326
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1327
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1328
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1329
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1330

1331
        // Image pull secrets
1332
        // +kubebuilder:validation:Optional
1333
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1334
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1335
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1336
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1337

1338
        // Optional: Define resources requests and limits for each pod
1339
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1340
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
1341
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
1342
        Resources *ResourceRequirements `json:"resources,omitempty"`
1343

1344
        // Optional: List of arguments
1345
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1346
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1347
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1348
        Args []string `json:"args,omitempty"`
1349

1350
        // Optional: List of environment variables
1351
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1352
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1353
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1354
        Env []EnvVar `json:"env,omitempty"`
1355

1356
        // Optional: Custom mig-parted configuration for NVIDIA MIG Manager container
1357
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1358
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Custom mig-parted configuration for NVIDIA MIG Manager container"
1359
        Config *MIGPartedConfigSpec `json:"config,omitempty"`
1360

1361
        // Optional: Custom gpu-clients configuration for NVIDIA MIG Manager container
1362
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1363
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Custom gpu-clients configuration for NVIDIA MIG Manager container"
1364
        GPUClientsConfig *MIGGPUClientsConfigSpec `json:"gpuClientsConfig,omitempty"`
1365
}
1366

1367
// GPUDirectRDMASpec defines the properties for nvidia-peermem deployment
1368
type GPUDirectRDMASpec struct {
1369
        // Enabled indicates if GPUDirect RDMA is enabled through GPU operator
1370
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1371
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable GPUDirect RDMA through GPU operator"
1372
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1373
        Enabled *bool `json:"enabled,omitempty"`
1374
        // UseHostMOFED indicates to use MOFED drivers directly installed on the host to enable GPUDirect RDMA
1375
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1376
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Use MOFED drivers directly installed on the host to enable GPUDirect RDMA"
1377
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1378
        UseHostMOFED *bool `json:"useHostMofed,omitempty"`
1379
}
1380

1381
// GPUDirectStorageSpec defines the properties for NVIDIA GPUDirect Storage Driver deployment(Experimental)
1382
type GPUDirectStorageSpec struct {
1383
        // Enabled indicates if GPUDirect Storage is enabled through GPU operator
1384
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1385
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable GPUDirect Storage through GPU operator"
1386
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1387
        Enabled *bool `json:"enabled,omitempty"`
1388

1389
        // NVIDIA GPUDirect Storage Driver image repository
1390
        // +kubebuilder:validation:Optional
1391
        Repository string `json:"repository,omitempty"`
1392

1393
        // NVIDIA GPUDirect Storage Driver image name
1394
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1395
        Image string `json:"image,omitempty"`
1396

1397
        // NVIDIA GPUDirect Storage Driver image tag
1398
        // +kubebuilder:validation:Optional
1399
        Version string `json:"version,omitempty"`
1400

1401
        // Image pull policy
1402
        // +kubebuilder:validation:Optional
1403
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1404
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1405
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1406
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1407

1408
        // Image pull secrets
1409
        // +kubebuilder:validation:Optional
1410
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1411
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1412
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1413
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1414

1415
        // Optional: List of arguments
1416
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1417
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1418
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1419
        Args []string `json:"args,omitempty"`
1420

1421
        // Optional: List of environment variables
1422
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1423
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1424
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1425
        Env []EnvVar `json:"env,omitempty"`
1426
}
1427

1428
// GDRCopySpec defines the properties for NVIDIA GDRCopy driver (gdrdrv) deployment
1429
type GDRCopySpec struct {
1430
        // Enabled indicates if GDRCopy is enabled through GPU Operator
1431
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1432
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable GDRCopy through GPU operator"
1433
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1434
        Enabled *bool `json:"enabled,omitempty"`
1435

1436
        // NVIDIA GDRCopy driver image repository
1437
        // +kubebuilder:validation:Optional
1438
        Repository string `json:"repository,omitempty"`
1439

1440
        // NVIDIA GDRCopy driver image name
1441
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1442
        Image string `json:"image,omitempty"`
1443

1444
        // NVIDIA GDRCopy driver image tag
1445
        // +kubebuilder:validation:Optional
1446
        Version string `json:"version,omitempty"`
1447

1448
        // Image pull policy
1449
        // +kubebuilder:validation:Optional
1450
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1451
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1452
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1453
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1454

1455
        // Image pull secrets
1456
        // +kubebuilder:validation:Optional
1457
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1458
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1459
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1460
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1461

1462
        // Optional: List of arguments
1463
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1464
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1465
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1466
        Args []string `json:"args,omitempty"`
1467

1468
        // Optional: List of environment variables
1469
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1470
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1471
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1472
        Env []EnvVar `json:"env,omitempty"`
1473
}
1474

1475
// MIGPartedConfigSpec defines custom mig-parted config for NVIDIA MIG Manager container
1476
type MIGPartedConfigSpec struct {
1477
        // ConfigMap name
1478
        // +kubebuilder:validation:Optional
1479
        // +kubebuilder:default=default-mig-parted-config
1480
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1481
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap Name"
1482
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1483
        Name string `json:"name,omitempty"`
1484
        // Default MIG config to be applied on the node, when there is no config specified with the node label nvidia.com/mig.config
1485
        // +kubebuilder:validation:Optional
1486
        // +kubebuilder:default=all-disabled
1487
        // +kubebuilder:validation:Enum=all-disabled;""
1488
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1489
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Default MIG config"
1490
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1491
        Default string `json:"default,omitempty"`
1492
}
1493

1494
// MIGGPUClientsConfigSpec defines custom gpu-clients config for NVIDIA MIG Manager container
1495
type MIGGPUClientsConfigSpec struct {
1496
        // ConfigMap name
1497
        // +kubebuilder:validation:Optional
1498
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1499
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap Name"
1500
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1501
        Name string `json:"name,omitempty"`
1502
}
1503

1504
// KataManagerSpec defines the configuration for the kata-manager which prepares NVIDIA-specific kata runtimes
1505
type KataManagerSpec struct {
1506
        // Enabled indicates if deployment of Kata Manager is enabled
1507
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1508
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable Kata Manager deployment through GPU Operator"
1509
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1510
        Enabled *bool `json:"enabled,omitempty"`
1511

1512
        // Kata Manager config
1513
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1514
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Kata Manager configuration"
1515
        Config *kata_v1alpha1.Config `json:"config,omitempty"`
1516

1517
        // Kata Manager image repository
1518
        // +kubebuilder:validation:Optional
1519
        Repository string `json:"repository,omitempty"`
1520

1521
        // Kata Manager image name
1522
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1523
        Image string `json:"image,omitempty"`
1524

1525
        // Kata Manager image tag
1526
        // +kubebuilder:validation:Optional
1527
        Version string `json:"version,omitempty"`
1528

1529
        // Image pull policy
1530
        // +kubebuilder:validation:Optional
1531
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1532
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1533
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1534
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1535

1536
        // Image pull secrets
1537
        // +kubebuilder:validation:Optional
1538
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1539
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1540
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1541
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1542

1543
        // Optional: Define resources requests and limits for each pod
1544
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1545
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
1546
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
1547
        Resources *ResourceRequirements `json:"resources,omitempty"`
1548

1549
        // Optional: List of arguments
1550
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1551
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1552
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1553
        Args []string `json:"args,omitempty"`
1554

1555
        // Optional: List of environment variables
1556
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1557
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1558
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1559
        Env []EnvVar `json:"env,omitempty"`
1560
}
1561

1562
// CCManagerSpec defines the properties for deploying Confidential Containers (CC) manager
1563
type CCManagerSpec struct {
1564
        // Enabled indicates if deployment of CC Manager is enabled
1565
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1566
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable CC Manager deployment through GPU Operator"
1567
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1568
        Enabled *bool `json:"enabled,omitempty"`
1569

1570
        // Default CC mode setting for compatible GPUs on the node
1571
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1572
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Default CC mode setting for all CC-capable GPUs"
1573
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1574
        // +kubebuilder:validation:Enum=on;off;devtools
1575
        DefaultMode string `json:"defaultMode,omitempty"`
1576

1577
        // CC Manager image repository
1578
        // +kubebuilder:validation:Optional
1579
        Repository string `json:"repository,omitempty"`
1580

1581
        // CC Manager image name
1582
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1583
        Image string `json:"image,omitempty"`
1584

1585
        // CC Manager image tag
1586
        // +kubebuilder:validation:Optional
1587
        Version string `json:"version,omitempty"`
1588

1589
        // Image pull policy
1590
        // +kubebuilder:validation:Optional
1591
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1592
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1593
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1594
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1595

1596
        // Image pull secrets
1597
        // +kubebuilder:validation:Optional
1598
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1599
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1600
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1601
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1602

1603
        // Optional: Define resources requests and limits for each pod
1604
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1605
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
1606
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
1607
        Resources *ResourceRequirements `json:"resources,omitempty"`
1608

1609
        // Optional: List of arguments
1610
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1611
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1612
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1613
        Args []string `json:"args,omitempty"`
1614

1615
        // Optional: List of environment variables
1616
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1617
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1618
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1619
        Env []EnvVar `json:"env,omitempty"`
1620
}
1621

1622
// VFIOManagerSpec defines the properties for deploying VFIO-PCI manager
1623
type VFIOManagerSpec struct {
1624
        // Enabled indicates if deployment of VFIO Manager is enabled
1625
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1626
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable VFIO Manager deployment through GPU Operator"
1627
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1628
        Enabled *bool `json:"enabled,omitempty"`
1629

1630
        // VFIO Manager image repository
1631
        // +kubebuilder:validation:Optional
1632
        Repository string `json:"repository,omitempty"`
1633

1634
        // VFIO Manager image name
1635
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1636
        Image string `json:"image,omitempty"`
1637

1638
        // VFIO Manager image tag
1639
        // +kubebuilder:validation:Optional
1640
        Version string `json:"version,omitempty"`
1641

1642
        // Image pull policy
1643
        // +kubebuilder:validation:Optional
1644
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1645
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1646
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1647
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1648

1649
        // Image pull secrets
1650
        // +kubebuilder:validation:Optional
1651
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1652
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1653
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1654
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1655

1656
        // Optional: Define resources requests and limits for each pod
1657
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1658
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
1659
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
1660
        Resources *ResourceRequirements `json:"resources,omitempty"`
1661

1662
        // Optional: List of arguments
1663
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1664
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1665
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1666
        Args []string `json:"args,omitempty"`
1667

1668
        // Optional: List of environment variables
1669
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1670
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1671
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1672
        Env []EnvVar `json:"env,omitempty"`
1673

1674
        // DriverManager represents configuration for NVIDIA Driver Manager
1675
        DriverManager DriverManagerSpec `json:"driverManager,omitempty"`
1676
}
1677

1678
// VGPUDeviceManagerSpec defines the properties for deploying NVIDIA vGPU Device Manager
1679
type VGPUDeviceManagerSpec struct {
1680
        // Enabled indicates if deployment of NVIDIA vGPU Device Manager is enabled
1681
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1682
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA vGPU Device Manager deployment through GPU Operator"
1683
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1684
        Enabled *bool `json:"enabled,omitempty"`
1685

1686
        // NVIDIA vGPU Device Manager image repository
1687
        // +kubebuilder:validation:Optional
1688
        Repository string `json:"repository,omitempty"`
1689

1690
        // NVIDIA vGPU Device Manager image name
1691
        // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
1692
        Image string `json:"image,omitempty"`
1693

1694
        // NVIDIA vGPU Device Manager image tag
1695
        // +kubebuilder:validation:Optional
1696
        Version string `json:"version,omitempty"`
1697

1698
        // Image pull policy
1699
        // +kubebuilder:validation:Optional
1700
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1701
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
1702
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
1703
        ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
1704

1705
        // Image pull secrets
1706
        // +kubebuilder:validation:Optional
1707
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1708
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
1709
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
1710
        ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
1711

1712
        // Optional: Define resources requests and limits for each pod
1713
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1714
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
1715
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
1716
        Resources *ResourceRequirements `json:"resources,omitempty"`
1717

1718
        // Optional: List of arguments
1719
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1720
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
1721
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1722
        Args []string `json:"args,omitempty"`
1723

1724
        // Optional: List of environment variables
1725
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1726
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
1727
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
1728
        Env []EnvVar `json:"env,omitempty"`
1729

1730
        // NVIDIA vGPU devices configuration for NVIDIA vGPU Device Manager container
1731
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1732
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="NVIDIA vGPU devices configuration for NVIDIA vGPU Device Manager container"
1733
        Config *VGPUDevicesConfigSpec `json:"config,omitempty"`
1734
}
1735

1736
// VGPUDevicesConfigSpec defines vGPU devices configuration for NVIDIA vGPU Device Manager container
1737
type VGPUDevicesConfigSpec struct {
1738
        // ConfigMap name
1739
        // +kubebuilder:validation:Optional
1740
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1741
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="ConfigMap Name"
1742
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1743
        Name string `json:"name,omitempty"`
1744
        // Default config name within the ConfigMap
1745
        // +kubebuilder:validation:Optional
1746
        // +kubebuilder:default=default
1747
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1748
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Default config name within the ConfigMap for the NVIDIA vGPU devices config"
1749
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:text"
1750
        Default string `json:"default,omitempty"`
1751
}
1752

1753
// CDIConfigSpec defines how the Container Device Interface is used in the cluster.
1754
type CDIConfigSpec struct {
1755
        // Enabled indicates whether CDI can be used to make GPUs accessible to containers.
1756
        // +kubebuilder:validation:Optional
1757
        // +kubebuilder:default=false
1758
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1759
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable CDI as a mechanism for making GPUs accessible to containers"
1760
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1761
        Enabled *bool `json:"enabled,omitempty"`
1762

1763
        // Default indicates whether to use CDI as the default mechanism for providing GPU access to containers.
1764
        // +kubebuilder:validation:Optional
1765
        // +kubebuilder:default=false
1766
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
1767
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Configure CDI as the default mechanism for making GPUs accessible to containers"
1768
        // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
1769
        Default *bool `json:"default,omitempty"`
1770
}
1771

1772
// MIGStrategy indicates MIG mode
1773
type MIGStrategy string
1774

1775
// Constants representing different MIG strategies.
1776
const (
1777
        // MIGStrategyNone indicates MIG mode disabled.
1778
        MIGStrategyNone MIGStrategy = "none"
1779
        // MIGStrategySingle indicates Single MIG mode
1780
        MIGStrategySingle MIGStrategy = "single"
1781
        // MIGStrategyMixed indicates Mixed MIG mode
1782
        MIGStrategyMixed MIGStrategy = "mixed"
1783
)
1784

1785
// State indicates state of GPU operator components
1786
type State string
1787

1788
const (
1789
        // Ignored indicates duplicate ClusterPolicy instances and rest are ignored.
1790
        Ignored State = "ignored"
1791
        // Ready indicates all components of ClusterPolicy are ready
1792
        Ready State = "ready"
1793
        // NotReady indicates some/all components of ClusterPolicy are not ready
1794
        NotReady State = "notReady"
1795
        // Disabled indicates if the state is disabled
1796
        Disabled State = "disabled"
1797
)
1798

1799
// ClusterPolicyStatus defines the observed state of ClusterPolicy
1800
type ClusterPolicyStatus struct {
1801
        // +kubebuilder:validation:Enum=ignored;ready;notReady
1802
        // State indicates status of ClusterPolicy
1803
        State State `json:"state"`
1804
        // Namespace indicates a namespace in which the operator is installed
1805
        Namespace string `json:"namespace,omitempty"`
1806
        // Conditions is a list of conditions representing the ClusterPolicy's current state.
1807
        Conditions []metav1.Condition `json:"conditions,omitempty"`
1808
}
1809

1810
// +genclient
1811
// +genclient:nonNamespaced
1812
// +kubebuilder:object:root=true
1813
// +kubebuilder:subresource:status
1814
// +kubebuilder:resource:scope=Cluster
1815
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.state`,priority=0
1816
// +kubebuilder:printcolumn:name="Age",type=string,JSONPath=`.metadata.creationTimestamp`,priority=0
1817

1818
// ClusterPolicy is the Schema for the clusterpolicies API
1819
type ClusterPolicy struct {
1820
        metav1.TypeMeta   `json:",inline"`
1821
        metav1.ObjectMeta `json:"metadata,omitempty"`
1822

1823
        Spec   ClusterPolicySpec   `json:"spec,omitempty"`
1824
        Status ClusterPolicyStatus `json:"status,omitempty"`
1825
}
1826

1827
// +kubebuilder:object:root=true
1828

1829
// ClusterPolicyList contains a list of ClusterPolicy
1830
type ClusterPolicyList struct {
1831
        metav1.TypeMeta `json:",inline"`
1832
        metav1.ListMeta `json:"metadata,omitempty"`
1833
        Items           []ClusterPolicy `json:"items"`
1834
}
1835

1836
func init() {
×
1837
        SchemeBuilder.Register(&ClusterPolicy{}, &ClusterPolicyList{})
×
1838
}
×
1839

1840
// SetStatus sets state and namespace of ClusterPolicy instance
1841
func (p *ClusterPolicy) SetStatus(s State, ns string) {
×
1842
        p.Status.State = s
×
1843
        p.Status.Namespace = ns
×
1844
}
×
1845

1846
func imagePath(repository string, image string, version string, imagePathEnvName string) (string, error) {
×
1847
        // ImagePath is obtained using following priority
×
1848
        // 1. ClusterPolicy (i.e through repository/image/path variables in CRD)
×
1849
        var crdImagePath string
×
1850
        if repository == "" && version == "" {
×
1851
                if image != "" {
×
1852
                        // this is useful for tools like kbld(carvel) which transform templates into image as path@digest
×
1853
                        crdImagePath = image
×
1854
                }
×
1855
        } else {
×
1856
                // use @ if image digest is specified instead of tag
×
1857
                if strings.HasPrefix(version, "sha256:") {
×
1858
                        crdImagePath = repository + "/" + image + "@" + version
×
1859
                } else {
×
1860
                        crdImagePath = repository + "/" + image + ":" + version
×
1861
                }
×
1862
        }
1863
        if crdImagePath != "" {
×
1864
                return crdImagePath, nil
×
1865
        }
×
1866

1867
        // 2. Env passed to GPU Operator Pod (eg OLM)
1868
        envImagePath := os.Getenv(imagePathEnvName)
×
1869
        if envImagePath != "" {
×
1870
                return envImagePath, nil
×
1871
        }
×
1872

1873
        // 3. If both are not set, error out
1874
        return "", fmt.Errorf("empty image path provided through both ClusterPolicy CR and ENV %s", imagePathEnvName)
×
1875
}
1876

1877
// ImagePath sets image path for given component type
1878
func ImagePath(spec interface{}) (string, error) {
×
1879
        switch v := spec.(type) {
×
1880
        case *DriverSpec:
×
1881
                config := spec.(*DriverSpec)
×
1882
                return imagePath(config.Repository, config.Image, config.Version, "DRIVER_IMAGE")
×
1883
        case *VGPUManagerSpec:
×
1884
                config := spec.(*VGPUManagerSpec)
×
1885
                return imagePath(config.Repository, config.Image, config.Version, "VGPU_MANAGER_IMAGE")
×
1886
        case *ToolkitSpec:
×
1887
                config := spec.(*ToolkitSpec)
×
1888
                return imagePath(config.Repository, config.Image, config.Version, "CONTAINER_TOOLKIT_IMAGE")
×
1889
        case *DevicePluginSpec:
×
1890
                config := spec.(*DevicePluginSpec)
×
1891
                return imagePath(config.Repository, config.Image, config.Version, "DEVICE_PLUGIN_IMAGE")
×
1892
        case *SandboxDevicePluginSpec:
×
1893
                config := spec.(*SandboxDevicePluginSpec)
×
1894
                return imagePath(config.Repository, config.Image, config.Version, "SANDBOX_DEVICE_PLUGIN_IMAGE")
×
NEW
1895
        case *DRADriverSpec:
×
NEW
1896
                config := spec.(*DRADriverSpec)
×
NEW
1897
                return imagePath(config.Repository, config.Image, config.Version, "DRA_DRIVER_IMAGE")
×
1898
        case *DCGMExporterSpec:
×
1899
                config := spec.(*DCGMExporterSpec)
×
1900
                return imagePath(config.Repository, config.Image, config.Version, "DCGM_EXPORTER_IMAGE")
×
1901
        case *DCGMSpec:
×
1902
                config := spec.(*DCGMSpec)
×
1903
                return imagePath(config.Repository, config.Image, config.Version, "DCGM_IMAGE")
×
1904
        case *NodeStatusExporterSpec:
×
1905
                config := spec.(*NodeStatusExporterSpec)
×
1906
                return imagePath(config.Repository, config.Image, config.Version, "VALIDATOR_IMAGE")
×
1907
        case *GPUFeatureDiscoverySpec:
×
1908
                config := spec.(*GPUFeatureDiscoverySpec)
×
1909
                return imagePath(config.Repository, config.Image, config.Version, "GFD_IMAGE")
×
1910
        case *ValidatorSpec:
×
1911
                config := spec.(*ValidatorSpec)
×
1912
                return imagePath(config.Repository, config.Image, config.Version, "VALIDATOR_IMAGE")
×
1913
        case *InitContainerSpec:
×
1914
                config := spec.(*InitContainerSpec)
×
1915
                return imagePath(config.Repository, config.Image, config.Version, "CUDA_BASE_IMAGE")
×
1916
        case *MIGManagerSpec:
×
1917
                config := spec.(*MIGManagerSpec)
×
1918
                return imagePath(config.Repository, config.Image, config.Version, "MIG_MANAGER_IMAGE")
×
1919
        case *DriverManagerSpec:
×
1920
                config := spec.(*DriverManagerSpec)
×
1921
                return imagePath(config.Repository, config.Image, config.Version, "DRIVER_MANAGER_IMAGE")
×
1922
        case *GPUDirectStorageSpec:
×
1923
                config := spec.(*GPUDirectStorageSpec)
×
1924
                return imagePath(config.Repository, config.Image, config.Version, "GDS_IMAGE")
×
1925
        case *GDRCopySpec:
×
1926
                config := spec.(*GDRCopySpec)
×
1927
                return imagePath(config.Repository, config.Image, config.Version, "GDRCOPY_IMAGE")
×
1928
        case *VFIOManagerSpec:
×
1929
                config := spec.(*VFIOManagerSpec)
×
1930
                return imagePath(config.Repository, config.Image, config.Version, "VFIO_MANAGER_IMAGE")
×
1931
        case *VGPUDeviceManagerSpec:
×
1932
                config := spec.(*VGPUDeviceManagerSpec)
×
1933
                return imagePath(config.Repository, config.Image, config.Version, "VGPU_DEVICE_MANAGER_IMAGE")
×
1934
        case *KataManagerSpec:
×
1935
                config := spec.(*KataManagerSpec)
×
1936
                return imagePath(config.Repository, config.Image, config.Version, "KATA_MANAGER_IMAGE")
×
1937
        case *CCManagerSpec:
×
1938
                config := spec.(*CCManagerSpec)
×
1939
                return imagePath(config.Repository, config.Image, config.Version, "CC_MANAGER_IMAGE")
×
1940
        default:
×
1941
                return "", fmt.Errorf("invalid type to construct image path: %v", v)
×
1942
        }
1943
}
1944

1945
// ImagePullPolicy sets image pull policy
1946
func ImagePullPolicy(pullPolicy string) corev1.PullPolicy {
×
1947
        var imagePullPolicy corev1.PullPolicy
×
1948
        switch pullPolicy {
×
1949
        case "Always":
×
1950
                imagePullPolicy = corev1.PullAlways
×
1951
        case "Never":
×
1952
                imagePullPolicy = corev1.PullNever
×
1953
        case "IfNotPresent":
×
1954
                imagePullPolicy = corev1.PullIfNotPresent
×
1955
        default:
×
1956
                imagePullPolicy = corev1.PullIfNotPresent
×
1957
        }
1958
        return imagePullPolicy
×
1959
}
1960

1961
// IsEnabled returns true if driver install is enabled(default) through gpu-operator
1962
func (d *DriverSpec) IsEnabled() bool {
×
1963
        if d.Enabled == nil {
×
1964
                // default is true if not specified by user
×
1965
                return true
×
1966
        }
×
1967
        return *d.Enabled
×
1968
}
1969

1970
// UseNvdiaDriverCRDType returns true if the driver installation is managed by NVIDIADriver CRD type
1971
func (d *DriverSpec) UseNvdiaDriverCRDType() bool {
×
1972
        if d.UseNvidiaDriverCRD == nil {
×
1973
                // default is false if not specified by user
×
1974
                return false
×
1975
        }
×
1976
        return *d.UseNvidiaDriverCRD
×
1977
}
1978

1979
// UsePrecompiledDrivers returns true if driver install is enabled using pre-compiled modules
1980
func (d *DriverSpec) UsePrecompiledDrivers() bool {
×
1981
        if d.UsePrecompiled == nil {
×
1982
                // default is false if not specified by user
×
1983
                return false
×
1984
        }
×
1985
        return *d.UsePrecompiled
×
1986
}
1987

1988
// OpenKernelModulesEnabled returns true if driver install is enabled using open GPU kernel modules
1989
func (d *DriverSpec) OpenKernelModulesEnabled() bool {
×
1990
        return d.KernelModuleType == "open"
×
1991
}
×
1992

1993
// IsEnabled returns true if device-plugin is enabled(default) through gpu-operator
1994
func (p *DevicePluginSpec) IsEnabled() bool {
×
1995
        if p.Enabled == nil {
×
1996
                // default is true if not specified by user
×
1997
                return true
×
1998
        }
×
1999
        return *p.Enabled
×
2000
}
2001

2002
// IsEnabled returns true if the DRA Driver is enabled through gpu-operator
NEW
2003
func (d *DRADriverSpec) IsEnabled() bool {
×
NEW
2004
        return d.IsGPUsEnabled() || d.IsComputeDomainsEnabled()
×
NEW
2005
}
×
2006

2007
// IsGPUsEnabled returns true if the GPUs resource is enabled in the DRA Driver
NEW
2008
func (d *DRADriverSpec) IsGPUsEnabled() bool {
×
NEW
2009
        return d.GPUs.Enabled != nil && *d.GPUs.Enabled
×
NEW
2010
}
×
2011

2012
// IsComputeDomainsEnabled returns true if the ComputeDomains resource is enabled in the DRA Driver
NEW
2013
func (d *DRADriverSpec) IsComputeDomainsEnabled() bool {
×
NEW
2014
        return d.ComputeDomains.Enabled != nil && *d.ComputeDomains.Enabled
×
NEW
2015
}
×
2016

2017
// IsEnabled returns true if dcgm-exporter is enabled(default) through gpu-operator
2018
func (e *DCGMExporterSpec) IsEnabled() bool {
×
2019
        if e.Enabled == nil {
×
2020
                // default is true if not specified by user
×
2021
                return true
×
2022
        }
×
2023
        return *e.Enabled
×
2024
}
2025

2026
// IsEnabled returns true if gpu-feature-discovery is enabled(default) through gpu-operator
2027
func (g *GPUFeatureDiscoverySpec) IsEnabled() bool {
×
2028
        if g.Enabled == nil {
×
2029
                // default is true if not specified by user
×
2030
                return true
×
2031
        }
×
2032
        return *g.Enabled
×
2033
}
2034

2035
// IsEnabled returns true if VFIO-PCI Manager install is enabled through gpu-operator
2036
func (v *VFIOManagerSpec) IsEnabled() bool {
×
2037
        if v.Enabled == nil {
×
2038
                // default is false if not specified by user
×
2039
                return false
×
2040
        }
×
2041
        return *v.Enabled
×
2042
}
2043

2044
// IsEnabled returns true if vGPU Manager install is enabled through gpu-operator
2045
func (d *VGPUManagerSpec) IsEnabled() bool {
×
2046
        if d.Enabled == nil {
×
2047
                // default is false if not specified by user
×
2048
                return false
×
2049
        }
×
2050
        return *d.Enabled
×
2051
}
2052

2053
// IsEnabled returns true if vGPU Device Manager is enabled through gpu-operator
2054
func (v *VGPUDeviceManagerSpec) IsEnabled() bool {
×
2055
        if v.Enabled == nil {
×
2056
                // default is false if not specified by user
×
2057
                return false
×
2058
        }
×
2059
        return *v.Enabled
×
2060
}
2061

2062
// IsEnabled returns true if container-toolkit install is enabled(default) through gpu-operator
2063
func (t *ToolkitSpec) IsEnabled() bool {
×
2064
        if t.Enabled == nil {
×
2065
                // default is true if not specified by user
×
2066
                return true
×
2067
        }
×
2068
        return *t.Enabled
×
2069
}
2070

2071
// IsEnabled returns true if the cluster intends to run GPU accelerated
2072
// workloads in sandboxed environments (VMs).
2073
func (s *SandboxWorkloadsSpec) IsEnabled() bool {
×
2074
        if s.Enabled == nil {
×
2075
                // Sandbox workloads are disabled by default
×
2076
                return false
×
2077
        }
×
2078
        return *s.Enabled
×
2079
}
2080

2081
// IsEnabled returns true if the sandbox device plugin is enabled through gpu-operator
2082
func (s *SandboxDevicePluginSpec) IsEnabled() bool {
×
2083
        if s.Enabled == nil {
×
2084
                // default is false if not specified by user
×
2085
                return false
×
2086
        }
×
2087
        return *s.Enabled
×
2088
}
2089

2090
// IsEnabled returns true if PodSecurityAdmission configuration is enabled for all gpu-operator pods
2091
func (p *PSASpec) IsEnabled() bool {
×
2092
        if p.Enabled == nil {
×
2093
                // PSA is disabled by default
×
2094
                return false
×
2095
        }
×
2096
        return *p.Enabled
×
2097
}
2098

2099
// IsEnabled returns true if mig-manager is enabled(default) through gpu-operator
2100
func (m *MIGManagerSpec) IsEnabled() bool {
×
2101
        if m.Enabled == nil {
×
2102
                // default is true if not specified by user
×
2103
                return true
×
2104
        }
×
2105
        return *m.Enabled
×
2106
}
2107

2108
// IsEnabled returns true if node-status-exporter is
2109
// enabled through gpu-operator
2110
func (m *NodeStatusExporterSpec) IsEnabled() bool {
×
2111
        if m.Enabled == nil {
×
2112
                // default is false if not specified by user
×
2113
                return false
×
2114
        }
×
2115
        return *m.Enabled
×
2116
}
2117

2118
// IsEnabled returns true if GPUDirect RDMA are enabled through gpu-operator
2119
func (g *GPUDirectRDMASpec) IsEnabled() bool {
×
2120
        if g.Enabled == nil {
×
2121
                // GPUDirectRDMA is disabled by default
×
2122
                return false
×
2123
        }
×
2124
        return *g.Enabled
×
2125
}
2126

2127
// IsHostMOFED returns true if GPUDirect RDMA is enabled through MOFED installed on the host
2128
func (g *GPUDirectRDMASpec) IsHostMOFED() bool {
×
2129
        if g.UseHostMOFED == nil {
×
2130
                // GPUDirectRDMA is disabled by default
×
2131
                return false
×
2132
        }
×
2133
        return g.IsEnabled() && *g.UseHostMOFED
×
2134
}
2135

2136
// IsEnabled returns true if GPUDirect Storage are enabled through gpu-operator
2137
func (gds *GPUDirectStorageSpec) IsEnabled() bool {
×
2138
        if gds.Enabled == nil {
×
2139
                // GPUDirectStorage is disabled by default
×
2140
                return false
×
2141
        }
×
2142
        return *gds.Enabled
×
2143
}
2144

2145
// IsEnabled returns true if GDRCopy is enabled through gpu-operator
2146
func (gdrcopy *GDRCopySpec) IsEnabled() bool {
×
2147
        if gdrcopy.Enabled == nil {
×
2148
                // GDRCopy is disabled by default
×
2149
                return false
×
2150
        }
×
2151
        return *gdrcopy.Enabled
×
2152
}
2153

2154
// IsEnabled returns true if DCGM hostengine as a separate Pod is enabled through gpu-perator
2155
func (dcgm *DCGMSpec) IsEnabled() bool {
×
2156
        if dcgm.Enabled == nil {
×
2157
                // DCGM is enabled by default
×
2158
                return true
×
2159
        }
×
2160
        return *dcgm.Enabled
×
2161
}
2162

2163
// IsEnabled returns true if ServiceMonitor for DCGM Exporter is enabled through gpu-operator
2164
func (sm *DCGMExporterServiceMonitorConfig) IsEnabled() bool {
×
2165
        if sm.Enabled == nil {
×
2166
                // ServiceMonitor for DCGM Exporter is disabled by default
×
2167
                return false
×
2168
        }
×
2169
        return *sm.Enabled
×
2170
}
2171

2172
// IsNLSEnabled returns true if NLS should be used for licensing the driver
2173
func (l *DriverLicensingConfigSpec) IsNLSEnabled() bool {
×
2174
        if l.NLSEnabled == nil {
×
2175
                // NLS is not enabled by default
×
2176
                return false
×
2177
        }
×
2178
        return *l.NLSEnabled
×
2179
}
2180

2181
// IsEnabled returns true if CDI is enabled as a mechanism for
2182
// providing GPU access to containers
2183
func (c *CDIConfigSpec) IsEnabled() bool {
×
2184
        if c.Enabled == nil {
×
2185
                return false
×
2186
        }
×
2187
        return *c.Enabled
×
2188
}
2189

2190
// IsDefault returns true if CDI is enabled as the default
2191
// mechanism for providing GPU access to containers
2192
func (c *CDIConfigSpec) IsDefault() bool {
×
2193
        if c.Default == nil {
×
2194
                return false
×
2195
        }
×
2196
        return *c.Default
×
2197
}
2198

2199
// IsEnabled returns true if Kata Manager is enabled
2200
func (k *KataManagerSpec) IsEnabled() bool {
×
2201
        if k.Enabled == nil {
×
2202
                return false
×
2203
        }
×
2204
        return *k.Enabled
×
2205
}
2206

2207
// IsEnabled returns true if CC Manager is enabled for configuring
2208
// CC mode on compatible GPUs on the node
2209
func (c *CCManagerSpec) IsEnabled() bool {
×
2210
        if c.Enabled == nil {
×
2211
                return false
×
2212
        }
×
2213
        return *c.Enabled
×
2214
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc