kube-flannel.yaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. ---
  2. apiVersion: extensions/v1beta1
  3. kind: PodSecurityPolicy
  4. metadata:
  5. name: psp.flannel.unprivileged
  6. annotations:
  7. seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/default
  8. seccomp.security.alpha.kubernetes.io/defaultProfileName: docker/default
  9. apparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default
  10. apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default
  11. spec:
  12. privileged: false
  13. volumes:
  14. - configMap
  15. - secret
  16. - emptyDir
  17. - hostPath
  18. allowedHostPaths:
  19. - pathPrefix: "/etc/cni/net.d"
  20. - pathPrefix: "/etc/kube-flannel"
  21. - pathPrefix: "/run/flannel"
  22. readOnlyRootFilesystem: false
  23. # Users and groups
  24. runAsUser:
  25. rule: RunAsAny
  26. supplementalGroups:
  27. rule: RunAsAny
  28. fsGroup:
  29. rule: RunAsAny
  30. # Privilege Escalation
  31. allowPrivilegeEscalation: false
  32. defaultAllowPrivilegeEscalation: false
  33. # Capabilities
  34. allowedCapabilities: ['NET_ADMIN']
  35. defaultAddCapabilities: []
  36. requiredDropCapabilities: []
  37. # Host namespaces
  38. hostPID: false
  39. hostIPC: false
  40. hostNetwork: true
  41. hostPorts:
  42. - min: 0
  43. max: 65535
  44. # SELinux
  45. seLinux:
  46. # SELinux is unsed in CaaSP
  47. rule: 'RunAsAny'
  48. ---
  49. kind: ClusterRole
  50. apiVersion: rbac.authorization.k8s.io/v1beta1
  51. metadata:
  52. name: flannel
  53. rules:
  54. - apiGroups: ['extensions']
  55. resources: ['podsecuritypolicies']
  56. verbs: ['use']
  57. resourceNames: ['psp.flannel.unprivileged']
  58. - apiGroups:
  59. - ""
  60. resources:
  61. - pods
  62. verbs:
  63. - get
  64. - apiGroups:
  65. - ""
  66. resources:
  67. - nodes
  68. verbs:
  69. - list
  70. - watch
  71. - apiGroups:
  72. - ""
  73. resources:
  74. - nodes/status
  75. verbs:
  76. - patch
  77. ---
  78. kind: ClusterRoleBinding
  79. apiVersion: rbac.authorization.k8s.io/v1beta1
  80. metadata:
  81. name: flannel
  82. roleRef:
  83. apiGroup: rbac.authorization.k8s.io
  84. kind: ClusterRole
  85. name: flannel
  86. subjects:
  87. - kind: ServiceAccount
  88. name: flannel
  89. namespace: kube-system
  90. ---
  91. apiVersion: v1
  92. kind: ServiceAccount
  93. metadata:
  94. name: flannel
  95. namespace: kube-system
  96. ---
  97. kind: ConfigMap
  98. apiVersion: v1
  99. metadata:
  100. name: kube-flannel-cfg
  101. namespace: kube-system
  102. labels:
  103. tier: node
  104. app: flannel
  105. data:
  106. cni-conf.json: |
  107. {
  108. "name": "cbr0",
  109. "plugins": [
  110. {
  111. "type": "flannel",
  112. "delegate": {
  113. "hairpinMode": true,
  114. "isDefaultGateway": true
  115. }
  116. },
  117. {
  118. "type": "portmap",
  119. "capabilities": {
  120. "portMappings": true
  121. }
  122. }
  123. ]
  124. }
  125. net-conf.json: |
  126. {
  127. "Network": "10.244.0.0/16",
  128. "Backend": {
  129. "Type": "vxlan"
  130. }
  131. }
  132. ---
  133. apiVersion: extensions/v1beta1
  134. kind: DaemonSet
  135. metadata:
  136. name: kube-flannel-ds-amd64
  137. namespace: kube-system
  138. labels:
  139. tier: node
  140. app: flannel
  141. spec:
  142. template:
  143. metadata:
  144. labels:
  145. tier: node
  146. app: flannel
  147. spec:
  148. hostNetwork: true
  149. nodeSelector:
  150. beta.kubernetes.io/arch: amd64
  151. tolerations:
  152. - operator: Exists
  153. effect: NoSchedule
  154. serviceAccountName: flannel
  155. initContainers:
  156. - name: install-cni
  157. image: quay.io/coreos/flannel:v0.11.0-amd64
  158. command:
  159. - cp
  160. args:
  161. - -f
  162. - /etc/kube-flannel/cni-conf.json
  163. - /etc/cni/net.d/10-flannel.conflist
  164. volumeMounts:
  165. - name: cni
  166. mountPath: /etc/cni/net.d
  167. - name: flannel-cfg
  168. mountPath: /etc/kube-flannel/
  169. containers:
  170. - name: kube-flannel
  171. image: quay.io/coreos/flannel:v0.11.0-amd64
  172. command:
  173. - /opt/bin/flanneld
  174. args:
  175. - --ip-masq
  176. - --kube-subnet-mgr
  177. - --iface=ib0
  178. resources:
  179. requests:
  180. cpu: "100m"
  181. memory: "50Mi"
  182. limits:
  183. cpu: "100m"
  184. memory: "50Mi"
  185. securityContext:
  186. privileged: false
  187. capabilities:
  188. add: ["NET_ADMIN"]
  189. env:
  190. - name: POD_NAME
  191. valueFrom:
  192. fieldRef:
  193. fieldPath: metadata.name
  194. - name: POD_NAMESPACE
  195. valueFrom:
  196. fieldRef:
  197. fieldPath: metadata.namespace
  198. volumeMounts:
  199. - name: run
  200. mountPath: /run/flannel
  201. - name: flannel-cfg
  202. mountPath: /etc/kube-flannel/
  203. volumes:
  204. - name: run
  205. hostPath:
  206. path: /run/flannel
  207. - name: cni
  208. hostPath:
  209. path: /etc/cni/net.d
  210. - name: flannel-cfg
  211. configMap:
  212. name: kube-flannel-cfg
  213. ---
  214. apiVersion: extensions/v1beta1
  215. kind: DaemonSet
  216. metadata:
  217. name: kube-flannel-ds-arm64
  218. namespace: kube-system
  219. labels:
  220. tier: node
  221. app: flannel
  222. spec:
  223. template:
  224. metadata:
  225. labels:
  226. tier: node
  227. app: flannel
  228. spec:
  229. hostNetwork: true
  230. nodeSelector:
  231. beta.kubernetes.io/arch: arm64
  232. tolerations:
  233. - operator: Exists
  234. effect: NoSchedule
  235. serviceAccountName: flannel
  236. initContainers:
  237. - name: install-cni
  238. image: quay.io/coreos/flannel:v0.11.0-arm64
  239. command:
  240. - cp
  241. args:
  242. - -f
  243. - /etc/kube-flannel/cni-conf.json
  244. - /etc/cni/net.d/10-flannel.conflist
  245. volumeMounts:
  246. - name: cni
  247. mountPath: /etc/cni/net.d
  248. - name: flannel-cfg
  249. mountPath: /etc/kube-flannel/
  250. containers:
  251. - name: kube-flannel
  252. image: quay.io/coreos/flannel:v0.11.0-arm64
  253. command:
  254. - /opt/bin/flanneld
  255. args:
  256. - --ip-masq
  257. - --kube-subnet-mgr
  258. - --iface=ib0
  259. resources:
  260. requests:
  261. cpu: "100m"
  262. memory: "50Mi"
  263. limits:
  264. cpu: "100m"
  265. memory: "50Mi"
  266. securityContext:
  267. privileged: false
  268. capabilities:
  269. add: ["NET_ADMIN"]
  270. env:
  271. - name: POD_NAME
  272. valueFrom:
  273. fieldRef:
  274. fieldPath: metadata.name
  275. - name: POD_NAMESPACE
  276. valueFrom:
  277. fieldRef:
  278. fieldPath: metadata.namespace
  279. volumeMounts:
  280. - name: run
  281. mountPath: /run/flannel
  282. - name: flannel-cfg
  283. mountPath: /etc/kube-flannel/
  284. volumes:
  285. - name: run
  286. hostPath:
  287. path: /run/flannel
  288. - name: cni
  289. hostPath:
  290. path: /etc/cni/net.d
  291. - name: flannel-cfg
  292. configMap:
  293. name: kube-flannel-cfg
  294. ---
  295. apiVersion: extensions/v1beta1
  296. kind: DaemonSet
  297. metadata:
  298. name: kube-flannel-ds-arm
  299. namespace: kube-system
  300. labels:
  301. tier: node
  302. app: flannel
  303. spec:
  304. template:
  305. metadata:
  306. labels:
  307. tier: node
  308. app: flannel
  309. spec:
  310. hostNetwork: true
  311. nodeSelector:
  312. beta.kubernetes.io/arch: arm
  313. tolerations:
  314. - operator: Exists
  315. effect: NoSchedule
  316. serviceAccountName: flannel
  317. initContainers:
  318. - name: install-cni
  319. image: quay.io/coreos/flannel:v0.11.0-arm
  320. command:
  321. - cp
  322. args:
  323. - -f
  324. - /etc/kube-flannel/cni-conf.json
  325. - /etc/cni/net.d/10-flannel.conflist
  326. volumeMounts:
  327. - name: cni
  328. mountPath: /etc/cni/net.d
  329. - name: flannel-cfg
  330. mountPath: /etc/kube-flannel/
  331. containers:
  332. - name: kube-flannel
  333. image: quay.io/coreos/flannel:v0.11.0-arm
  334. command:
  335. - /opt/bin/flanneld
  336. args:
  337. - --ip-masq
  338. - --kube-subnet-mgr
  339. - --iface=ib0
  340. resources:
  341. requests:
  342. cpu: "100m"
  343. memory: "50Mi"
  344. limits:
  345. cpu: "100m"
  346. memory: "50Mi"
  347. securityContext:
  348. privileged: false
  349. capabilities:
  350. add: ["NET_ADMIN"]
  351. env:
  352. - name: POD_NAME
  353. valueFrom:
  354. fieldRef:
  355. fieldPath: metadata.name
  356. - name: POD_NAMESPACE
  357. valueFrom:
  358. fieldRef:
  359. fieldPath: metadata.namespace
  360. volumeMounts:
  361. - name: run
  362. mountPath: /run/flannel
  363. - name: flannel-cfg
  364. mountPath: /etc/kube-flannel/
  365. volumes:
  366. - name: run
  367. hostPath:
  368. path: /run/flannel
  369. - name: cni
  370. hostPath:
  371. path: /etc/cni/net.d
  372. - name: flannel-cfg
  373. configMap:
  374. name: kube-flannel-cfg
  375. ---
  376. apiVersion: extensions/v1beta1
  377. kind: DaemonSet
  378. metadata:
  379. name: kube-flannel-ds-ppc64le
  380. namespace: kube-system
  381. labels:
  382. tier: node
  383. app: flannel
  384. spec:
  385. template:
  386. metadata:
  387. labels:
  388. tier: node
  389. app: flannel
  390. spec:
  391. hostNetwork: true
  392. nodeSelector:
  393. beta.kubernetes.io/arch: ppc64le
  394. tolerations:
  395. - operator: Exists
  396. effect: NoSchedule
  397. serviceAccountName: flannel
  398. initContainers:
  399. - name: install-cni
  400. image: quay.io/coreos/flannel:v0.11.0-ppc64le
  401. command:
  402. - cp
  403. args:
  404. - -f
  405. - /etc/kube-flannel/cni-conf.json
  406. - /etc/cni/net.d/10-flannel.conflist
  407. volumeMounts:
  408. - name: cni
  409. mountPath: /etc/cni/net.d
  410. - name: flannel-cfg
  411. mountPath: /etc/kube-flannel/
  412. containers:
  413. - name: kube-flannel
  414. image: quay.io/coreos/flannel:v0.11.0-ppc64le
  415. command:
  416. - /opt/bin/flanneld
  417. args:
  418. - --ip-masq
  419. - --kube-subnet-mgr
  420. - --iface=ib0
  421. resources:
  422. requests:
  423. cpu: "100m"
  424. memory: "50Mi"
  425. limits:
  426. cpu: "100m"
  427. memory: "50Mi"
  428. securityContext:
  429. privileged: false
  430. capabilities:
  431. add: ["NET_ADMIN"]
  432. env:
  433. - name: POD_NAME
  434. valueFrom:
  435. fieldRef:
  436. fieldPath: metadata.name
  437. - name: POD_NAMESPACE
  438. valueFrom:
  439. fieldRef:
  440. fieldPath: metadata.namespace
  441. volumeMounts:
  442. - name: run
  443. mountPath: /run/flannel
  444. - name: flannel-cfg
  445. mountPath: /etc/kube-flannel/
  446. volumes:
  447. - name: run
  448. hostPath:
  449. path: /run/flannel
  450. - name: cni
  451. hostPath:
  452. path: /etc/cni/net.d
  453. - name: flannel-cfg
  454. configMap:
  455. name: kube-flannel-cfg
  456. ---
  457. apiVersion: extensions/v1beta1
  458. kind: DaemonSet
  459. metadata:
  460. name: kube-flannel-ds-s390x
  461. namespace: kube-system
  462. labels:
  463. tier: node
  464. app: flannel
  465. spec:
  466. template:
  467. metadata:
  468. labels:
  469. tier: node
  470. app: flannel
  471. spec:
  472. hostNetwork: true
  473. nodeSelector:
  474. beta.kubernetes.io/arch: s390x
  475. tolerations:
  476. - operator: Exists
  477. effect: NoSchedule
  478. serviceAccountName: flannel
  479. initContainers:
  480. - name: install-cni
  481. image: quay.io/coreos/flannel:v0.11.0-s390x
  482. command:
  483. - cp
  484. args:
  485. - -f
  486. - /etc/kube-flannel/cni-conf.json
  487. - /etc/cni/net.d/10-flannel.conflist
  488. volumeMounts:
  489. - name: cni
  490. mountPath: /etc/cni/net.d
  491. - name: flannel-cfg
  492. mountPath: /etc/kube-flannel/
  493. containers:
  494. - name: kube-flannel
  495. image: quay.io/coreos/flannel:v0.11.0-s390x
  496. command:
  497. - /opt/bin/flanneld
  498. args:
  499. - --ip-masq
  500. - --kube-subnet-mgr
  501. - --iface=ib0
  502. resources:
  503. requests:
  504. cpu: "100m"
  505. memory: "50Mi"
  506. limits:
  507. cpu: "100m"
  508. memory: "50Mi"
  509. securityContext:
  510. privileged: false
  511. capabilities:
  512. add: ["NET_ADMIN"]
  513. env:
  514. - name: POD_NAME
  515. valueFrom:
  516. fieldRef:
  517. fieldPath: metadata.name
  518. - name: POD_NAMESPACE
  519. valueFrom:
  520. fieldRef:
  521. fieldPath: metadata.namespace
  522. volumeMounts:
  523. - name: run
  524. mountPath: /run/flannel
  525. - name: flannel-cfg
  526. mountPath: /etc/kube-flannel/
  527. volumes:
  528. - name: run
  529. hostPath:
  530. path: /run/flannel
  531. - name: cni
  532. hostPath:
  533. path: /etc/cni/net.d
  534. - name: flannel-cfg
  535. configMap:
  536. name: kube-flannel-cfg