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.

331 lines
8.5 KiB

  1. ---
  2. kind: Deployment
  3. apiVersion: apps/v1
  4. metadata:
  5. name: kube-ovn-controller
  6. namespace: kube-system
  7. annotations:
  8. kubernetes.io/description: |
  9. kube-ovn controller
  10. spec:
  11. replicas: 2
  12. selector:
  13. matchLabels:
  14. app: kube-ovn-controller
  15. strategy:
  16. rollingUpdate:
  17. maxSurge: 0%
  18. maxUnavailable: 100%
  19. type: RollingUpdate
  20. template:
  21. metadata:
  22. labels:
  23. app: kube-ovn-controller
  24. component: network
  25. type: infra
  26. spec:
  27. tolerations:
  28. - operator: Exists
  29. effect: NoSchedule
  30. affinity:
  31. podAntiAffinity:
  32. requiredDuringSchedulingIgnoredDuringExecution:
  33. - labelSelector:
  34. matchLabels:
  35. app: kube-ovn-controller
  36. topologyKey: kubernetes.io/hostname
  37. priorityClassName: system-cluster-critical
  38. serviceAccountName: ovn
  39. hostNetwork: true
  40. containers:
  41. - name: kube-ovn-controller
  42. image: {{ kube_ovn_container_image_repo }}:{{ kube_ovn_container_image_tag }}
  43. imagePullPolicy: {{ k8s_image_pull_policy }}
  44. command:
  45. - /kube-ovn/start-controller.sh
  46. args:
  47. - --default-cidr={{ kube_pods_subnet }}
  48. env:
  49. - name: POD_NAME
  50. valueFrom:
  51. fieldRef:
  52. fieldPath: metadata.name
  53. - name: KUBE_NAMESPACE
  54. valueFrom:
  55. fieldRef:
  56. fieldPath: metadata.namespace
  57. - name: KUBE_NODE_NAME
  58. valueFrom:
  59. fieldRef:
  60. fieldPath: spec.nodeName
  61. readinessProbe:
  62. exec:
  63. command:
  64. - sh
  65. - /kube-ovn/kube-ovn-controller-healthcheck.sh
  66. periodSeconds: 3
  67. livenessProbe:
  68. exec:
  69. command:
  70. - sh
  71. - /kube-ovn/kube-ovn-controller-healthcheck.sh
  72. initialDelaySeconds: 300
  73. periodSeconds: 7
  74. failureThreshold: 5
  75. nodeSelector:
  76. kubernetes.io/os: "linux"
  77. ---
  78. kind: DaemonSet
  79. apiVersion: apps/v1
  80. metadata:
  81. name: kube-ovn-cni
  82. namespace: kube-system
  83. annotations:
  84. kubernetes.io/description: |
  85. This daemon set launches the kube-ovn cni daemon.
  86. spec:
  87. selector:
  88. matchLabels:
  89. app: kube-ovn-cni
  90. updateStrategy:
  91. type: OnDelete
  92. template:
  93. metadata:
  94. labels:
  95. app: kube-ovn-cni
  96. component: network
  97. type: infra
  98. spec:
  99. tolerations:
  100. - operator: Exists
  101. priorityClassName: system-cluster-critical
  102. serviceAccountName: ovn
  103. hostNetwork: true
  104. hostPID: true
  105. initContainers:
  106. - name: install-cni
  107. image: {{ kube_ovn_container_image_repo }}:{{ kube_ovn_container_image_tag }}
  108. imagePullPolicy: {{ k8s_image_pull_policy }}
  109. command: ["/kube-ovn/install-cni.sh"]
  110. securityContext:
  111. runAsUser: 0
  112. privileged: true
  113. volumeMounts:
  114. - mountPath: /etc/cni/net.d
  115. name: cni-conf
  116. - mountPath: /opt/cni/bin
  117. name: cni-bin
  118. containers:
  119. - name: cni-server
  120. image: {{ kube_ovn_container_image_repo }}:{{ kube_ovn_container_image_tag }}
  121. imagePullPolicy: {{ k8s_image_pull_policy }}
  122. command:
  123. - sh
  124. - /kube-ovn/start-cniserver.sh
  125. args:
  126. - --enable-mirror={{ traffic_mirror }}
  127. - --encap-checksum={{ encap_checksum }}
  128. - --service-cluster-ip-range={{ kube_service_addresses }}
  129. securityContext:
  130. runAsUser: 0
  131. privileged: true
  132. env:
  133. - name: POD_IP
  134. valueFrom:
  135. fieldRef:
  136. fieldPath: status.podIP
  137. - name: KUBE_NODE_NAME
  138. valueFrom:
  139. fieldRef:
  140. fieldPath: spec.nodeName
  141. volumeMounts:
  142. - mountPath: /run/openvswitch
  143. name: host-run-ovs
  144. - mountPath: /run/ovn
  145. name: host-run-ovn
  146. - mountPath: /var/run/netns
  147. name: host-ns
  148. mountPropagation: HostToContainer
  149. readinessProbe:
  150. exec:
  151. command:
  152. - nc
  153. - -z
  154. - -w3
  155. - 127.0.0.1
  156. - "10665"
  157. periodSeconds: 3
  158. livenessProbe:
  159. exec:
  160. command:
  161. - nc
  162. - -z
  163. - -w3
  164. - 127.0.0.1
  165. - "10665"
  166. initialDelaySeconds: 30
  167. periodSeconds: 7
  168. failureThreshold: 5
  169. nodeSelector:
  170. kubernetes.io/os: "linux"
  171. volumes:
  172. - name: host-run-ovs
  173. hostPath:
  174. path: /run/openvswitch
  175. - name: host-run-ovn
  176. hostPath:
  177. path: /run/ovn
  178. - name: cni-conf
  179. hostPath:
  180. path: /etc/cni/net.d
  181. - name: cni-bin
  182. hostPath:
  183. path: /opt/cni/bin
  184. - name: host-ns
  185. hostPath:
  186. path: /var/run/netns
  187. ---
  188. kind: DaemonSet
  189. apiVersion: apps/v1
  190. metadata:
  191. name: kube-ovn-pinger
  192. namespace: kube-system
  193. annotations:
  194. kubernetes.io/description: |
  195. This daemon set launches the openvswitch daemon.
  196. spec:
  197. selector:
  198. matchLabels:
  199. app: kube-ovn-pinger
  200. updateStrategy:
  201. type: RollingUpdate
  202. template:
  203. metadata:
  204. labels:
  205. app: kube-ovn-pinger
  206. component: network
  207. type: infra
  208. spec:
  209. tolerations:
  210. - operator: Exists
  211. serviceAccountName: ovn
  212. hostPID: true
  213. containers:
  214. - name: pinger
  215. image: {{ kube_ovn_container_image_repo }}:{{ kube_ovn_container_image_tag }}
  216. imagePullPolicy: {{ k8s_image_pull_policy }}
  217. command: ["/kube-ovn/kube-ovn-pinger", "--external-address=114.114.114.114"]
  218. securityContext:
  219. runAsUser: 0
  220. privileged: false
  221. env:
  222. - name: POD_IP
  223. valueFrom:
  224. fieldRef:
  225. fieldPath: status.podIP
  226. - name: HOST_IP
  227. valueFrom:
  228. fieldRef:
  229. fieldPath: status.hostIP
  230. - name: POD_NAME
  231. valueFrom:
  232. fieldRef:
  233. fieldPath: metadata.name
  234. - name: NODE_NAME
  235. valueFrom:
  236. fieldRef:
  237. fieldPath: spec.nodeName
  238. volumeMounts:
  239. - mountPath: /lib/modules
  240. name: host-modules
  241. readOnly: true
  242. - mountPath: /run/openvswitch
  243. name: host-run-ovs
  244. - mountPath: /var/run/openvswitch
  245. name: host-run-ovs
  246. - mountPath: /var/run/ovn
  247. name: host-run-ovn
  248. - mountPath: /sys
  249. name: host-sys
  250. readOnly: true
  251. - mountPath: /etc/openvswitch
  252. name: host-config-openvswitch
  253. - mountPath: /var/log/openvswitch
  254. name: host-log-ovs
  255. - mountPath: /var/log/ovn
  256. name: host-log-ovn
  257. resources:
  258. requests:
  259. cpu: {{ kube_ovn_pinger_cpu_request }}
  260. memory: {{ kube_ovn_pinger_memory_request }}
  261. limits:
  262. cpu: {{ kube_ovn_pinger_cpu_limit }}
  263. memory: {{ kube_ovn_pinger_memory_limit }}
  264. nodeSelector:
  265. kubernetes.io/os: "linux"
  266. volumes:
  267. - name: host-modules
  268. hostPath:
  269. path: /lib/modules
  270. - name: host-run-ovs
  271. hostPath:
  272. path: /run/openvswitch
  273. - name: host-run-ovn
  274. hostPath:
  275. path: /run/ovn
  276. - name: host-sys
  277. hostPath:
  278. path: /sys
  279. - name: host-config-openvswitch
  280. hostPath:
  281. path: /etc/origin/openvswitch
  282. - name: host-log-ovs
  283. hostPath:
  284. path: /var/log/openvswitch
  285. - name: host-log-ovn
  286. hostPath:
  287. path: /var/log/ovn
  288. ---
  289. kind: Service
  290. apiVersion: v1
  291. metadata:
  292. name: kube-ovn-pinger
  293. namespace: kube-system
  294. labels:
  295. app: kube-ovn-pinger
  296. spec:
  297. selector:
  298. app: kube-ovn-pinger
  299. ports:
  300. - port: 8080
  301. name: metrics
  302. ---
  303. kind: Service
  304. apiVersion: v1
  305. metadata:
  306. name: kube-ovn-controller
  307. namespace: kube-system
  308. labels:
  309. app: kube-ovn-controller
  310. spec:
  311. selector:
  312. app: kube-ovn-controller
  313. ports:
  314. - port: 10660
  315. name: metrics
  316. ---
  317. kind: Service
  318. apiVersion: v1
  319. metadata:
  320. name: kube-ovn-cni
  321. namespace: kube-system
  322. labels:
  323. app: kube-ovn-cni
  324. spec:
  325. selector:
  326. app: kube-ovn-cni
  327. ports:
  328. - port: 10665
  329. name: metrics