Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/nvidia/v1/clusterpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,13 @@ type DCGMExporterSpec struct {
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:io.kubernetes:Secret"
ImagePullSecrets []string `json:"imagePullSecrets,omitempty"`

// HostNetwork
// +kubebuilder:validation:Optional
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="HostNetwork"
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch"
HostNetwork *bool `json:"hostNetwork,omitempty"`

// Optional: Define resources requests and limits for each pod
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Resource Requirements"
Expand Down
5 changes: 5 additions & 0 deletions api/nvidia/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions bundle/manifests/nvidia.com_clusterpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ spec:
- name
type: object
type: array
hostNetwork:
description: Run the DCGM Exporter pod on the host’s network, sharing the node’s network interfaces and IP address
type: boolean
image:
description: NVIDIA DCGM Exporter image name
pattern: '[a-zA-Z0-9\-]+'
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/nvidia.com_clusterpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ spec:
- name
type: object
type: array
hostNetwork:
description: Run the DCGM Exporter pod on the host’s network, sharing the node’s network interfaces and IP address
type: boolean
image:
description: NVIDIA DCGM Exporter image name
pattern: '[a-zA-Z0-9\-]+'
Expand Down
4 changes: 4 additions & 0 deletions controllers/object_controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,10 @@ func TransformDCGMExporter(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpe
if len(config.DCGMExporter.ImagePullSecrets) > 0 {
addPullSecrets(&obj.Spec.Template.Spec, config.DCGMExporter.ImagePullSecrets)
}
// set hostNetwork
if config.DCGMExporter.HostNetwork != nil {
obj.Spec.Template.Spec.HostNetwork = *config.DCGMExporter.HostNetwork
}
// set resource limits
if config.DCGMExporter.Resources != nil {
// apply resource limits to all containers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ spec:
- name
type: object
type: array
hostNetwork:
description: Run the DCGM Exporter pod on the host’s network, sharing the node’s network interfaces and IP address
type: boolean
image:
description: NVIDIA DCGM Exporter image name
pattern: '[a-zA-Z0-9\-]+'
Expand Down
3 changes: 3 additions & 0 deletions deployments/gpu-operator/templates/clusterpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@ spec:
{{- if .Values.dcgmExporter.imagePullSecrets }}
imagePullSecrets: {{ toYaml .Values.dcgmExporter.imagePullSecrets | nindent 6 }}
{{- end }}
{{- if .Values.dcgmExporter.hostNetwork }}
hostNetwork: {{ .Values.dcgmExporter.hostNetwork }}
{{- end }}
{{- if .Values.dcgmExporter.resources }}
resources: {{ toYaml .Values.dcgmExporter.resources | nindent 6 }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions deployments/gpu-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ dcgmExporter:
value: "true"
- name: DCGM_EXPORTER_COLLECTORS
value: "/etc/dcgm-exporter/dcp-metrics-included.csv"
hostNetwork: false
resources: {}
service:
internalTrafficPolicy: Cluster
Expand Down