blob: 5551520a8f351f483014ce60a760efa50f8fa936 [file] [log] [blame]
Hyunsun Moon5881cb82020-01-23 22:29:44 -08001---
2apiVersion: apiextensions.k8s.io/v1beta1
3kind: CustomResourceDefinition
4metadata:
5 name: network-attachment-definitions.k8s.cni.cncf.io
6spec:
7 group: k8s.cni.cncf.io
8 version: v1
9 scope: Namespaced
10 names:
11 plural: network-attachment-definitions
12 singular: network-attachment-definition
13 kind: NetworkAttachmentDefinition
14 shortNames:
15 - net-attach-def
16 validation:
17 openAPIV3Schema:
18 properties:
19 spec:
20 properties:
21 config:
22 type: string
23---
24kind: ClusterRole
25apiVersion: rbac.authorization.k8s.io/v1beta1
26metadata:
27 name: multus
28rules:
29 - apiGroups: ["k8s.cni.cncf.io"]
30 resources:
31 - '*'
32 verbs:
33 - '*'
34 - apiGroups:
35 - ""
36 resources:
37 - pods
38 - pods/status
39 verbs:
40 - get
41 - update
42---
43kind: ClusterRoleBinding
44apiVersion: rbac.authorization.k8s.io/v1beta1
45metadata:
46 name: multus
47roleRef:
48 apiGroup: rbac.authorization.k8s.io
49 kind: ClusterRole
50 name: multus
51subjects:
52- kind: ServiceAccount
53 name: multus
54 namespace: kube-system
55---
56apiVersion: v1
57kind: ServiceAccount
58metadata:
59 name: multus
60 namespace: kube-system
61---
62kind: ConfigMap
63apiVersion: v1
64metadata:
65 name: multus-cni-config
66 namespace: kube-system
67 labels:
68 tier: node
69 app: multus
70data:
71 # NOTE: If you'd prefer to manually apply a configuration file, you may create one here.
72 # In the case you'd like to customize the Multus installation, you should change the arguments to the Multus pod
73 # change the "args" line below from
74 # - "--multus-conf-file=auto"
75 # to:
76 # "--multus-conf-file=/tmp/multus-conf/70-multus.conf"
77 # Additionally -- you should ensure that the name "70-multus.conf" is the alphabetically first name in the
78 # /etc/cni/net.d/ directory on each node, otherwise, it will not be used by the Kubelet.
79 cni-conf.json: |
80 {
81 "name": "multus-cni-network",
82 "type": "multus",
83 "capabilities": {
84 "portMappings": true
85 },
86 "delegates": [
87 {
88 "cniVersion": "0.3.1",
89 "name": "default-cni-network",
90 "plugins": [
91 {
92 "type": "flannel",
93 "name": "flannel.1",
94 "delegate": {
95 "isDefaultGateway": true,
96 "hairpinMode": true
97 }
98 },
99 {
100 "type": "portmap",
101 "capabilities": {
102 "portMappings": true
103 }
104 }
105 ]
106 }
107 ],
108 "kubeconfig": "/etc/cni/net.d/multus.d/multus.kubeconfig"
109 }
110---
111apiVersion: extensions/v1beta1
112kind: DaemonSet
113metadata:
114 name: kube-multus-ds-amd64
115 namespace: kube-system
116 labels:
117 tier: node
118 app: multus
119spec:
120 updateStrategy:
121 type: RollingUpdate
122 template:
123 metadata:
124 labels:
125 tier: node
126 app: multus
127 spec:
128 hostNetwork: true
129 nodeSelector:
130 beta.kubernetes.io/arch: amd64
131 tolerations:
132 - operator: Exists
133 effect: NoSchedule
134 serviceAccountName: multus
135 containers:
136 - name: kube-multus
137 image: nfvpe/multus:v3.2
138 command: ["/entrypoint.sh"]
139 args:
140 - "--multus-conf-file=auto"
141 resources:
142 requests:
143 cpu: "100m"
144 memory: "50Mi"
145 limits:
146 cpu: "100m"
147 memory: "50Mi"
148 securityContext:
149 privileged: true
150 volumeMounts:
151 - name: cni
152 mountPath: /host/etc/cni/net.d
153 - name: cnibin
154 mountPath: /host/opt/cni/bin
155 - name: multus-cfg
156 mountPath: /tmp/multus-conf
157 volumes:
158 - name: cni
159 hostPath:
160 path: /etc/cni/net.d
161 - name: cnibin
162 hostPath:
163 path: /opt/cni/bin
164 - name: multus-cfg
165 configMap:
166 name: multus-cni-config
167 items:
168 - key: cni-conf.json
169 path: 70-multus.conf
170---
171apiVersion: extensions/v1beta1
172kind: DaemonSet
173metadata:
174 name: kube-multus-ds-ppc64le
175 namespace: kube-system
176 labels:
177 tier: node
178 app: multus
179spec:
180 updateStrategy:
181 type: RollingUpdate
182 template:
183 metadata:
184 labels:
185 tier: node
186 app: multus
187 spec:
188 hostNetwork: true
189 nodeSelector:
190 beta.kubernetes.io/arch: ppc64le
191 tolerations:
192 - operator: Exists
193 effect: NoSchedule
194 serviceAccountName: multus
195 containers:
196 - name: kube-multus
197 # ppc64le support requires multus:latest for now. support 3.3 or later.
198 image: nfvpe/multus:latest-ppc64le
199 command: ["/entrypoint.sh"]
200 args:
201 - "--multus-conf-file=auto"
202 resources:
203 requests:
204 cpu: "100m"
205 memory: "90Mi"
206 limits:
207 cpu: "100m"
208 memory: "90Mi"
209 securityContext:
210 privileged: true
211 volumeMounts:
212 - name: cni
213 mountPath: /host/etc/cni/net.d
214 - name: cnibin
215 mountPath: /host/opt/cni/bin
216 - name: multus-cfg
217 mountPath: /tmp/multus-conf
218 volumes:
219 - name: cni
220 hostPath:
221 path: /etc/cni/net.d
222 - name: cnibin
223 hostPath:
224 path: /opt/cni/bin
225 - name: multus-cfg
226 configMap:
227 name: multus-cni-config
228 items:
229 - key: cni-conf.json
230 path: 70-multus.conf