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.

267 lines
7.3 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. containers:
  123. - name: weave
  124. command:
  125. - /home/weave/launch.sh
  126. env:
  127. - name: HOSTNAME
  128. valueFrom:
  129. fieldRef:
  130. apiVersion: v1
  131. fieldPath: spec.nodeName
  132. - name: WEAVE_PASSWORD
  133. valueFrom:
  134. secretKeyRef:
  135. name: weave-net
  136. key: WEAVE_PASSWORD
  137. - name: CHECKPOINT_DISABLE
  138. value: "{{ weave_checkpoint_disable | bool | int }}"
  139. - name: CONN_LIMIT
  140. value: "{{ weave_conn_limit | int }}"
  141. - name: HAIRPIN_MODE
  142. value: "{{ weave_hairpin_mode | bool | lower }}"
  143. - name: IPALLOC_RANGE
  144. value: "{{ weave_ipalloc_range }}"
  145. - name: EXPECT_NPC
  146. value: "{{ weave_expect_npc | bool | int }}"
  147. {% if weave_kube_peers %}
  148. - name: KUBE_PEERS
  149. value: "{{ weave_kube_peers }}"
  150. {% endif %}
  151. {% if weave_ipalloc_init %}
  152. - name: IPALLOC_INIT
  153. value: "{{ weave_ipalloc_init }}"
  154. {% endif %}
  155. {% if weave_expose_ip %}
  156. - name: WEAVE_EXPOSE_IP
  157. value: "{{ weave_expose_ip }}"
  158. {% endif %}
  159. {% if weave_metrics_addr %}
  160. - name: WEAVE_METRICS_ADDR
  161. value: "{{ weave_metrics_addr }}"
  162. {% endif %}
  163. {% if weave_status_addr %}
  164. - name: WEAVE_STATUS_ADDR
  165. value: "{{ weave_status_addr }}"
  166. {% endif %}
  167. {% if weave_iptables_backend %}
  168. - name: IPTABLES_BACKEND
  169. value: "{{ weave_iptables_backend }}"
  170. {% endif %}
  171. - name: WEAVE_MTU
  172. value: "{{ weave_mtu | int }}"
  173. - name: NO_MASQ_LOCAL
  174. value: "{{ weave_no_masq_local | bool | int }}"
  175. {% if weave_extra_args %}
  176. - name: EXTRA_ARGS
  177. value: "{{ weave_extra_args }}"
  178. {% endif %}
  179. image: {{ weave_kube_image_repo }}:{{ weave_kube_image_tag }}
  180. imagePullPolicy: {{ k8s_image_pull_policy }}
  181. readinessProbe:
  182. httpGet:
  183. host: 127.0.0.1
  184. path: /status
  185. port: 6784
  186. resources:
  187. requests:
  188. cpu: 50m
  189. securityContext:
  190. privileged: true
  191. volumeMounts:
  192. - name: weavedb
  193. mountPath: /weavedb
  194. - name: cni-bin
  195. mountPath: /host/opt
  196. - name: cni-bin2
  197. mountPath: /host/home
  198. - name: cni-conf
  199. mountPath: /host/etc
  200. - name: dbus
  201. mountPath: /host/var/lib/dbus
  202. - name: lib-modules
  203. mountPath: /lib/modules
  204. - name: xtables-lock
  205. mountPath: /run/xtables.lock
  206. readOnly: false
  207. - name: weave-npc
  208. env:
  209. - name: HOSTNAME
  210. valueFrom:
  211. fieldRef:
  212. apiVersion: v1
  213. fieldPath: spec.nodeName
  214. image: {{ weave_npc_image_repo }}:{{ weave_npc_image_tag }}
  215. imagePullPolicy: {{ k8s_image_pull_policy }}
  216. resources:
  217. requests:
  218. cpu: 50m
  219. securityContext:
  220. privileged: true
  221. volumeMounts:
  222. - name: xtables-lock
  223. mountPath: /run/xtables.lock
  224. readOnly: false
  225. hostNetwork: true
  226. dnsPolicy: ClusterFirstWithHostNet
  227. hostPID: true
  228. restartPolicy: Always
  229. securityContext:
  230. seLinuxOptions: {}
  231. serviceAccountName: weave-net
  232. tolerations:
  233. - operator: Exists
  234. volumes:
  235. - name: weavedb
  236. hostPath:
  237. path: /var/lib/weave
  238. - name: cni-bin
  239. hostPath:
  240. path: /opt
  241. - name: cni-bin2
  242. hostPath:
  243. path: /home
  244. - name: cni-conf
  245. hostPath:
  246. path: /etc
  247. - name: dbus
  248. hostPath:
  249. path: /var/lib/dbus
  250. - name: lib-modules
  251. hostPath:
  252. path: /lib/modules
  253. - name: xtables-lock
  254. hostPath:
  255. path: /run/xtables.lock
  256. type: FileOrCreate
  257. updateStrategy:
  258. rollingUpdate:
  259. maxUnavailable: {{ serial | default('20%') }}
  260. type: RollingUpdate
  261. - apiVersion: v1
  262. kind: Secret
  263. metadata:
  264. name: weave-net
  265. namespace: kube-system
  266. data:
  267. WEAVE_PASSWORD: "{{ weave_password | default("") | b64encode }}"