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.

260 lines
9.5 KiB

  1. kind: Deployment
  2. apiVersion: apps/v1
  3. metadata:
  4. name: vsphere-csi-controller
  5. namespace: "{{ vsphere_csi_namespace }}"
  6. spec:
  7. replicas: {{ vsphere_csi_controller_replicas }}
  8. strategy:
  9. type: RollingUpdate
  10. rollingUpdate:
  11. maxUnavailable: 1
  12. maxSurge: 0
  13. selector:
  14. matchLabels:
  15. app: vsphere-csi-controller
  16. template:
  17. metadata:
  18. labels:
  19. app: vsphere-csi-controller
  20. role: vsphere-csi
  21. spec:
  22. priorityClassName: system-cluster-critical # Guarantees scheduling for critical system pods
  23. affinity:
  24. podAntiAffinity:
  25. requiredDuringSchedulingIgnoredDuringExecution:
  26. - labelSelector:
  27. matchExpressions:
  28. - key: "app"
  29. operator: In
  30. values:
  31. - vsphere-csi-controller
  32. topologyKey: "kubernetes.io/hostname"
  33. serviceAccountName: vsphere-csi-controller
  34. nodeSelector:
  35. node-role.kubernetes.io/control-plane: ""
  36. tolerations:
  37. - operator: "Exists"
  38. key: node-role.kubernetes.io/control-plane
  39. effect: NoSchedule
  40. {% if vsphere_csi_aggressive_node_drain %}
  41. # set below toleration if you need an aggressive pod eviction in case when
  42. # node becomes not-ready or unreachable. Default is 300 seconds if not specified.
  43. - key: node.kubernetes.io/not-ready
  44. operator: Exists
  45. effect: NoExecute
  46. tolerationSeconds: {{ vsphere_csi_aggressive_node_not_ready_timeout }}
  47. - key: node.kubernetes.io/unreachable
  48. operator: Exists
  49. effect: NoExecute
  50. tolerationSeconds: {{ vsphere_csi_aggressive_node_unreachable_timeout }}
  51. {% endif %}
  52. dnsPolicy: "Default"
  53. containers:
  54. - name: csi-attacher
  55. image: {{ kube_image_repo }}/sig-storage/csi-attacher:{{ vsphere_csi_attacher_image_tag }}
  56. args:
  57. - "--v=4"
  58. - "--timeout=300s"
  59. - "--csi-address=$(ADDRESS)"
  60. - "--leader-election"
  61. - "--leader-election-lease-duration=120s"
  62. - "--leader-election-renew-deadline=60s"
  63. - "--leader-election-retry-period=30s"
  64. - "--kube-api-qps=100"
  65. - "--kube-api-burst=100"
  66. {% if vsphere_csi_attacher_resources | length > 0 %}
  67. resources:
  68. {{ vsphere_csi_attacher_resources | default({}) | to_nice_yaml | trim | indent(width=12) }}
  69. {% endif %}
  70. env:
  71. - name: ADDRESS
  72. value: /csi/csi.sock
  73. volumeMounts:
  74. - mountPath: /csi
  75. name: socket-dir
  76. {% if external_vsphere_version >= "7.0" %}
  77. - name: csi-resizer
  78. image: {{ kube_image_repo }}/sig-storage/csi-resizer:{{ vsphere_csi_resizer_tag }}
  79. args:
  80. - "--v=4"
  81. - "--timeout=300s"
  82. - "--csi-address=$(ADDRESS)"
  83. - "--handle-volume-inuse-error=false"
  84. - "--kube-api-qps=100"
  85. - "--kube-api-burst=100"
  86. - "--leader-election"
  87. - "--leader-election-lease-duration=120s"
  88. - "--leader-election-renew-deadline=60s"
  89. - "--leader-election-retry-period=30s"
  90. {% if vsphere_csi_resizer_resources | length > 0 %}
  91. resources:
  92. {{ vsphere_csi_resizer_resources | default({}) | to_nice_yaml | trim | indent(width=12) }}
  93. {% endif %}
  94. env:
  95. - name: ADDRESS
  96. value: /csi/csi.sock
  97. volumeMounts:
  98. - mountPath: /csi
  99. name: socket-dir
  100. {% endif %}
  101. - name: vsphere-csi-controller
  102. image: {{ gcr_image_repo }}/cloud-provider-vsphere/csi/release/driver:{{ vsphere_csi_controller }}
  103. args:
  104. - "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
  105. - "--fss-namespace={{ vsphere_csi_namespace }}"
  106. {% if vsphere_csi_resources | length > 0 %}
  107. resources:
  108. {{ vsphere_csi_resources | default({}) | to_nice_yaml | trim | indent(width=12) }}
  109. {% endif %}
  110. imagePullPolicy: {{ k8s_image_pull_policy }}
  111. env:
  112. - name: CSI_ENDPOINT
  113. value: unix://{{ csi_endpoint }}/csi.sock
  114. - name: X_CSI_MODE
  115. value: "controller"
  116. - name: X_CSI_SPEC_DISABLE_LEN_CHECK
  117. value: "true"
  118. - name: X_CSI_SERIAL_VOL_ACCESS_TIMEOUT
  119. value: 3m
  120. - name: VSPHERE_CSI_CONFIG
  121. value: "/etc/cloud/csi-vsphere.conf"
  122. - name: LOGGER_LEVEL
  123. value: "PRODUCTION" # Options: DEVELOPMENT, PRODUCTION
  124. {% if external_vsphere_version >= "7.0u1" %}
  125. - name: INCLUSTER_CLIENT_QPS
  126. value: "100"
  127. - name: INCLUSTER_CLIENT_BURST
  128. value: "100"
  129. {% endif %}
  130. volumeMounts:
  131. - mountPath: /etc/cloud
  132. name: vsphere-config-volume
  133. readOnly: true
  134. - mountPath: {{ csi_endpoint }}
  135. name: socket-dir
  136. securityContext:
  137. runAsNonRoot: true
  138. runAsUser: 65532
  139. runAsGroup: 65532
  140. ports:
  141. - name: healthz
  142. containerPort: 9808
  143. protocol: TCP
  144. - name: prometheus
  145. containerPort: 2112
  146. protocol: TCP
  147. livenessProbe:
  148. httpGet:
  149. path: /healthz
  150. port: healthz
  151. initialDelaySeconds: 30
  152. timeoutSeconds: 10
  153. periodSeconds: 180
  154. failureThreshold: 3
  155. - name: liveness-probe
  156. image: {{ kube_image_repo }}/sig-storage/livenessprobe:{{ vsphere_csi_liveness_probe_image_tag }}
  157. args:
  158. - "--v=4"
  159. - "--csi-address=$(ADDRESS)"
  160. {% if vsphere_csi_liveness_probe_controller_resources | length > 0 %}
  161. resources:
  162. {{ vsphere_csi_liveness_probe_controller_resources | default({}) | to_nice_yaml | trim | indent(width=12) }}
  163. {% endif %}
  164. env:
  165. - name: ADDRESS
  166. value: {{ csi_endpoint }}/csi.sock
  167. volumeMounts:
  168. - name: socket-dir
  169. mountPath: {{ csi_endpoint }}
  170. - name: vsphere-syncer
  171. image: {{ gcr_image_repo }}/cloud-provider-vsphere/csi/release/syncer:{{ vsphere_syncer_image_tag }}
  172. args:
  173. - "--leader-election"
  174. - "--leader-election-lease-duration=30s"
  175. - "--leader-election-renew-deadline=20s"
  176. - "--leader-election-retry-period=10s"
  177. - "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
  178. - "--fss-namespace={{ vsphere_csi_namespace }}"
  179. imagePullPolicy: {{ k8s_image_pull_policy }}
  180. securityContext:
  181. runAsNonRoot: true
  182. runAsUser: 65532
  183. runAsGroup: 65532
  184. ports:
  185. - containerPort: 2113
  186. name: prometheus
  187. protocol: TCP
  188. {% if vsphere_syncer_resources | length > 0 %}
  189. resources:
  190. {{ vsphere_syncer_resources | default({}) | to_nice_yaml | trim | indent(width=12) }}
  191. {% endif %}
  192. env:
  193. - name: FULL_SYNC_INTERVAL_MINUTES
  194. value: "30"
  195. - name: VSPHERE_CSI_CONFIG
  196. value: "/etc/cloud/csi-vsphere.conf"
  197. - name: LOGGER_LEVEL
  198. value: "PRODUCTION" # Options: DEVELOPMENT, PRODUCTION
  199. {% if external_vsphere_version >= "7.0u1" %}
  200. - name: INCLUSTER_CLIENT_QPS
  201. value: "100"
  202. - name: INCLUSTER_CLIENT_BURST
  203. value: "100"
  204. {% endif %}
  205. volumeMounts:
  206. - mountPath: /etc/cloud
  207. name: vsphere-config-volume
  208. readOnly: true
  209. - name: csi-provisioner
  210. image: {{ kube_image_repo }}/sig-storage/csi-provisioner:{{ vsphere_csi_provisioner_image_tag }}
  211. args:
  212. - "--v=4"
  213. - "--timeout=300s"
  214. - "--csi-address=$(ADDRESS)"
  215. - "--kube-api-qps=100"
  216. - "--kube-api-burst=100"
  217. - "--leader-election"
  218. - "--leader-election-lease-duration=120s"
  219. - "--leader-election-renew-deadline=60s"
  220. - "--leader-election-retry-period=30s"
  221. - "--default-fstype=ext4"
  222. - "--leader-election"
  223. - "--default-fstype=ext4"
  224. # needed only for topology aware setup
  225. #- "--feature-gates=Topology=true"
  226. #- "--strict-topology"
  227. env:
  228. - name: ADDRESS
  229. value: /csi/csi.sock
  230. volumeMounts:
  231. - mountPath: /csi
  232. name: socket-dir
  233. {% if vsphere_csi_provisioner_resources | length > 0 %}
  234. resources:
  235. {{ vsphere_csi_provisioner_resources | default({}) | to_nice_yaml | trim | indent(width=12) }}
  236. {% endif %}
  237. - name: csi-snapshotter
  238. image: {{ kube_image_repo }}/sig-storage/csi-snapshotter:{{ vsphere_csi_snapshotter_image_tag }}
  239. args:
  240. - "--v=4"
  241. - "--kube-api-qps=100"
  242. - "--kube-api-burst=100"
  243. - "--timeout=300s"
  244. - "--csi-address=$(ADDRESS)"
  245. - "--leader-election"
  246. - "--leader-election-lease-duration=120s"
  247. - "--leader-election-renew-deadline=60s"
  248. - "--leader-election-retry-period=30s"
  249. env:
  250. - name: ADDRESS
  251. value: /csi/csi.sock
  252. volumeMounts:
  253. - mountPath: /csi
  254. name: socket-dir
  255. volumes:
  256. - name: vsphere-config-volume
  257. secret:
  258. secretName: vsphere-config-secret
  259. - name: socket-dir
  260. emptyDir: {}