|
| 1 | +kind: Deployment |
| 2 | +apiVersion: apps/v1 |
| 3 | +metadata: |
| 4 | + name: {{ .Values.controller.name }} |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | +{{ include "azuredisk.labels" . | indent 2 }} |
| 7 | +{{- with .Values.controller.labels }} |
| 8 | +{{ . | toYaml | indent 4 }} |
| 9 | +{{- end }} |
| 10 | +{{- with .Values.controller.annotations }} |
| 11 | + annotations: |
| 12 | +{{ . | toYaml | indent 4 }} |
| 13 | +{{- end }} |
| 14 | +spec: |
| 15 | + replicas: {{ .Values.controller.replicas }} |
| 16 | + selector: |
| 17 | + matchLabels: |
| 18 | + app: {{ .Values.controller.name }} |
| 19 | + template: |
| 20 | + metadata: |
| 21 | +{{ include "azuredisk.labels" . | indent 6 }} |
| 22 | + app: {{ .Values.controller.name }} |
| 23 | + {{- if .Values.workloadIdentity.clientID }} |
| 24 | + azure.workload.identity/use: "true" |
| 25 | + {{- end }} |
| 26 | +{{- with .Values.controller.podLabels }} |
| 27 | +{{ toYaml . | indent 8 }} |
| 28 | +{{- end }} |
| 29 | +{{- with .Values.controller.podAnnotations }} |
| 30 | + annotations: |
| 31 | +{{ toYaml . | indent 8 }} |
| 32 | +{{- end }} |
| 33 | + spec: |
| 34 | + hostNetwork: {{ .Values.controller.hostNetwork }} |
| 35 | + serviceAccountName: {{ .Values.serviceAccount.controller }} |
| 36 | + nodeSelector: |
| 37 | + kubernetes.io/os: linux |
| 38 | +{{- with .Values.controller.nodeSelector }} |
| 39 | +{{ toYaml . | indent 8 }} |
| 40 | +{{- end }} |
| 41 | + # runOnControlPlane=true or runOnMaster=true only takes effect if affinity is not set |
| 42 | + {{- if tpl "{{ .Values.controller.affinity }}" . | contains "nodeSelectorTerms" }} |
| 43 | + {{- with .Values.controller.affinity }} |
| 44 | + affinity: |
| 45 | +{{ toYaml . | indent 8 }} |
| 46 | + {{- end }} |
| 47 | + {{- else if or .Values.controller.runOnControlPlane .Values.controller.runOnMaster}} |
| 48 | + affinity: |
| 49 | + nodeAffinity: |
| 50 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 51 | + nodeSelectorTerms: |
| 52 | + - matchExpressions: |
| 53 | + {{- if .Values.controller.runOnControlPlane}} |
| 54 | + - key: node-role.kubernetes.io/control-plane |
| 55 | + operator: Exists |
| 56 | + {{- end}} |
| 57 | + {{- if .Values.controller.runOnMaster}} |
| 58 | + - key: node-role.kubernetes.io/master |
| 59 | + operator: Exists |
| 60 | + {{- end}} |
| 61 | + {{- end }} |
| 62 | + priorityClassName: system-cluster-critical |
| 63 | + securityContext: |
| 64 | + seccompProfile: |
| 65 | + type: RuntimeDefault |
| 66 | +{{- with .Values.controller.tolerations }} |
| 67 | + tolerations: |
| 68 | +{{ toYaml . | indent 8 }} |
| 69 | +{{- end }} |
| 70 | + {{- include "azuredisk.pullSecrets" . | indent 6 }} |
| 71 | + containers: |
| 72 | + - name: csi-provisioner |
| 73 | +{{- if hasPrefix "/" .Values.image.csiProvisioner.repository }} |
| 74 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}" |
| 75 | +{{- else }} |
| 76 | + image: "{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}" |
| 77 | +{{- end }} |
| 78 | + args: |
| 79 | + - "--feature-gates=Topology=true,HonorPVReclaimPolicy=true" |
| 80 | + - "--csi-address=$(ADDRESS)" |
| 81 | + - "--v=2" |
| 82 | + - "--timeout=30s" |
| 83 | + - "--leader-election" |
| 84 | + - "--leader-election-namespace={{ .Release.Namespace }}" |
| 85 | + - "--worker-threads={{ .Values.controller.provisionerWorkerThreads }}" |
| 86 | + - "--extra-create-metadata=true" |
| 87 | + - "--strict-topology=true" |
| 88 | + - "--kube-api-qps=50" |
| 89 | + - "--kube-api-burst=100" |
| 90 | + - "--retry-interval-max=30m" |
| 91 | + env: |
| 92 | + - name: ADDRESS |
| 93 | + value: /csi/csi.sock |
| 94 | + volumeMounts: |
| 95 | + - mountPath: /csi |
| 96 | + name: socket-dir |
| 97 | + resources: {{- toYaml .Values.controller.resources.csiProvisioner | nindent 12 }} |
| 98 | + securityContext: |
| 99 | + capabilities: |
| 100 | + drop: |
| 101 | + - ALL |
| 102 | + - name: csi-attacher |
| 103 | +{{- if hasPrefix "/" .Values.image.csiAttacher.repository }} |
| 104 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.csiAttacher.repository }}:{{ .Values.image.csiAttacher.tag }}" |
| 105 | +{{- else }} |
| 106 | + image: "{{ .Values.image.csiAttacher.repository }}:{{ .Values.image.csiAttacher.tag }}" |
| 107 | +{{- end }} |
| 108 | + args: |
| 109 | + - "-v=2" |
| 110 | + - "-csi-address=$(ADDRESS)" |
| 111 | + - "-timeout=1200s" |
| 112 | + - "-leader-election" |
| 113 | + - "--leader-election-namespace={{ .Release.Namespace }}" |
| 114 | + - "-worker-threads={{ .Values.controller.attacherWorkerThreads }}" |
| 115 | + - "-kube-api-qps=200" |
| 116 | + - "-kube-api-burst=400" |
| 117 | + env: |
| 118 | + - name: ADDRESS |
| 119 | + value: /csi/csi.sock |
| 120 | + volumeMounts: |
| 121 | + - mountPath: /csi |
| 122 | + name: socket-dir |
| 123 | + resources: {{- toYaml .Values.controller.resources.csiAttacher | nindent 12 }} |
| 124 | + securityContext: |
| 125 | + capabilities: |
| 126 | + drop: |
| 127 | + - ALL |
| 128 | + - name: csi-snapshotter |
| 129 | +{{- if hasPrefix "/" .Values.snapshot.image.csiSnapshotter.repository }} |
| 130 | + image: "{{ .Values.image.baseRepo }}{{ .Values.snapshot.image.csiSnapshotter.repository }}:{{ .Values.snapshot.image.csiSnapshotter.tag }}" |
| 131 | +{{- else }} |
| 132 | + image: "{{ .Values.snapshot.image.csiSnapshotter.repository }}:{{ .Values.snapshot.image.csiSnapshotter.tag }}" |
| 133 | +{{- end }} |
| 134 | + args: |
| 135 | + - "-csi-address=$(ADDRESS)" |
| 136 | + - "-leader-election" |
| 137 | + - "--leader-election-namespace={{ .Release.Namespace }}" |
| 138 | + - "-v=2" |
| 139 | + - "--timeout=1200s" |
| 140 | + - "--extra-create-metadata=true" |
| 141 | + - "--retry-interval-max=30m" |
| 142 | + - "--worker-threads=100" |
| 143 | + env: |
| 144 | + - name: ADDRESS |
| 145 | + value: /csi/csi.sock |
| 146 | + volumeMounts: |
| 147 | + - name: socket-dir |
| 148 | + mountPath: /csi |
| 149 | + resources: {{- toYaml .Values.controller.resources.csiSnapshotter | nindent 12 }} |
| 150 | + securityContext: |
| 151 | + capabilities: |
| 152 | + drop: |
| 153 | + - ALL |
| 154 | + - name: csi-resizer |
| 155 | +{{- if hasPrefix "/" .Values.image.csiResizer.repository }} |
| 156 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.csiResizer.repository }}:{{ .Values.image.csiResizer.tag }}" |
| 157 | +{{- else }} |
| 158 | + image: "{{ .Values.image.csiResizer.repository }}:{{ .Values.image.csiResizer.tag }}" |
| 159 | +{{- end }} |
| 160 | + args: |
| 161 | + - "-csi-address=$(ADDRESS)" |
| 162 | + - "-v=2" |
| 163 | + - "-leader-election" |
| 164 | + - "--leader-election-namespace={{ .Release.Namespace }}" |
| 165 | + - '-handle-volume-inuse-error=false' |
| 166 | + - '-feature-gates=RecoverVolumeExpansionFailure=true' |
| 167 | + - "-timeout=240s" |
| 168 | + - "--retry-interval-max=30m" |
| 169 | + env: |
| 170 | + - name: ADDRESS |
| 171 | + value: /csi/csi.sock |
| 172 | + volumeMounts: |
| 173 | + - name: socket-dir |
| 174 | + mountPath: /csi |
| 175 | + resources: {{- toYaml .Values.controller.resources.csiResizer | nindent 12 }} |
| 176 | + securityContext: |
| 177 | + capabilities: |
| 178 | + drop: |
| 179 | + - ALL |
| 180 | + - name: liveness-probe |
| 181 | +{{- if hasPrefix "/" .Values.image.livenessProbe.repository }} |
| 182 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}" |
| 183 | +{{- else }} |
| 184 | + image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}" |
| 185 | +{{- end }} |
| 186 | + args: |
| 187 | + - --csi-address=/csi/csi.sock |
| 188 | + - --probe-timeout=3s |
| 189 | +{{- if eq .Values.controller.hostNetwork true }} |
| 190 | + - --http-endpoint=localhost:{{ .Values.controller.livenessProbe.healthPort }} |
| 191 | +{{- else }} |
| 192 | + - --health-port={{ .Values.controller.livenessProbe.healthPort }} |
| 193 | +{{- end }} |
| 194 | + - --v=2 |
| 195 | + volumeMounts: |
| 196 | + - name: socket-dir |
| 197 | + mountPath: /csi |
| 198 | + resources: {{- toYaml .Values.controller.resources.livenessProbe | nindent 12 }} |
| 199 | + securityContext: |
| 200 | + capabilities: |
| 201 | + drop: |
| 202 | + - ALL |
| 203 | +{{- if eq .Values.controller.enableTrafficManager true }} |
| 204 | + - image: mcr.microsoft.com/aks/ccp/ccp-auto-thrust:master.221118.2 |
| 205 | + imagePullPolicy: IfNotPresent |
| 206 | + name: proxy |
| 207 | + command: |
| 208 | + - /ccp-auto-thrust |
| 209 | + args: |
| 210 | + - "--port={{ .Values.controller.trafficManagerPort }}" |
| 211 | + ports: |
| 212 | + - containerPort: {{ .Values.controller.trafficManagerPort }} |
| 213 | + protocol: TCP |
| 214 | + securityContext: |
| 215 | + capabilities: |
| 216 | + drop: |
| 217 | + - ALL |
| 218 | +{{- end }} |
| 219 | + - name: azuredisk |
| 220 | +{{- if hasPrefix "/" .Values.image.azuredisk.repository }} |
| 221 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.azuredisk.repository }}:{{ .Values.image.azuredisk.tag }}" |
| 222 | +{{- else }} |
| 223 | + image: "{{ .Values.image.azuredisk.repository }}:{{ .Values.image.azuredisk.tag }}" |
| 224 | +{{- end }} |
| 225 | + args: |
| 226 | + - "--v={{ .Values.controller.logLevel }}" |
| 227 | + - "--endpoint=$(CSI_ENDPOINT)" |
| 228 | + - "--metrics-address=0.0.0.0:{{ .Values.controller.metricsPort }}" |
| 229 | + - "--disable-avset-nodes={{ .Values.controller.disableAvailabilitySetNodes }}" |
| 230 | + - "--vm-type={{ .Values.controller.vmType }}" |
| 231 | + - "--drivername={{ .Values.driver.name }}" |
| 232 | + - "--cloud-config-secret-name={{ .Values.controller.cloudConfigSecretName }}" |
| 233 | + - "--cloud-config-secret-namespace={{ .Values.controller.cloudConfigSecretNamespace }}" |
| 234 | + - "--custom-user-agent={{ .Values.driver.customUserAgent }}" |
| 235 | + - "--user-agent-suffix={{ .Values.driver.userAgentSuffix }}" |
| 236 | + - "--allow-empty-cloud-config={{ .Values.controller.allowEmptyCloudConfig }}" |
| 237 | + - "--vmss-cache-ttl-seconds={{ .Values.controller.vmssCacheTTLInSeconds }}" |
| 238 | + - "--enable-traffic-manager={{ .Values.controller.enableTrafficManager }}" |
| 239 | + - "--traffic-manager-port={{ .Values.controller.trafficManagerPort }}" |
| 240 | + - "--enable-otel-tracing={{ .Values.controller.otelTracing.enabled }}" |
| 241 | + - "--check-disk-lun-collision=true" |
| 242 | + {{- range $value := .Values.controller.extraArgs }} |
| 243 | + - {{ $value | quote }} |
| 244 | + {{- end }} |
| 245 | + ports: |
| 246 | + - containerPort: {{ .Values.controller.metricsPort }} |
| 247 | + name: metrics |
| 248 | + protocol: TCP |
| 249 | +{{- if ne .Values.controller.hostNetwork true }} |
| 250 | + - containerPort: {{ .Values.controller.livenessProbe.healthPort }} |
| 251 | + name: healthz |
| 252 | + protocol: TCP |
| 253 | +{{- end }} |
| 254 | + livenessProbe: |
| 255 | + failureThreshold: 5 |
| 256 | + httpGet: |
| 257 | + path: /healthz |
| 258 | +{{- if eq .Values.controller.hostNetwork true }} |
| 259 | + host: localhost |
| 260 | + port: {{ .Values.controller.livenessProbe.healthPort }} |
| 261 | +{{- else }} |
| 262 | + port: healthz |
| 263 | +{{- end }} |
| 264 | + initialDelaySeconds: 30 |
| 265 | + timeoutSeconds: 10 |
| 266 | + periodSeconds: 30 |
| 267 | + env: |
| 268 | + - name: AZURE_CREDENTIAL_FILE |
| 269 | + valueFrom: |
| 270 | + configMapKeyRef: |
| 271 | + name: {{ .Values.azureCredentialFileConfigMap }} |
| 272 | + key: path |
| 273 | + optional: true |
| 274 | + - name: CSI_ENDPOINT |
| 275 | + value: unix:///csi/csi.sock |
| 276 | + {{- if ne .Values.driver.httpsProxy "" }} |
| 277 | + - name: HTTPS_PROXY |
| 278 | + value: {{ .Values.driver.httpsProxy }} |
| 279 | + {{- end }} |
| 280 | + {{- if ne .Values.driver.httpProxy "" }} |
| 281 | + - name: HTTP_PROXY |
| 282 | + value: {{ .Values.driver.httpProxy }} |
| 283 | + {{- end }} |
| 284 | + {{- if ne .Values.driver.noProxy "" }} |
| 285 | + - name: NO_PROXY |
| 286 | + value: {{ .Values.driver.noProxy }} |
| 287 | + {{- end }} |
| 288 | + - name: AZURE_GO_SDK_LOG_LEVEL |
| 289 | + value: {{ .Values.driver.azureGoSDKLogLevel }} |
| 290 | + {{- if eq .Values.cloud "AzureStackCloud" }} |
| 291 | + - name: AZURE_ENVIRONMENT_FILEPATH |
| 292 | + value: /etc/kubernetes/azurestackcloud.json |
| 293 | + {{- end }} |
| 294 | + {{- if .Values.controller.otelTracing.enabled }} |
| 295 | + - name: OTEL_SERVICE_NAME |
| 296 | + value: {{ .Values.controller.otelTracing.otelServiceName }} |
| 297 | + - name: OTEL_EXPORTER_OTLP_ENDPOINT |
| 298 | + value: {{ .Values.controller.otelTracing.otelExporterEndpoint }} |
| 299 | + {{- end }} |
| 300 | + imagePullPolicy: {{ .Values.image.azuredisk.pullPolicy }} |
| 301 | + volumeMounts: |
| 302 | + - mountPath: /csi |
| 303 | + name: socket-dir |
| 304 | + - mountPath: /etc/kubernetes/ |
| 305 | + name: azure-cred |
| 306 | + {{- if or (eq .Values.cloud "AzureStackCloud") (eq .Values.linux.distro "fedora") }} |
| 307 | + - name: ssl |
| 308 | + mountPath: /etc/ssl/certs |
| 309 | + readOnly: true |
| 310 | + {{- end }} |
| 311 | + {{- if eq .Values.linux.distro "fedora" }} |
| 312 | + - name: ssl-pki |
| 313 | + mountPath: /etc/pki/ca-trust/extracted |
| 314 | + readOnly: true |
| 315 | + {{- end }} |
| 316 | + resources: {{- toYaml .Values.controller.resources.azuredisk | nindent 12 }} |
| 317 | + securityContext: |
| 318 | + capabilities: |
| 319 | + drop: |
| 320 | + - ALL |
| 321 | + volumes: |
| 322 | + - name: socket-dir |
| 323 | + emptyDir: {} |
| 324 | + - name: azure-cred |
| 325 | + hostPath: |
| 326 | + path: /etc/kubernetes/ |
| 327 | + type: DirectoryOrCreate |
| 328 | + {{- if or (eq .Values.cloud "AzureStackCloud") (eq .Values.linux.distro "fedora") }} |
| 329 | + - name: ssl |
| 330 | + hostPath: |
| 331 | + path: /etc/ssl/certs |
| 332 | + {{- end }} |
| 333 | + {{- if eq .Values.linux.distro "fedora" }} |
| 334 | + - name: ssl-pki |
| 335 | + hostPath: |
| 336 | + path: /etc/pki/ca-trust/extracted |
| 337 | + {{- end }} |
0 commit comments