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.

199 lines
5.4 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: {{ system_namespace }}
  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. - extensions
  31. resources:
  32. - networkpolicies
  33. verbs:
  34. - get
  35. - list
  36. - watch
  37. - apiGroups:
  38. - 'networking.k8s.io'
  39. resources:
  40. - networkpolicies
  41. verbs:
  42. - get
  43. - list
  44. - watch
  45. - apiVersion: rbac.authorization.k8s.io/v1beta1
  46. kind: Role
  47. metadata:
  48. name: weave-net
  49. namespace: kube-system
  50. labels:
  51. name: weave-net
  52. rules:
  53. - apiGroups:
  54. - ''
  55. resources:
  56. - configmaps
  57. resourceNames:
  58. - weave-net
  59. verbs:
  60. - get
  61. - update
  62. - apiGroups:
  63. - ''
  64. resources:
  65. - configmaps
  66. verbs:
  67. - create
  68. - apiVersion: rbac.authorization.k8s.io/v1
  69. kind: ClusterRoleBinding
  70. metadata:
  71. name: weave-net
  72. labels:
  73. name: weave-net
  74. roleRef:
  75. kind: ClusterRole
  76. name: weave-net
  77. apiGroup: rbac.authorization.k8s.io
  78. subjects:
  79. - kind: ServiceAccount
  80. name: weave-net
  81. namespace: kube-system
  82. - apiVersion: extensions/v1beta1
  83. kind: DaemonSet
  84. metadata:
  85. name: weave-net
  86. labels:
  87. name: weave-net
  88. version: {{ weave_version }}
  89. namespace: {{ system_namespace }}
  90. spec:
  91. template:
  92. metadata:
  93. labels:
  94. name: weave-net
  95. spec:
  96. containers:
  97. - name: weave
  98. command:
  99. {% if weave_mode_seed == true %}
  100. - /bin/sh
  101. - -c
  102. - export EXTRA_ARGS=--name=$(cat /sys/class/net/{{ ansible_default_ipv4['interface'] }}/address) && /home/weave/launch.sh
  103. {% else %}
  104. - /home/weave/launch.sh
  105. {% endif %}
  106. env:
  107. - name: HOSTNAME
  108. valueFrom:
  109. fieldRef:
  110. apiVersion: v1
  111. fieldPath: spec.nodeName
  112. - name: WEAVE_MTU
  113. value: "{{ weave_mtu }}"
  114. - name: IPALLOC_RANGE
  115. value: {{ kube_pods_subnet }}
  116. {% if weave_mode_seed == true %}
  117. - name: KUBE_PEERS
  118. value: {{ peers }}
  119. - name: IPALLOC_INIT
  120. value: seed={{ seed }}
  121. {% endif %}
  122. - name: WEAVE_PASSWORD
  123. value: {{ weave_password }}
  124. image: {{ weave_kube_image_repo }}:{{ weave_kube_image_tag }}
  125. imagePullPolicy: Always
  126. livenessProbe:
  127. httpGet:
  128. host: 127.0.0.1
  129. path: /status
  130. port: 6784
  131. initialDelaySeconds: 30
  132. resources:
  133. requests:
  134. cpu: 10m
  135. securityContext:
  136. privileged: true
  137. volumeMounts:
  138. - name: weavedb
  139. mountPath: /weavedb
  140. - name: cni-bin
  141. mountPath: /host/opt
  142. - name: cni-bin2
  143. mountPath: /host/home
  144. - name: cni-conf
  145. mountPath: /host/etc
  146. - name: dbus
  147. mountPath: /host/var/lib/dbus
  148. - name: lib-modules
  149. mountPath: /lib/modules
  150. - name: xtables-lock
  151. mountPath: /run/xtables.lock
  152. readOnly: false
  153. - name: weave-npc
  154. image: {{ weave_npc_image_repo }}:{{ weave_npc_image_tag }}
  155. imagePullPolicy: Always
  156. resources:
  157. requests:
  158. cpu: {{ weave_cpu_requests }}
  159. memory: {{ weave_memory_requests }}
  160. limits:
  161. cpu: {{ weave_cpu_limit }}
  162. memory: {{ weave_memory_limit }}
  163. securityContext:
  164. privileged: true
  165. hostNetwork: true
  166. hostPID: true
  167. restartPolicy: Always
  168. securityContext:
  169. seLinuxOptions: {}
  170. serviceAccountName: weave-net
  171. tolerations:
  172. - effect: NoSchedule
  173. operator: Exists
  174. volumes:
  175. - name: weavedb
  176. hostPath:
  177. path: /var/lib/weave
  178. - name: cni-bin
  179. hostPath:
  180. path: /opt
  181. - name: cni-bin2
  182. hostPath:
  183. path: /home
  184. - name: cni-conf
  185. hostPath:
  186. path: /etc
  187. - name: dbus
  188. hostPath:
  189. path: /var/lib/dbus
  190. - name: lib-modules
  191. hostPath:
  192. path: /lib/modules
  193. - name: xtables-lock
  194. hostPath:
  195. path: /run/xtables.lock
  196. updateStrategy:
  197. rollingUpdate:
  198. maxUnavailable: {{ serial | default('20%') }}
  199. type: RollingUpdate