...
1# This DaemonSet was originally referenced from
2# https://github.com/GoogleCloudPlatform/container-engine-accelerators/blob/master/daemonset.yaml
3
4# The Dockerfile and other source for this daemonset are in
5# https://github.com/GoogleCloudPlatform/cos-gpu-installer
6
7apiVersion: apps/v1
8kind: DaemonSet
9metadata:
10 name: nvidia-driver-installer
11 namespace: kube-system
12 labels:
13 k8s-app: nvidia-driver-installer
14spec:
15 selector:
16 matchLabels:
17 k8s-app: nvidia-driver-installer
18 updateStrategy:
19 type: RollingUpdate
20 template:
21 metadata:
22 labels:
23 name: nvidia-driver-installer
24 k8s-app: nvidia-driver-installer
25 spec:
26 affinity:
27 nodeAffinity:
28 requiredDuringSchedulingIgnoredDuringExecution:
29 nodeSelectorTerms:
30 - matchExpressions:
31 - key: cloud.google.com/gke-accelerator
32 operator: Exists
33 tolerations:
34 - operator: "Exists"
35 hostNetwork: true
36 hostPID: true
37 volumes:
38 - name: dev
39 hostPath:
40 path: /dev
41 - name: vulkan-icd-mount
42 hostPath:
43 path: /home/kubernetes/bin/nvidia/vulkan/icd.d
44 - name: nvidia-install-dir-host
45 hostPath:
46 path: /home/kubernetes/bin/nvidia
47 - name: root-mount
48 hostPath:
49 path: /
50 initContainers:
51 # The COS GPU installer image version may be dependent on the version of COS being used.
52 # Refer to details about the installer in https://cos.googlesource.com/cos/tools/+/refs/heads/master/src/cmd/cos_gpu_installer/
53 # and the COS release notes (https://cloud.google.com/container-optimized-os/docs/release-notes) to determine version COS GPU installer for a given version of COS.
54
55 # Maps to gcr.io/cos-cloud/cos-gpu-installer:v2.1.10 - suitable for COS M109 as per https://cloud.google.com/container-optimized-os/docs/release-notes
56 - image: gcr.io/cos-cloud/cos-gpu-installer:v2.1.10
57 name: nvidia-driver-installer
58 resources:
59 requests:
60 cpu: 0.15
61 securityContext:
62 privileged: true
63 env:
64 - name: NVIDIA_INSTALL_DIR_HOST
65 value: /home/kubernetes/bin/nvidia
66 - name: NVIDIA_INSTALL_DIR_CONTAINER
67 value: /usr/local/nvidia
68 - name: VULKAN_ICD_DIR_HOST
69 value: /home/kubernetes/bin/nvidia/vulkan/icd.d
70 - name: VULKAN_ICD_DIR_CONTAINER
71 value: /etc/vulkan/icd.d
72 - name: ROOT_MOUNT_DIR
73 value: /root
74 volumeMounts:
75 - name: nvidia-install-dir-host
76 mountPath: /usr/local/nvidia
77 - name: vulkan-icd-mount
78 mountPath: /etc/vulkan/icd.d
79 - name: dev
80 mountPath: /dev
81 - name: root-mount
82 mountPath: /root
83 containers:
84 - image: "registry.k8s.io/pause:3.9"
85 name: pause
86
View as plain text