File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed
deployments/helm/nvidia-dra-driver-gpu/templates Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,19 @@ app.kubernetes.io/instance: {{ .Release.Name }}
6666{ {- end } }
6767
6868{ {/*
69- Selector labels
69+ Selector labels: meant to select just the pods of the corresponding
70+ deployment/daemonset/... That is, this is different per-component.
7071*/} }
7172{ {- define " nvidia-dra-driver-gpu.selectorLabels" -} }
72- { {- if .Values.selectorLabelsOverride -} }
73- { { toYaml .Values.selectorLabelsOverride } }
74- { {- else -} }
75- { { include " nvidia-dra-driver-gpu.templateLabels" . } }
76- { {- end } }
73+ { {- if and (hasKey . " componentName" ) (hasKey . " context" ) -} }
74+ { {- if .context.Values.selectorLabelsOverride -} }
75+ { { toYaml .context.Values.selectorLabelsOverride } }
76+ { {- else -} }
77+ nvidia-dra-driver-gpu-component: { { .componentName } }
78+ { {- end } }
79+ { {- else -} }
80+ fail "selectorLabels: both arguments are required: context, componentName"
81+ { {- end } }
7782{ {- end } }
7883
7984{ {/*
Original file line number Diff line number Diff line change 2525 replicas : 1
2626 selector :
2727 matchLabels :
28- {{- include "nvidia-dra-driver-gpu.selectorLabels" . | nindent 6 }}
28+ {{- include "nvidia-dra-driver-gpu.selectorLabels" (dict "context" . "componentName" "controller") | nindent 6 }}
2929 template :
3030 metadata :
3131 {{- with .Values.controller.podAnnotations }}
3434 {{- end }}
3535 labels :
3636 {{- include "nvidia-dra-driver-gpu.templateLabels" . | nindent 8 }}
37+ {{- include "nvidia-dra-driver-gpu.selectorLabels" (dict "context" . "componentName" "controller") | nindent 8 }}
3738 spec :
3839 {{- if .Values.controller.priorityClassName }}
3940 priorityClassName : {{ .Values.controller.priorityClassName }}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ metadata:
2424spec :
2525 selector :
2626 matchLabels :
27- {{- include "nvidia-dra-driver-gpu.selectorLabels" . | nindent 6 }}
27+ {{- include "nvidia-dra-driver-gpu.selectorLabels" (dict "context" . "componentName" "kubelet-plugin") | nindent 6 }}
2828 {{- with .Values.kubeletPlugin.updateStrategy }}
2929 updateStrategy :
3030 {{- toYaml . | nindent 4 }}
3737 {{- end }}
3838 labels :
3939 {{- include "nvidia-dra-driver-gpu.templateLabels" . | nindent 8 }}
40+ {{- include "nvidia-dra-driver-gpu.selectorLabels" (dict "context" . "componentName" "kubelet-plugin") | nindent 8 }}
4041 spec :
4142 {{- if .Values.kubeletPlugin.priorityClassName }}
4243 priorityClassName : {{ .Values.kubeletPlugin.priorityClassName }}
You can’t perform that action at this time.
0 commit comments