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.

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