You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

283 lines
7.9 KiB

  1. ---
  2. apiVersion: v1
  3. kind: List
  4. items:
  5. - apiVersion: v1
  6. kind: ServiceAccount
  7. metadata:
  8. name: weave-net
  9. labels:
  10. name: weave-net
  11. namespace: kube-system
  12. - apiVersion: rbac.authorization.k8s.io/v1
  13. kind: ClusterRole
  14. metadata:
  15. name: weave-net
  16. labels:
  17. name: weave-net
  18. rules:
  19. - apiGroups:
  20. - ''
  21. resources:
  22. - pods
  23. - namespaces
  24. - nodes
  25. verbs:
  26. - get
  27. - list
  28. - watch
  29. - apiGroups:
  30. - networking.k8s.io
  31. resources:
  32. - networkpolicies
  33. verbs:
  34. - get
  35. - list
  36. - watch
  37. - apiGroups:
  38. - ''
  39. resources:
  40. - nodes/status
  41. verbs:
  42. - patch
  43. - update
  44. - apiGroups:
  45. - policy
  46. resourceNames:
  47. - privileged
  48. resources:
  49. - podsecuritypolicies
  50. verbs:
  51. - use
  52. - apiVersion: rbac.authorization.k8s.io/v1
  53. kind: ClusterRoleBinding
  54. metadata:
  55. name: weave-net
  56. labels:
  57. name: weave-net
  58. roleRef:
  59. kind: ClusterRole
  60. name: weave-net
  61. apiGroup: rbac.authorization.k8s.io
  62. subjects:
  63. - kind: ServiceAccount
  64. name: weave-net
  65. namespace: kube-system
  66. - apiVersion: rbac.authorization.k8s.io/v1
  67. kind: Role
  68. metadata:
  69. name: weave-net
  70. labels:
  71. name: weave-net
  72. namespace: kube-system
  73. rules:
  74. - apiGroups:
  75. - ''
  76. resourceNames:
  77. - weave-net
  78. resources:
  79. - configmaps
  80. verbs:
  81. - get
  82. - update
  83. - apiGroups:
  84. - ''
  85. resources:
  86. - configmaps
  87. verbs:
  88. - create
  89. - apiVersion: rbac.authorization.k8s.io/v1
  90. kind: RoleBinding
  91. metadata:
  92. name: weave-net
  93. labels:
  94. name: weave-net
  95. namespace: kube-system
  96. roleRef:
  97. kind: Role
  98. name: weave-net
  99. apiGroup: rbac.authorization.k8s.io
  100. subjects:
  101. - kind: ServiceAccount
  102. name: weave-net
  103. namespace: kube-system
  104. - apiVersion: apps/v1
  105. kind: DaemonSet
  106. metadata:
  107. name: weave-net
  108. labels:
  109. name: weave-net
  110. namespace: kube-system
  111. spec:
  112. minReadySeconds: 5
  113. selector:
  114. matchLabels:
  115. name: weave-net
  116. template:
  117. metadata:
  118. labels:
  119. name: weave-net
  120. spec:
  121. priorityClassName: system-node-critical
  122. initContainers:
  123. - name: weave-init
  124. image: {{ weave_kube_image_repo }}:{{ weave_kube_image_tag }}
  125. imagePullPolicy: {{ k8s_image_pull_policy }}
  126. command:
  127. - /home/weave/init.sh
  128. env:
  129. securityContext:
  130. privileged: true
  131. volumeMounts:
  132. - name: cni-bin
  133. mountPath: /host/opt
  134. - name: cni-bin2
  135. mountPath: /host/home
  136. - name: cni-conf
  137. mountPath: /host/etc
  138. - name: lib-modules
  139. mountPath: /lib/modules
  140. - name: xtables-lock
  141. mountPath: /run/xtables.lock
  142. readOnly: false
  143. containers:
  144. - name: weave
  145. command:
  146. - /home/weave/launch.sh
  147. env:
  148. - name: INIT_CONTAINER
  149. value: "true"
  150. - name: HOSTNAME
  151. valueFrom:
  152. fieldRef:
  153. apiVersion: v1
  154. fieldPath: spec.nodeName
  155. - name: WEAVE_PASSWORD
  156. valueFrom:
  157. secretKeyRef:
  158. name: weave-net
  159. key: WEAVE_PASSWORD
  160. - name: CHECKPOINT_DISABLE
  161. value: "{{ weave_checkpoint_disable | bool | int }}"
  162. - name: CONN_LIMIT
  163. value: "{{ weave_conn_limit | int }}"
  164. - name: HAIRPIN_MODE
  165. value: "{{ weave_hairpin_mode | bool | lower }}"
  166. - name: IPALLOC_RANGE
  167. value: "{{ weave_ipalloc_range }}"
  168. - name: EXPECT_NPC
  169. value: "{{ weave_expect_npc | bool | int }}"
  170. {% if weave_kube_peers %}
  171. - name: KUBE_PEERS
  172. value: "{{ weave_kube_peers }}"
  173. {% endif %}
  174. {% if weave_ipalloc_init %}
  175. - name: IPALLOC_INIT
  176. value: "{{ weave_ipalloc_init }}"
  177. {% endif %}
  178. {% if weave_expose_ip %}
  179. - name: WEAVE_EXPOSE_IP
  180. value: "{{ weave_expose_ip }}"
  181. {% endif %}
  182. {% if weave_metrics_addr %}
  183. - name: WEAVE_METRICS_ADDR
  184. value: "{{ weave_metrics_addr }}"
  185. {% endif %}
  186. {% if weave_status_addr %}
  187. - name: WEAVE_STATUS_ADDR
  188. value: "{{ weave_status_addr }}"
  189. {% endif %}
  190. {% if weave_iptables_backend %}
  191. - name: IPTABLES_BACKEND
  192. value: "{{ weave_iptables_backend }}"
  193. {% endif %}
  194. - name: WEAVE_MTU
  195. value: "{{ weave_mtu | int }}"
  196. - name: NO_MASQ_LOCAL
  197. value: "{{ weave_no_masq_local | bool | int }}"
  198. {% if weave_extra_args %}
  199. - name: EXTRA_ARGS
  200. value: "{{ weave_extra_args }}"
  201. {% endif %}
  202. image: {{ weave_kube_image_repo }}:{{ weave_kube_image_tag }}
  203. imagePullPolicy: {{ k8s_image_pull_policy }}
  204. readinessProbe:
  205. httpGet:
  206. host: 127.0.0.1
  207. path: /status
  208. port: 6784
  209. resources:
  210. requests:
  211. cpu: 50m
  212. securityContext:
  213. privileged: true
  214. volumeMounts:
  215. - name: weavedb
  216. mountPath: /weavedb
  217. - name: dbus
  218. mountPath: /host/var/lib/dbus
  219. readOnly: true
  220. - name: xtables-lock
  221. mountPath: /run/xtables.lock
  222. readOnly: false
  223. - name: weave-npc
  224. env:
  225. - name: HOSTNAME
  226. valueFrom:
  227. fieldRef:
  228. apiVersion: v1
  229. fieldPath: spec.nodeName
  230. image: {{ weave_npc_image_repo }}:{{ weave_npc_image_tag }}
  231. imagePullPolicy: {{ k8s_image_pull_policy }}
  232. resources:
  233. requests:
  234. cpu: 50m
  235. securityContext:
  236. privileged: true
  237. volumeMounts:
  238. - name: xtables-lock
  239. mountPath: /run/xtables.lock
  240. readOnly: false
  241. hostNetwork: true
  242. dnsPolicy: ClusterFirstWithHostNet
  243. hostPID: false
  244. restartPolicy: Always
  245. securityContext:
  246. seLinuxOptions: {}
  247. serviceAccountName: weave-net
  248. tolerations:
  249. - operator: Exists
  250. volumes:
  251. - name: weavedb
  252. hostPath:
  253. path: /var/lib/weave
  254. - name: cni-bin
  255. hostPath:
  256. path: /opt
  257. - name: cni-bin2
  258. hostPath:
  259. path: /home
  260. - name: cni-conf
  261. hostPath:
  262. path: /etc
  263. - name: dbus
  264. hostPath:
  265. path: /var/lib/dbus
  266. - name: lib-modules
  267. hostPath:
  268. path: /lib/modules
  269. - name: xtables-lock
  270. hostPath:
  271. path: /run/xtables.lock
  272. type: FileOrCreate
  273. updateStrategy:
  274. rollingUpdate:
  275. maxUnavailable: {{ serial | default('20%') }}
  276. type: RollingUpdate
  277. - apiVersion: v1
  278. kind: Secret
  279. metadata:
  280. name: weave-net
  281. namespace: kube-system
  282. data:
  283. WEAVE_PASSWORD: "{{ weave_password | default("") | b64encode }}"