From 5af8fc38055f9c5bcb04525ab402f6b97c706098 Mon Sep 17 00:00:00 2001 From: Peter Zandbergen Date: Tue, 28 Oct 2025 18:46:38 +0100 Subject: [PATCH 1/4] Fix identical labels issue [#1480] --- .../templates/_helpers.tpl | 18 ++++++++++++++++++ .../templates/daemonset-mps-control-daemon.yml | 4 ++-- .../helm/nvidia-device-plugin/values.yaml | 1 + 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/deployments/helm/nvidia-device-plugin/templates/_helpers.tpl b/deployments/helm/nvidia-device-plugin/templates/_helpers.tpl index a2dfca250..3d121180a 100644 --- a/deployments/helm/nvidia-device-plugin/templates/_helpers.tpl +++ b/deployments/helm/nvidia-device-plugin/templates/_helpers.tpl @@ -66,6 +66,15 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{- end }} +# PEZA: Added to fix identical template matchLabels +{{- define "nvidia-device-plugin-mps-control-daemon.templateLabels" -}} +app.kubernetes.io/name: {{ printf "%s-mps-control-daemon" (include "nvidia-device-plugin.name" .) }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Values.selectorLabelsOverrideMPSControlDaemon }} +{{ toYaml .Values.selectorLabelsOverrideMPSControlDaemon }} +{{- end }} +{{- end }} + {{/* Selector labels */}} @@ -77,6 +86,15 @@ Selector labels {{- end }} {{- end }} +# PEZA: Added to fix identical template matchLabels +{{- define "nvidia-device-plugin-mps-control-daemon.selectorLabels" -}} +{{- if .Values.selectorLabelsOverrideMPSControlDaemon -}} +{{ toYaml .Values.selectorLabelsOverrideMPSControlDaemon }} +{{- else -}} +{{ include "nvidia-device-plugin-mps-control-daemon.templateLabels" . }} +{{- end }} +{{- end }} + {{/* Full image name with tag */}} diff --git a/deployments/helm/nvidia-device-plugin/templates/daemonset-mps-control-daemon.yml b/deployments/helm/nvidia-device-plugin/templates/daemonset-mps-control-daemon.yml index da37aba6d..43279277f 100644 --- a/deployments/helm/nvidia-device-plugin/templates/daemonset-mps-control-daemon.yml +++ b/deployments/helm/nvidia-device-plugin/templates/daemonset-mps-control-daemon.yml @@ -26,7 +26,7 @@ metadata: spec: selector: matchLabels: - {{- include "nvidia-device-plugin.selectorLabels" . | nindent 6 }} + {{- include "nvidia-device-plugin-mps-control-daemon.selectorLabels" . | nindent 6 }} {{- with .Values.updateStrategy }} updateStrategy: {{- toYaml . | nindent 4 }} @@ -34,7 +34,7 @@ spec: template: metadata: labels: - {{- include "nvidia-device-plugin.templateLabels" . | nindent 8 }} + {{- include "nvidia-device-plugin-mps-control-daemon.templateLabels" . | nindent 8 }} annotations: {{- include "nvidia-device-plugin.podAnnotations" (dict "local" . "root" .) | nindent 8 }} spec: diff --git a/deployments/helm/nvidia-device-plugin/values.yaml b/deployments/helm/nvidia-device-plugin/values.yaml index dab72534e..e9c07c12d 100644 --- a/deployments/helm/nvidia-device-plugin/values.yaml +++ b/deployments/helm/nvidia-device-plugin/values.yaml @@ -42,6 +42,7 @@ nameOverride: "" fullnameOverride: "" namespaceOverride: "" selectorLabelsOverride: {} +selectorLabelsOverrideMPSControlDaemon: {} allowDefaultNamespace: false From 537454a1788474194da3bdc7ff994a6e9c20c62f Mon Sep 17 00:00:00 2001 From: Peter Zandbergen Date: Wed, 29 Oct 2025 09:07:55 +0100 Subject: [PATCH 2/4] Fix labels for gfd --- .../templates/_helpers.tpl | 18 ++++++++++++++++++ .../templates/daemonset-gfd.yml | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/deployments/helm/nvidia-device-plugin/templates/_helpers.tpl b/deployments/helm/nvidia-device-plugin/templates/_helpers.tpl index 3d121180a..6bf33596e 100644 --- a/deployments/helm/nvidia-device-plugin/templates/_helpers.tpl +++ b/deployments/helm/nvidia-device-plugin/templates/_helpers.tpl @@ -75,6 +75,15 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{- end }} +# PEZA: Added to fix identical template matchLabels +{{- define "nvidia-device-plugin-gpu-feature-discovery.templateLabels" -}} +app.kubernetes.io/name: {{ printf "%s-gpu-feature-discovery" (include "nvidia-device-plugin.name" .) }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Values.selectorLabelsOverrideMPSControlDaemon }} +{{ toYaml .Values.selectorLabelsOverrideMPSControlDaemon }} +{{- end }} +{{- end }} + {{/* Selector labels */}} @@ -95,6 +104,15 @@ Selector labels {{- end }} {{- end }} +# PEZA: Added to fix identical template matchLabels +{{- define "nvidia-device-plugin-gpu-feature-discovery.selectorLabels" -}} +{{- if .Values.selectorLabelsOverrideMPSControlDaemon -}} +{{ toYaml .Values.selectorLabelsOverrideMPSControlDaemon }} +{{- else -}} +{{ include "nvidia-device-plugin-gpu-feature-discovery.templateLabels" . }} +{{- end }} +{{- end }} + {{/* Full image name with tag */}} diff --git a/deployments/helm/nvidia-device-plugin/templates/daemonset-gfd.yml b/deployments/helm/nvidia-device-plugin/templates/daemonset-gfd.yml index 09f9dfe39..b367882dd 100644 --- a/deployments/helm/nvidia-device-plugin/templates/daemonset-gfd.yml +++ b/deployments/helm/nvidia-device-plugin/templates/daemonset-gfd.yml @@ -28,7 +28,7 @@ metadata: spec: selector: matchLabels: - {{- include "nvidia-device-plugin.selectorLabels" . | nindent 6 }} + {{- include "nvidia-device-plugin-gpu-feature-discovery.selectorLabels" . | nindent 6 }} {{- with .Values.updateStrategy }} updateStrategy: {{- toYaml . | nindent 4 }} @@ -36,7 +36,7 @@ spec: template: metadata: labels: - {{- include "nvidia-device-plugin.templateLabels" . | nindent 8 }} + {{- include "nvidia-device-plugin-gpu-feature-discovery.templateLabels" . | nindent 8 }} annotations: {{- include "nvidia-device-plugin.podAnnotations" (dict "local" . "root" .) | nindent 8 }} spec: From d26bb5f62fd3a307200f78936623ccb5575b0637 Mon Sep 17 00:00:00 2001 From: Peter Zandbergen Date: Wed, 29 Oct 2025 10:05:18 +0100 Subject: [PATCH 3/4] Increment patch version --- deployments/helm/nvidia-device-plugin/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/helm/nvidia-device-plugin/Chart.yaml b/deployments/helm/nvidia-device-plugin/Chart.yaml index be2d66b8a..c07dd750e 100644 --- a/deployments/helm/nvidia-device-plugin/Chart.yaml +++ b/deployments/helm/nvidia-device-plugin/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: nvidia-device-plugin type: application description: A Helm chart for the nvidia-device-plugin on Kubernetes -version: "0.18.0" +version: "0.18.1" appVersion: "0.18.0" kubeVersion: ">= 1.10.0-0" home: https://github.com/NVIDIA/k8s-device-plugin From b5951c86976d1e6c09ac51dd39851a6dc96f12ad Mon Sep 17 00:00:00 2001 From: Peter Zandbergen Date: Wed, 29 Oct 2025 11:46:58 +0100 Subject: [PATCH 4/4] Branch