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.

161 lines
4.5 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/v1beta1
  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/v1beta1
  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: weave-npc
  118. image: {{ weave_npc_image_repo }}:{{ weave_npc_image_tag }}
  119. imagePullPolicy: Always
  120. resources:
  121. requests:
  122. cpu: {{ weave_cpu_requests }}
  123. memory: {{ weave_memory_requests }}
  124. limits:
  125. cpu: {{ weave_cpu_limit }}
  126. memory: {{ weave_memory_limit }}
  127. securityContext:
  128. privileged: true
  129. hostNetwork: true
  130. hostPID: true
  131. restartPolicy: Always
  132. securityContext:
  133. seLinuxOptions: {}
  134. serviceAccountName: weave-net
  135. tolerations:
  136. - effect: NoSchedule
  137. operator: Exists
  138. volumes:
  139. - name: weavedb
  140. hostPath:
  141. path: /var/lib/weave
  142. - name: cni-bin
  143. hostPath:
  144. path: /opt
  145. - name: cni-bin2
  146. hostPath:
  147. path: /home
  148. - name: cni-conf
  149. hostPath:
  150. path: /etc
  151. - name: dbus
  152. hostPath:
  153. path: /var/lib/dbus
  154. - name: lib-modules
  155. hostPath:
  156. path: /lib/modules
  157. updateStrategy:
  158. rollingUpdate:
  159. maxUnavailable: {{ serial | default('20%') }}
  160. type: RollingUpdate