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.

239 lines
6.5 KiB

  1. ---
  2. kind: Service
  3. apiVersion: v1
  4. metadata:
  5. name: ovn-nb-tcp
  6. namespace: kube-system
  7. spec:
  8. ports:
  9. - name: ovn-nb-tcp
  10. protocol: TCP
  11. port: 6641
  12. targetPort: 6641
  13. type: ClusterIP
  14. selector:
  15. app: ovn-control-plane
  16. sessionAffinity: None
  17. ---
  18. kind: Service
  19. apiVersion: v1
  20. metadata:
  21. name: ovn-sb-tcp
  22. namespace: kube-system
  23. spec:
  24. ports:
  25. - name: ovn-sb-tcp
  26. protocol: TCP
  27. port: 6642
  28. targetPort: 6642
  29. type: ClusterIP
  30. selector:
  31. app: ovn-control-plane
  32. sessionAffinity: None
  33. ---
  34. kind: Deployment
  35. apiVersion: apps/v1
  36. metadata:
  37. name: ovn-control-plane
  38. namespace: kube-system
  39. annotations:
  40. kubernetes.io/description: |
  41. OVN control plane deployment using tcp: ovn-northd-tcp, ovn-nb-tcp and ovn-sb-tcp.
  42. spec:
  43. replicas: 1
  44. strategy:
  45. rollingUpdate:
  46. maxSurge: 0%
  47. maxUnavailable: 100%
  48. type: RollingUpdate
  49. selector:
  50. matchLabels:
  51. app: ovn-control-plane
  52. template:
  53. metadata:
  54. labels:
  55. app: ovn-control-plane
  56. spec:
  57. tolerations:
  58. - operator: Exists
  59. effect: NoSchedule
  60. affinity:
  61. podAntiAffinity:
  62. requiredDuringSchedulingIgnoredDuringExecution:
  63. - labelSelector:
  64. matchLabels:
  65. app: ovn-control-plane
  66. topologyKey: kubernetes.io/hostname
  67. priorityClassName: system-cluster-critical
  68. hostNetwork: true
  69. containers:
  70. - name: ovn-control-plane
  71. image: {{ ovn4nfv_ovn_image_repo }}:{{ ovn4nfv_ovn_image_tag }}
  72. imagePullPolicy: {{ k8s_image_pull_policy }}
  73. command: ["ovn4nfv-k8s", "start_ovn_control_plane"]
  74. securityContext:
  75. capabilities:
  76. add: ["SYS_NICE"]
  77. env:
  78. - name: POD_IP
  79. valueFrom:
  80. fieldRef:
  81. fieldPath: status.podIP
  82. - name: POD_NAME
  83. valueFrom:
  84. fieldRef:
  85. fieldPath: metadata.name
  86. - name: POD_NAMESPACE
  87. valueFrom:
  88. fieldRef:
  89. fieldPath: metadata.namespace
  90. resources:
  91. requests:
  92. cpu: {{ ovn_control_plane_cpu_request }}
  93. memory: {{ ovn_control_plane_memory_request }}
  94. volumeMounts:
  95. - mountPath: /var/run/openvswitch
  96. name: host-run-ovs
  97. - mountPath: /var/run/ovn
  98. name: host-run-ovn
  99. - mountPath: /sys
  100. name: host-sys
  101. readOnly: true
  102. - mountPath: /etc/openvswitch
  103. name: host-config-openvswitch
  104. - mountPath: /var/log/openvswitch
  105. name: host-log-ovs
  106. - mountPath: /var/log/ovn
  107. name: host-log-ovn
  108. readinessProbe:
  109. exec:
  110. command: ["ovn4nfv-k8s", "check_ovn_control_plane"]
  111. periodSeconds: 3
  112. livenessProbe:
  113. exec:
  114. command: ["ovn4nfv-k8s", "check_ovn_control_plane"]
  115. initialDelaySeconds: 30
  116. periodSeconds: 7
  117. failureThreshold: 5
  118. nodeSelector:
  119. beta.kubernetes.io/os: "linux"
  120. ovn4nfv-k8s-plugin: ovn-control-plane
  121. volumes:
  122. - name: host-run-ovs
  123. hostPath:
  124. path: /run/openvswitch
  125. - name: host-run-ovn
  126. hostPath:
  127. path: /run/ovn
  128. - name: host-sys
  129. hostPath:
  130. path: /sys
  131. - name: host-config-openvswitch
  132. hostPath:
  133. path: /etc/origin/openvswitch
  134. - name: host-log-ovs
  135. hostPath:
  136. path: /var/log/openvswitch
  137. - name: host-log-ovn
  138. hostPath:
  139. path: /var/log/ovn
  140. ---
  141. kind: DaemonSet
  142. apiVersion: apps/v1
  143. metadata:
  144. name: ovn-controller
  145. namespace: kube-system
  146. annotations:
  147. kubernetes.io/description: |
  148. OVN controller: Start ovsdb-server & ovs-vswitchd components, and ovn controller
  149. spec:
  150. selector:
  151. matchLabels:
  152. app: ovn-controller
  153. updateStrategy:
  154. type: OnDelete
  155. template:
  156. metadata:
  157. labels:
  158. app: ovn-controller
  159. spec:
  160. tolerations:
  161. - operator: Exists
  162. effect: NoSchedule
  163. priorityClassName: system-cluster-critical
  164. hostNetwork: true
  165. hostPID: true
  166. containers:
  167. - name: ovn-controller
  168. image: {{ ovn4nfv_ovn_image_repo }}:{{ ovn4nfv_ovn_image_tag }}
  169. imagePullPolicy: {{ k8s_image_pull_policy }}
  170. command: ["ovn4nfv-k8s", "start_ovn_controller"]
  171. securityContext:
  172. runAsUser: 0
  173. privileged: true
  174. env:
  175. - name: POD_IP
  176. valueFrom:
  177. fieldRef:
  178. fieldPath: status.podIP
  179. volumeMounts:
  180. - mountPath: /lib/modules
  181. name: host-modules
  182. readOnly: true
  183. - mountPath: /var/run/openvswitch
  184. name: host-run-ovs
  185. - mountPath: /var/run/ovn
  186. name: host-run-ovn
  187. - mountPath: /sys
  188. name: host-sys
  189. readOnly: true
  190. - mountPath: /etc/openvswitch
  191. name: host-config-openvswitch
  192. - mountPath: /var/log/openvswitch
  193. name: host-log-ovs
  194. - mountPath: /var/log/ovn
  195. name: host-log-ovn
  196. readinessProbe:
  197. exec:
  198. command: ["ovn4nfv-k8s", "check_ovn_controller"]
  199. periodSeconds: 5
  200. livenessProbe:
  201. exec:
  202. command: ["ovn4nfv-k8s", "check_ovn_controller"]
  203. initialDelaySeconds: 10
  204. periodSeconds: 5
  205. failureThreshold: 5
  206. resources:
  207. requests:
  208. cpu: {{ ovn_controller_cpu_request }}
  209. memory: {{ ovn_controller_memory_request }}
  210. limits:
  211. cpu: {{ ovn_controller_cpu_limit }}
  212. memory: {{ ovn_controller_memory_limit }}
  213. nodeSelector:
  214. beta.kubernetes.io/os: "linux"
  215. volumes:
  216. - name: host-modules
  217. hostPath:
  218. path: /lib/modules
  219. - name: host-run-ovs
  220. hostPath:
  221. path: /run/openvswitch
  222. - name: host-run-ovn
  223. hostPath:
  224. path: /run/ovn
  225. - name: host-sys
  226. hostPath:
  227. path: /sys
  228. - name: host-config-openvswitch
  229. hostPath:
  230. path: /etc/origin/openvswitch
  231. - name: host-log-ovs
  232. hostPath:
  233. path: /var/log/openvswitch
  234. - name: host-log-ovn
  235. hostPath:
  236. path: /var/log/ovn