Skip to content

Commit 573c5cc

Browse files
committed
add volumeMounts for nvidiaDriverRoot + custom env. for NFD pod
1 parent 51f7ece commit 573c5cc

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

deployments/helm/nvidia-device-plugin/templates/daemonset-device-plugin.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ spec:
207207
- name: kubelet-device-plugins-dir
208208
mountPath: /var/lib/kubelet/device-plugins
209209
{{- if typeIs "string" .Values.nvidiaDriverRoot }}
210-
# We always mount the driver root at /driver-root in the container.
210+
# We mount the driver root at /driver-root in the container.
211211
# This is required for CDI detection to work correctly.
212212
- name: driver-root
213213
mountPath: /driver-root
@@ -242,12 +242,12 @@ spec:
242242
- name: mps-shm
243243
hostPath:
244244
path: {{ .Values.mps.root }}/shm
245-
{{- if typeIs "string" .Values.nvidiaDriverRoot }}
245+
{{- if typeIs "string" .Values.nvidiaDriverRoot }}
246246
- name: driver-root
247247
hostPath:
248-
path: {{ .Values.nvidiaDriverRoot }}
248+
path: {{ .Values.nvidiaDriverRoot | toYaml }}
249249
type: Directory
250-
{{- end }}
250+
{{- end }}
251251
- name: cdi-root
252252
hostPath:
253253
path: /var/run/cdi

deployments/helm/nvidia-device-plugin/templates/daemonset-gfd.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,18 @@ spec:
177177
- name: DEVICE_DISCOVERY_STRATEGY
178178
value: {{ .Values.deviceDiscoveryStrategy }}
179179
{{- end }}
180+
{{- .Values.gfd.env | toYaml | nindent 10 }}
180181
securityContext:
181182
{{- include "gpu-feature-discovery.securityContext" . | nindent 10 }}
182183
volumeMounts:
183184
- name: output-dir
184185
mountPath: "/etc/kubernetes/node-feature-discovery/features.d"
186+
{{- if typeIs "string" .Values.nvidiaDriverRoot }}
187+
# We mount the driver root at /driver-root in the container.
188+
- name: driver-root
189+
mountPath: /driver-root
190+
readOnly: true
191+
{{- end }}
185192
- name: host-sys
186193
mountPath: "/sys"
187194
{{- if $options.hasConfigMap }}
@@ -203,10 +210,12 @@ spec:
203210
hostPath:
204211
path: "/sys"
205212
type: Directory
213+
{{- if typeIs "string" .Values.nvidiaDriverRoot }}
206214
- name: driver-root
207215
hostPath:
208-
path: {{ clean ( join "/" ( list "/" .Values.nvidiaDriverRoot ) ) | quote }}
216+
path: {{ .Values.nvidiaDriverRoot | toYaml }}
209217
type: Directory
218+
{{- end }}
210219
{{- if $options.hasConfigMap }}
211220
- name: available-configs
212221
configMap:

deployments/helm/nvidia-device-plugin/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ gfd:
109109
namespaceOverride: ""
110110
noTimestamp: null
111111
sleepInterval: null
112+
# custom env. needed (for example: LD_PRELOAD=/driver-root/usr/lib64/libnvidia-ml.so.1 when deviceListStrategy=cdi-cri)
113+
env: []
112114
securityContext:
113115
# privileged access is required for the gpu-feature-discovery to access the
114116
# vgpu info on a host.

0 commit comments

Comments
 (0)