Skip to content
Open
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
10 changes: 10 additions & 0 deletions deployments/helm/nvidia-device-plugin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ Selector labels
{{- end }}
{{- end }}

{{/*
Optional component label for DaemonSet selector and template labels.
*/}}
{{- define "nvidia-device-plugin.componentLabel" -}}
{{- $root := .root -}}
{{- if and $root.Values.componentSelectorLabels.enabled (not $root.Values.selectorLabelsOverride) -}}
app.kubernetes.io/component: {{ .component }}
{{- end -}}
{{- end }}

{{/*
Full image name with tag
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ spec:
selector:
matchLabels:
{{- include "nvidia-device-plugin.selectorLabels" . | nindent 6 }}
{{- with (include "nvidia-device-plugin.componentLabel" (dict "root" . "component" "device-plugin") | trim) }}
{{- . | nindent 6 }}
{{- end }}
{{- with .Values.updateStrategy }}
updateStrategy:
{{- toYaml . | nindent 4 }}
Expand All @@ -37,6 +40,9 @@ spec:
metadata:
labels:
{{- include "nvidia-device-plugin.templateLabels" . | nindent 8 }}
{{- with (include "nvidia-device-plugin.componentLabel" (dict "root" . "component" "device-plugin") | trim) }}
{{- . | nindent 8 }}
{{- end }}
annotations:
{{- include "nvidia-device-plugin.podAnnotations" (dict "local" . "root" .) | nindent 8 }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ spec:
selector:
matchLabels:
{{- include "nvidia-device-plugin.selectorLabels" . | nindent 6 }}
{{- with (include "nvidia-device-plugin.componentLabel" (dict "root" . "component" "gpu-feature-discovery") | trim) }}
{{- . | nindent 6 }}
{{- end }}
{{- with .Values.updateStrategy }}
updateStrategy:
{{- toYaml . | nindent 4 }}
Expand All @@ -37,6 +40,9 @@ spec:
metadata:
labels:
{{- include "nvidia-device-plugin.templateLabels" . | nindent 8 }}
{{- with (include "nvidia-device-plugin.componentLabel" (dict "root" . "component" "gpu-feature-discovery") | trim) }}
{{- . | nindent 8 }}
{{- end }}
annotations:
{{- include "nvidia-device-plugin.podAnnotations" (dict "local" . "root" .) | nindent 8 }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ spec:
selector:
matchLabels:
{{- include "nvidia-device-plugin.selectorLabels" . | nindent 6 }}
{{- with (include "nvidia-device-plugin.componentLabel" (dict "root" . "component" "mps-control-daemon") | trim) }}
{{- . | nindent 6 }}
{{- end }}
{{- with .Values.updateStrategy }}
updateStrategy:
{{- toYaml . | nindent 4 }}
Expand All @@ -35,6 +38,9 @@ spec:
metadata:
labels:
{{- include "nvidia-device-plugin.templateLabels" . | nindent 8 }}
{{- with (include "nvidia-device-plugin.componentLabel" (dict "root" . "component" "mps-control-daemon") | trim) }}
{{- . | nindent 8 }}
{{- end }}
annotations:
{{- include "nvidia-device-plugin.podAnnotations" (dict "local" . "root" .) | nindent 8 }}
spec:
Expand Down
7 changes: 7 additions & 0 deletions deployments/helm/nvidia-device-plugin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ nameOverride: ""
fullnameOverride: ""
namespaceOverride: ""
selectorLabelsOverride: {}
componentSelectorLabels:
# enabled controls whether DaemonSet selectors include app.kubernetes.io/component
# to avoid overlap between device-plugin, gpu-feature-discovery, and mps-control-daemon.
# NOTE: This is disabled by default for upgrade compatibility because DaemonSet
# selectors are immutable and enabling this on an existing release requires
# DaemonSet recreation.
enabled: false

allowDefaultNamespace: false

Expand Down
Loading