-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathk8s-socketcan-daemonset-microk8s.yaml
65 lines (65 loc) · 1.78 KB
/
k8s-socketcan-daemonset-microk8s.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: k8s-socketcan
namespace: default
spec:
selector:
matchLabels:
name: k8s-socketcan
template:
metadata:
labels:
name: k8s-socketcan
spec:
priorityClassName: system-node-critical
hostNetwork: true
hostPID: true
initContainers:
- name: init-vcan
image: busybox:1.28
command:
- sh
- -c
- chroot /root/ modprobe vcan || { chroot /root/ apt-get install -y linux-modules-extra-$(uname -r) && chroot /root/ modprobe vcan } &&
chroot /root/ mknod /var/run/k8s-socketcan-fakedev b 1 1
echo Succesfully installed and loaded the vcan kernel module
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
volumeMounts:
- name: root
mountPath: /root
containers:
- name: k8s-socketcan
image: busybox
command: [ 'sh' ]
args: [ '-c', 'exec tail -f /dev/null' ]
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
volumeMounts:
- name: run-containerd
mountPath: /var/run/containerd/containerd.sock
- name: device-plugin
mountPath: /var/lib/kubelet/device-plugins
volumes:
- name: run-containerd
hostPath:
path: /var/snap/microk8s/common/run/containerd.sock
type: Socket
- name: device-plugin
hostPath:
path: /var/lib/kubelet/device-plugins
- name: root
hostPath:
path: /
tolerations:
- key: sku
operator: Equal
value: gpu
effect: NoSchedule
updateStrategy:
type: RollingUpdate