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.

177 lines
5.3 KiB

  1. ---
  2. kind: Deployment
  3. apiVersion: apps/v1
  4. metadata:
  5. name: csi-azuredisk-controller
  6. namespace: kube-system
  7. spec:
  8. replicas: {{ azure_csi_controller_replicas }}
  9. selector:
  10. matchLabels:
  11. app: csi-azuredisk-controller
  12. template:
  13. metadata:
  14. labels:
  15. app: csi-azuredisk-controller
  16. spec:
  17. hostNetwork: true
  18. serviceAccountName: csi-azuredisk-controller-sa
  19. nodeSelector:
  20. kubernetes.io/os: linux
  21. priorityClassName: system-cluster-critical
  22. tolerations:
  23. - key: "node-role.kubernetes.io/control-plane"
  24. effect: "NoSchedule"
  25. {% if azure_csi_controller_affinity %}
  26. affinity:
  27. {{ azure_csi_controller_affinity | to_nice_yaml | indent(width=8) }}
  28. {% endif %}
  29. containers:
  30. - name: csi-provisioner
  31. image: {{ azure_csi_image_repo }}/csi-provisioner:{{ azure_csi_provisioner_image_tag }}
  32. imagePullPolicy: {{ k8s_image_pull_policy }}
  33. args:
  34. - "--feature-gates=Topology=true"
  35. - "--csi-address=$(ADDRESS)"
  36. - "--v=2"
  37. - "--timeout=15s"
  38. - "--leader-election"
  39. - "--worker-threads=40"
  40. - "--extra-create-metadata=true"
  41. - "--strict-topology=true"
  42. env:
  43. - name: ADDRESS
  44. value: /csi/csi.sock
  45. volumeMounts:
  46. - mountPath: /csi
  47. name: socket-dir
  48. resources:
  49. limits:
  50. memory: 500Mi
  51. requests:
  52. cpu: 10m
  53. memory: 20Mi
  54. - name: csi-attacher
  55. image: {{ azure_csi_image_repo }}/csi-attacher:{{ azure_csi_attacher_image_tag }}
  56. imagePullPolicy: {{ k8s_image_pull_policy }}
  57. args:
  58. - "-v=2"
  59. - "-csi-address=$(ADDRESS)"
  60. - "-timeout=600s"
  61. - "-leader-election"
  62. - "-worker-threads=500"
  63. env:
  64. - name: ADDRESS
  65. value: /csi/csi.sock
  66. volumeMounts:
  67. - mountPath: /csi
  68. name: socket-dir
  69. resources:
  70. limits:
  71. memory: 500Mi
  72. requests:
  73. cpu: 10m
  74. memory: 20Mi
  75. - name: csi-snapshotter
  76. image: {{ azure_csi_image_repo }}/csi-snapshotter:{{ azure_csi_snapshotter_image_tag }}
  77. args:
  78. - "-csi-address=$(ADDRESS)"
  79. - "-leader-election"
  80. - "-v=2"
  81. env:
  82. - name: ADDRESS
  83. value: /csi/csi.sock
  84. volumeMounts:
  85. - name: socket-dir
  86. mountPath: /csi
  87. resources:
  88. limits:
  89. memory: 100Mi
  90. requests:
  91. cpu: 10m
  92. memory: 20Mi
  93. - name: csi-resizer
  94. image: {{ azure_csi_image_repo }}/csi-resizer:{{ azure_csi_resizer_image_tag }}
  95. args:
  96. - "-csi-address=$(ADDRESS)"
  97. - "-v=2"
  98. - "-leader-election"
  99. - '-handle-volume-inuse-error=false'
  100. - "-timeout=60s"
  101. env:
  102. - name: ADDRESS
  103. value: /csi/csi.sock
  104. volumeMounts:
  105. - name: socket-dir
  106. mountPath: /csi
  107. resources:
  108. limits:
  109. memory: 500Mi
  110. requests:
  111. cpu: 10m
  112. memory: 20Mi
  113. - name: liveness-probe
  114. image: {{ azure_csi_image_repo }}/livenessprobe:{{ azure_csi_livenessprobe_image_tag }}
  115. args:
  116. - --csi-address=/csi/csi.sock
  117. - --probe-timeout=3s
  118. - --health-port=29602
  119. - --v=2
  120. volumeMounts:
  121. - name: socket-dir
  122. mountPath: /csi
  123. resources:
  124. limits:
  125. memory: 100Mi
  126. requests:
  127. cpu: 10m
  128. memory: 20Mi
  129. - name: azuredisk
  130. image: {{ azure_csi_plugin_image_repo }}/azuredisk-csi:{{ azure_csi_plugin_image_tag }}
  131. imagePullPolicy: {{ k8s_image_pull_policy }}
  132. args:
  133. - "--v=5"
  134. - "--endpoint=$(CSI_ENDPOINT)"
  135. - "--metrics-address=0.0.0.0:29604"
  136. - "--disable-avset-nodes=true"
  137. - "--drivername=disk.csi.azure.com"
  138. - "--cloud-config-secret-name=cloud-config"
  139. - "--cloud-config-secret-namespace=kube-system"
  140. ports:
  141. - containerPort: 29602
  142. name: healthz
  143. protocol: TCP
  144. - containerPort: 29604
  145. name: metrics
  146. protocol: TCP
  147. livenessProbe:
  148. failureThreshold: 5
  149. httpGet:
  150. path: /healthz
  151. port: healthz
  152. initialDelaySeconds: 30
  153. timeoutSeconds: 10
  154. periodSeconds: 30
  155. env:
  156. - name: AZURE_CREDENTIAL_FILE
  157. value: "/etc/kubernetes/azure.json"
  158. - name: CSI_ENDPOINT
  159. value: unix:///csi/csi.sock
  160. volumeMounts:
  161. - mountPath: /csi
  162. name: socket-dir
  163. - mountPath: /etc/kubernetes/
  164. name: azure-cred
  165. readOnly: true
  166. resources:
  167. limits:
  168. memory: 500Mi
  169. requests:
  170. cpu: 10m
  171. memory: 20Mi
  172. volumes:
  173. - name: socket-dir
  174. emptyDir: {}
  175. - name: azure-cred
  176. secret:
  177. secretName: cloud-config