@@ -53,6 +53,8 @@ type ClusterPolicySpec struct {
5353 Toolkit ToolkitSpec `json:"toolkit"`
5454 // DevicePlugin component spec
5555 DevicePlugin DevicePluginSpec `json:"devicePlugin"`
56+ // DRADriver component spec
57+ DRADriver DRADriverSpec `json:"draDriver"`
5658 // DCGMExporter spec
5759 DCGMExporter DCGMExporterSpec `json:"dcgmExporter"`
5860 // DCGM component spec
@@ -841,6 +843,60 @@ type SandboxDevicePluginSpec struct {
841843 Env []EnvVar `json:"env,omitempty"`
842844}
843845
846+ // DRADriverSpec defines the properties for the NVIDIA DRA Driver deployment
847+ // TODO: add 'controller' and 'kubeletPlugin' structs to allow for per-component configuration
848+ type DRADriverSpec struct {
849+ // Enabled indicates if the deployment of NVIDIA DRA Driver through the operator is enabled
850+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
851+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable NVIDIA DRA Driver deployment through GPU Operator"
852+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
853+ Enabled * bool `json:"enabled,omitempty"`
854+
855+ // NVIDIA DRA Driver image repository
856+ // +kubebuilder:validation:Optional
857+ Repository string `json:"repository,omitempty"`
858+
859+ // NVIDIA DRA Driver image name
860+ // +kubebuilder:validation:Pattern=[a-zA-Z0-9\-]+
861+ Image string `json:"image,omitempty"`
862+
863+ // NVIDIA DRA Driver image tag
864+ // +kubebuilder:validation:Optional
865+ Version string `json:"version,omitempty"`
866+
867+ // Image pull policy
868+ // +kubebuilder:validation:Optional
869+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
870+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image Pull Policy"
871+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:imagePullPolicy"
872+ ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
873+
874+ // Image pull secrets
875+ // +kubebuilder:validation:Optional
876+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
877+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Image pull secrets"
878+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
879+ ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`
880+
881+ // Optional: Define resources requests and limits for each pod
882+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
883+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
884+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:resourceRequirements"
885+ Resources * ResourceRequirements `json:"resources,omitempty"`
886+
887+ // Optional: List of arguments
888+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
889+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Arguments"
890+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
891+ Args []string `json:"args,omitempty"`
892+
893+ // Optional: List of environment variables
894+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
895+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Environment Variables"
896+ // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:advanced,urn:alm:descriptor:com.tectonic.ui:text"
897+ Env []EnvVar `json:"env,omitempty"`
898+ }
899+
844900// DCGMExporterSpec defines the properties for NVIDIA DCGM Exporter deployment
845901type DCGMExporterSpec struct {
846902 // Enabled indicates if deployment of NVIDIA DCGM Exporter through operator is enabled
@@ -1764,6 +1820,9 @@ func ImagePath(spec interface{}) (string, error) {
17641820 case * SandboxDevicePluginSpec :
17651821 config := spec .(* SandboxDevicePluginSpec )
17661822 return imagePath (config .Repository , config .Image , config .Version , "SANDBOX_DEVICE_PLUGIN_IMAGE" )
1823+ case * DRADriverSpec :
1824+ config := spec .(* DRADriverSpec )
1825+ return imagePath (config .Repository , config .Image , config .Version , "DRA_DRIVER_IMAGE" )
17671826 case * DCGMExporterSpec :
17681827 config := spec .(* DCGMExporterSpec )
17691828 return imagePath (config .Repository , config .Image , config .Version , "DCGM_EXPORTER_IMAGE" )
@@ -1872,6 +1931,15 @@ func (p *DevicePluginSpec) IsEnabled() bool {
18721931 return * p .Enabled
18731932}
18741933
1934+ // IsEnabled returns true if draDriver is enabled through gpu-operator
1935+ func (d * DRADriverSpec ) IsEnabled () bool {
1936+ if d .Enabled == nil {
1937+ // default is true if not specified by user
1938+ return true
1939+ }
1940+ return * d .Enabled
1941+ }
1942+
18751943// IsEnabled returns true if dcgm-exporter is enabled(default) through gpu-operator
18761944func (e * DCGMExporterSpec ) IsEnabled () bool {
18771945 if e .Enabled == nil {
0 commit comments