Skip to content

Commit c3584ec

Browse files
committed
Ensure that direcory volumes have Directory type
This change ensures that volumes that are expected to be directories have a Directory or DirectoryOrCreate type. Signed-off-by: Evan Lezar <[email protected]>
1 parent cb0c601 commit c3584ec

9 files changed

+24
-9
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ spec:
196196
securityContext:
197197
{{- include "nvidia-device-plugin.securityContext" . | nindent 10 }}
198198
volumeMounts:
199-
- name: device-plugin
199+
- name: kubelet-device-plugins-dir
200200
mountPath: /var/lib/kubelet/device-plugins
201201
{{- if typeIs "string" .Values.nvidiaDriverRoot }}
202202
# We always mount the driver root at /driver-root in the container.
@@ -223,20 +223,22 @@ spec:
223223
{{- toYaml . | nindent 10 }}
224224
{{- end }}
225225
volumes:
226-
- name: device-plugin
226+
- name: kubelet-device-plugins-dir
227227
hostPath:
228228
path: /var/lib/kubelet/device-plugins
229+
type: Directory
229230
- name: mps-root
230231
hostPath:
231232
path: {{ .Values.mps.root }}
232233
type: DirectoryOrCreate
233234
- name: mps-shm
234235
hostPath:
235236
path: {{ .Values.mps.root }}/shm
236-
{{- if typeIs "string" .Values.nvidiaDriverRoot }}
237+
{{- if typeIs "string" .Values.nvidiaDriverRoot }}
237238
- name: driver-root
238239
hostPath:
239240
path: {{ .Values.nvidiaDriverRoot }}
241+
type: Directory
240242
{{- end }}
241243
- name: cdi-root
242244
hostPath:

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,11 @@ spec:
198198
- name: output-dir
199199
hostPath:
200200
path: "/etc/kubernetes/node-feature-discovery/features.d"
201+
type: DirectoryOrCreate
201202
- name: host-sys
202203
hostPath:
203204
path: "/sys"
205+
type: Directory
204206
- name: driver-root
205207
hostPath:
206208
path: {{ clean ( join "/" ( list "/" .Values.nvidiaDriverRoot ) ) | quote }}

deployments/static/gpu-feature-discovery-daemonset-with-mig-mixed.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ spec:
6060
- name: output-dir
6161
hostPath:
6262
path: "/etc/kubernetes/node-feature-discovery/features.d"
63+
type: DirectoryOrCreate
6364
- name: host-sys
6465
hostPath:
6566
path: "/sys"
67+
type: Directory

deployments/static/gpu-feature-discovery-daemonset-with-mig-single.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ spec:
6060
- name: output-dir
6161
hostPath:
6262
path: "/etc/kubernetes/node-feature-discovery/features.d"
63+
type: DirectoryOrCreate
6364
- name: host-sys
6465
hostPath:
6566
path: "/sys"
67+
type: Directory

deployments/static/gpu-feature-discovery-daemonset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ spec:
5858
- name: output-dir
5959
hostPath:
6060
path: "/etc/kubernetes/node-feature-discovery/features.d"
61+
type: DirectoryOrCreate
6162
- name: host-sys
6263
hostPath:
6364
path: "/sys"
65+
type: Directory

deployments/static/gpu-feature-discovery-job.yaml.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ spec:
3232
- name: output-dir
3333
hostPath:
3434
path: "/etc/kubernetes/node-feature-discovery/features.d"
35+
type: DirectoryOrCreate
3536
- name: host-sys
3637
hostPath:
3738
path: "/sys"
39+
type: Directory
3840
restartPolicy: Never

deployments/static/nvidia-device-plugin-compat-with-cpumanager.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ spec:
4848
securityContext:
4949
privileged: true
5050
volumeMounts:
51-
- name: device-plugin
51+
- name: kubelet-device-plugins-dir
5252
mountPath: /var/lib/kubelet/device-plugins
5353
volumes:
54-
- name: device-plugin
54+
- name: kubelet-device-plugins-dir
5555
hostPath:
5656
path: /var/lib/kubelet/device-plugins
57+
type: Directory

deployments/static/nvidia-device-plugin-privileged-with-service-account.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@ spec:
129129
securityContext:
130130
privileged: true
131131
volumeMounts:
132-
- name: device-plugin
132+
- name: kubelet-device-plugins-dir
133133
mountPath: /var/lib/kubelet/device-plugins
134134
serviceAccountName: nvidia-device-plugin
135135
volumes:
136-
- name: device-plugin
136+
- name: kubelet-device-plugins-dir
137137
hostPath:
138138
path: /var/lib/kubelet/device-plugins
139+
type: DirectoryOrCreate

deployments/static/nvidia-device-plugin.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ spec:
4848
capabilities:
4949
drop: ["ALL"]
5050
volumeMounts:
51-
- name: device-plugin
51+
- name: kubelet-device-plugins-dir
5252
mountPath: /var/lib/kubelet/device-plugins
5353
volumes:
54-
- name: device-plugin
54+
- name: kubelet-device-plugins-dir
5555
hostPath:
5656
path: /var/lib/kubelet/device-plugins
57+
type: Directory

0 commit comments

Comments
 (0)