-
Notifications
You must be signed in to change notification settings - Fork 3
/
k8s-socketcan-daemonset-debug.yaml
70 lines (70 loc) · 2.26 KB
/
k8s-socketcan-daemonset-debug.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
66
67
68
69
70
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
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; } && echo Succesfully installed and loaded the vcan kernel module;
mknod /var/run/k8s-socketcan/fakedev b 1 1 && echo Succesfully created the /var/run/k8s-socketcan/fakedev device;
for path in /root/var/run/containerd/containerd.sock /root/var/snap/microk8s/common/run/containerd.sock /root/run/k3s/containerd/containerd.sock; do [ -S $path ] && ln -sfn $path /var/run/k8s-socketcan/containerd.sock && echo "Found containerd socket in $path" && break; done;
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
volumeMounts:
- name: root
mountPath: /root
- name: var-run-k8s-socketcan
mountPath: /var/run/k8s-socketcan
containers:
- name: k8s-socketcan
args: ['-v', '3', '-logtostderr']
image: ghcr.io/collabora/k8s-socketcan:latest
env:
- name: SOCKETCAN_DEVICES
value: ""
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
volumeMounts:
- name: root
mountPath: /root
- name: device-plugin
mountPath: /var/lib/kubelet/device-plugins
- name: var-run-k8s-socketcan
mountPath: /var/run/k8s-socketcan
volumes:
- name: var-run-k8s-socketcan
hostPath:
path: /var/run/k8s-socketcan/
- 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