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.

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