-
Notifications
You must be signed in to change notification settings - Fork 2
/
bashcni-ds.yml
81 lines (81 loc) · 1.67 KB
/
bashcni-ds.yml
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
71
72
73
74
75
76
77
78
79
80
81
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: bashcni
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "watch", "list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "watch", "list"]
- apiGroups: [""]
resources: ["nodes/status"]
verbs: ["patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: bashcni
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: bashcni
subjects:
- kind: ServiceAccount
name: bashcni
namespace: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: bashcni
namespace: kube-system
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: bashcni
namespace: kube-system
spec:
selector:
matchLabels:
app: bashcni
template:
metadata:
labels:
app: bashcni
spec:
tolerations:
- operator: Exists
effect: NoSchedule
serviceAccount: bashcni
hostNetwork: true
hostPID: true
priorityClassName: system-node-critical
initContainers:
- name: install-cni-plugin
image: cericwu/bashcni
imagePullPolicy: Always
command:
- /app/install.sh
volumeMounts:
- name: cni-plugin
mountPath: /opt/cni
containers:
- name: bashcni
image: cericwu/bashcni
imagePullPolicy: Always
securityContext:
capabilities:
add: ["NET_ADMIN"]
volumeMounts:
- name: cni
mountPath: /etc/cni/net.d
volumes:
- name: cni-plugin
hostPath:
path: /opt/cni
- name: cni
hostPath:
path: /etc/cni/net.d