Skip to content
Merged
23 changes: 7 additions & 16 deletions api/nvidia/v1/clusterpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1658,20 +1658,20 @@ type VGPUDevicesConfigSpec struct {

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

// Default indicates whether to use CDI as the default mechanism for providing GPU access to containers.
// Deprecated: This field is no longer used. Setting cdi.enabled=true will configure CDI as the default mechanism for making GPUs accessible to containers.
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Configure CDI as the default mechanism for making GPUs accessible to containers"
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Deprecated: This field is no longer used"
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch,urn:alm:descriptor:com.tectonic.ui:hidden"
Default *bool `json:"default,omitempty"`
}

Expand Down Expand Up @@ -2070,20 +2070,11 @@ func (l *DriverLicensingConfigSpec) IsNLSEnabled() bool {
// providing GPU access to containers
func (c *CDIConfigSpec) IsEnabled() bool {
if c.Enabled == nil {
return false
return true
}
return *c.Enabled
}

// IsDefault returns true if CDI is enabled as the default
// mechanism for providing GPU access to containers
func (c *CDIConfigSpec) IsDefault() bool {
if c.Default == nil {
return false
}
return *c.Default
}

// IsEnabled returns true if Kata Manager is enabled
func (k *KataManagerSpec) IsEnabled() bool {
if k.Enabled == nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ metadata:
"initContainer": {
}
},
"cdi": {
"enabled": true
},
"sandboxWorkloads": {
"enabled": false,
"defaultWorkload": "container"
Expand Down Expand Up @@ -531,6 +534,20 @@ spec:
path: toolkit.imagePullPolicy
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:imagePullPolicy'
- displayName: CDI
description: Container Device Interface (CDI) Configuration
path: cdi
- displayName: Enabled
description: 'Enabled indicates whether CDI should be used as the mechanism for making GPUs accessible to containers.'
path: cdi.enabled
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
- displayName: Default
description: 'Deprecated: This field is no longer used. Setting cdi.enabled=true will configure CDI as the default mechanism for making GPUs accessible to containers.'
path: cdi.default
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:hidden'
- 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
- displayName: NVIDIA DCGM config
description: NVIDIA DCGM config
path: dcgm
Expand Down
12 changes: 7 additions & 5 deletions bundle/manifests/nvidia.com_clusterpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ spec:
properties:
default:
default: false
description: Default indicates whether to use CDI as the default
mechanism for providing GPU access to containers.
description: 'Deprecated: This field is no longer used. Setting
cdi.enabled=true will configure CDI as the default mechanism
for making GPUs accessible to containers.'
type: boolean
enabled:
default: false
description: Enabled indicates whether CDI can be used to make
GPUs accessible to containers.
default: true
description: Enabled indicates whether the Container Device Interface
(CDI) should be used as the mechanism for making GPUs accessible
to containers.
type: boolean
type: object
daemonsets:
Expand Down
12 changes: 7 additions & 5 deletions config/crd/bases/nvidia.com_clusterpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ spec:
properties:
default:
default: false
description: Default indicates whether to use CDI as the default
mechanism for providing GPU access to containers.
description: 'Deprecated: This field is no longer used. Setting
cdi.enabled=true will configure CDI as the default mechanism
for making GPUs accessible to containers.'
type: boolean
enabled:
default: false
description: Enabled indicates whether CDI can be used to make
GPUs accessible to containers.
default: true
description: Enabled indicates whether the Container Device Interface
(CDI) should be used as the mechanism for making GPUs accessible
to containers.
type: boolean
type: object
daemonsets:
Expand Down
Loading