|
| 1 | +kind: Deployment |
| 2 | +apiVersion: apps/v1 |
| 3 | +metadata: |
| 4 | + name: {{ .Values.controller.name }} |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | + labels: |
| 7 | + app: {{ .Values.controller.name }} |
| 8 | + {{- include "azurefile.labels" . | nindent 4 }} |
| 9 | +{{- with .Values.controller.labels }} |
| 10 | +{{ . | toYaml | indent 4 }} |
| 11 | +{{- end }} |
| 12 | +{{- with .Values.controller.annotations }} |
| 13 | + annotations: |
| 14 | +{{ . | toYaml | indent 4 }} |
| 15 | +{{- end }} |
| 16 | +spec: |
| 17 | + replicas: {{ .Values.controller.replicas }} |
| 18 | + selector: |
| 19 | + matchLabels: |
| 20 | + {{- include "azurefile.selectorLabels" . | nindent 6 }} |
| 21 | + app: {{ .Values.controller.name }} |
| 22 | + template: |
| 23 | + metadata: |
| 24 | + labels: |
| 25 | + {{- include "azurefile.labels" . | nindent 8 }} |
| 26 | + app: {{ .Values.controller.name }} |
| 27 | + {{- if .Values.workloadIdentity.clientID }} |
| 28 | + azure.workload.identity/use: "true" |
| 29 | + {{- end }} |
| 30 | +{{- with .Values.controller.podLabels }} |
| 31 | +{{ toYaml . | indent 8 }} |
| 32 | +{{- end }} |
| 33 | +{{- with .Values.controller.podAnnotations }} |
| 34 | + annotations: |
| 35 | +{{ toYaml . | indent 8 }} |
| 36 | +{{- end }} |
| 37 | + spec: |
| 38 | + hostNetwork: {{ .Values.controller.hostNetwork }} |
| 39 | + serviceAccountName: {{ .Values.serviceAccount.controller }} |
| 40 | + nodeSelector: |
| 41 | + kubernetes.io/os: linux |
| 42 | +{{- with .Values.controller.nodeSelector }} |
| 43 | +{{ toYaml . | indent 8 }} |
| 44 | +{{- end }} |
| 45 | + {{- if .Values.controller.runOnMaster}} |
| 46 | + node-role.kubernetes.io/master: "" |
| 47 | + {{- end}} |
| 48 | + {{- if .Values.controller.runOnControlPlane}} |
| 49 | + node-role.kubernetes.io/control-plane: "" |
| 50 | + {{- end}} |
| 51 | + priorityClassName: system-cluster-critical |
| 52 | +{{- with .Values.controller.tolerations }} |
| 53 | + tolerations: |
| 54 | +{{ toYaml . | indent 8 }} |
| 55 | +{{- end }} |
| 56 | +{{- with .Values.controller.affinity }} |
| 57 | + affinity: |
| 58 | +{{ toYaml . | indent 8 }} |
| 59 | +{{- end }} |
| 60 | + {{- if .Values.imagePullSecrets }} |
| 61 | + imagePullSecrets: |
| 62 | +{{ toYaml .Values.imagePullSecrets | indent 8 }} |
| 63 | + {{- end }} |
| 64 | + containers: |
| 65 | + - name: csi-provisioner |
| 66 | +{{- if hasPrefix "/" .Values.image.csiProvisioner.repository }} |
| 67 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}" |
| 68 | +{{- else }} |
| 69 | + image: "{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}" |
| 70 | +{{- end }} |
| 71 | + args: |
| 72 | + - "-v=2" |
| 73 | + - "--csi-address=$(ADDRESS)" |
| 74 | + - "--leader-election" |
| 75 | + - "--leader-election-namespace={{ .Release.Namespace }}" |
| 76 | + - "--timeout=1200s" |
| 77 | + - "--extra-create-metadata=true" |
| 78 | + - "--kube-api-qps=50" |
| 79 | + - "--kube-api-burst=100" |
| 80 | + - "--feature-gates=HonorPVReclaimPolicy=true" |
| 81 | + env: |
| 82 | + - name: ADDRESS |
| 83 | + value: /csi/csi.sock |
| 84 | + imagePullPolicy: {{ .Values.image.csiProvisioner.pullPolicy }} |
| 85 | + volumeMounts: |
| 86 | + - mountPath: /csi |
| 87 | + name: socket-dir |
| 88 | + resources: {{- toYaml .Values.controller.resources.csiProvisioner | nindent 12 }} |
| 89 | + - name: csi-snapshotter |
| 90 | +{{- if hasPrefix "/" .Values.snapshot.image.csiSnapshotter.repository }} |
| 91 | + image: "{{ .Values.image.baseRepo }}{{ .Values.snapshot.image.csiSnapshotter.repository }}:{{ .Values.snapshot.image.csiSnapshotter.tag }}" |
| 92 | +{{- else }} |
| 93 | + image: "{{ .Values.snapshot.image.csiSnapshotter.repository }}:{{ .Values.snapshot.image.csiSnapshotter.tag }}" |
| 94 | +{{- end }} |
| 95 | + args: |
| 96 | + - "-csi-address=$(ADDRESS)" |
| 97 | + - "-leader-election" |
| 98 | + - "--leader-election-namespace={{ .Release.Namespace }}" |
| 99 | + - "-v=2" |
| 100 | + env: |
| 101 | + - name: ADDRESS |
| 102 | + value: /csi/csi.sock |
| 103 | + volumeMounts: |
| 104 | + - name: socket-dir |
| 105 | + mountPath: /csi |
| 106 | + resources: {{- toYaml .Values.controller.resources.csiSnapshotter | nindent 12 }} |
| 107 | + - name: csi-resizer |
| 108 | +{{- if hasPrefix "/" .Values.image.csiResizer.repository }} |
| 109 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.csiResizer.repository }}:{{ .Values.image.csiResizer.tag }}" |
| 110 | +{{- else }} |
| 111 | + image: "{{ .Values.image.csiResizer.repository }}:{{ .Values.image.csiResizer.tag }}" |
| 112 | +{{- end }} |
| 113 | + args: |
| 114 | + - "-csi-address=$(ADDRESS)" |
| 115 | + - "-v=2" |
| 116 | + - "-leader-election" |
| 117 | + - "--leader-election-namespace={{ .Release.Namespace }}" |
| 118 | + - '-handle-volume-inuse-error=false' |
| 119 | + - '-timeout=120s' |
| 120 | + - '-feature-gates=RecoverVolumeExpansionFailure=true' |
| 121 | + env: |
| 122 | + - name: ADDRESS |
| 123 | + value: /csi/csi.sock |
| 124 | + imagePullPolicy: {{ .Values.image.csiResizer.pullPolicy }} |
| 125 | + volumeMounts: |
| 126 | + - name: socket-dir |
| 127 | + mountPath: /csi |
| 128 | + resources: {{- toYaml .Values.controller.resources.csiResizer | nindent 12 }} |
| 129 | + - name: liveness-probe |
| 130 | +{{- if hasPrefix "/" .Values.image.livenessProbe.repository }} |
| 131 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}" |
| 132 | +{{- else }} |
| 133 | + image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}" |
| 134 | +{{- end }} |
| 135 | + args: |
| 136 | + - --csi-address=/csi/csi.sock |
| 137 | + - --probe-timeout=3s |
| 138 | + - --http-endpoint=localhost:{{ .Values.controller.livenessProbe.healthPort }} |
| 139 | + - --v=2 |
| 140 | + imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }} |
| 141 | + volumeMounts: |
| 142 | + - name: socket-dir |
| 143 | + mountPath: /csi |
| 144 | + resources: {{- toYaml .Values.controller.resources.livenessProbe | nindent 12 }} |
| 145 | + - name: azurefile |
| 146 | +{{- if hasPrefix "/" .Values.image.azurefile.repository }} |
| 147 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.azurefile.repository }}:{{ .Values.image.azurefile.tag }}" |
| 148 | +{{- else }} |
| 149 | + image: "{{ .Values.image.azurefile.repository }}:{{ .Values.image.azurefile.tag }}" |
| 150 | +{{- end }} |
| 151 | + args: |
| 152 | + - "--v={{ .Values.controller.logLevel }}" |
| 153 | + - "--endpoint=$(CSI_ENDPOINT)" |
| 154 | + - "--metrics-address=0.0.0.0:{{ .Values.controller.metricsPort }}" |
| 155 | + - "--kubeconfig={{ .Values.controller.kubeconfig }}" |
| 156 | + - "--drivername={{ .Values.driver.name }}" |
| 157 | + - "--cloud-config-secret-name={{ .Values.controller.cloudConfigSecretName }}" |
| 158 | + - "--cloud-config-secret-namespace={{ .Values.controller.cloudConfigSecretNamespace }}" |
| 159 | + - "--custom-user-agent={{ .Values.driver.customUserAgent }}" |
| 160 | + - "--user-agent-suffix={{ .Values.driver.userAgentSuffix }}" |
| 161 | + - "--allow-empty-cloud-config={{ .Values.controller.allowEmptyCloudConfig }}" |
| 162 | + ports: |
| 163 | + - containerPort: {{ .Values.controller.metricsPort }} |
| 164 | + name: metrics |
| 165 | + protocol: TCP |
| 166 | + livenessProbe: |
| 167 | + failureThreshold: 5 |
| 168 | + httpGet: |
| 169 | + host: localhost |
| 170 | + path: /healthz |
| 171 | + port: {{ .Values.controller.livenessProbe.healthPort }} |
| 172 | + initialDelaySeconds: 30 |
| 173 | + timeoutSeconds: 10 |
| 174 | + periodSeconds: 30 |
| 175 | + env: |
| 176 | + - name: AZURE_CREDENTIAL_FILE |
| 177 | + valueFrom: |
| 178 | + configMapKeyRef: |
| 179 | + name: {{ .Values.azureCredentialFileConfigMap }} |
| 180 | + key: path |
| 181 | + optional: true |
| 182 | + - name: CSI_ENDPOINT |
| 183 | + value: unix:///csi/csi.sock |
| 184 | + {{- if ne .Values.driver.httpsProxy "" }} |
| 185 | + - name: HTTPS_PROXY |
| 186 | + value: {{ .Values.driver.httpsProxy }} |
| 187 | + {{- end }} |
| 188 | + {{- if ne .Values.driver.httpProxy "" }} |
| 189 | + - name: HTTP_PROXY |
| 190 | + value: {{ .Values.driver.httpProxy }} |
| 191 | + {{- end }} |
| 192 | + - name: AZURE_GO_SDK_LOG_LEVEL |
| 193 | + value: {{ .Values.driver.azureGoSDKLogLevel }} |
| 194 | + imagePullPolicy: {{ .Values.image.azurefile.pullPolicy }} |
| 195 | + volumeMounts: |
| 196 | + - mountPath: /csi |
| 197 | + name: socket-dir |
| 198 | + - mountPath: /root/.azcopy |
| 199 | + name: azcopy-dir |
| 200 | + - mountPath: /etc/kubernetes/ |
| 201 | + name: azure-cred |
| 202 | + {{- if eq .Values.linux.distro "fedora" }} |
| 203 | + - name: ssl |
| 204 | + mountPath: /etc/ssl/certs |
| 205 | + readOnly: true |
| 206 | + - name: ssl-pki |
| 207 | + mountPath: /etc/pki/ca-trust/extracted |
| 208 | + readOnly: true |
| 209 | + {{- end }} |
| 210 | + resources: {{- toYaml .Values.controller.resources.azurefile | nindent 12 }} |
| 211 | + volumes: |
| 212 | + - name: socket-dir |
| 213 | + emptyDir: {} |
| 214 | + - name: azcopy-dir |
| 215 | + emptyDir: {} |
| 216 | + - name: azure-cred |
| 217 | + hostPath: |
| 218 | + path: /etc/kubernetes/ |
| 219 | + type: DirectoryOrCreate |
| 220 | + {{- if eq .Values.linux.distro "fedora" }} |
| 221 | + - name: ssl |
| 222 | + hostPath: |
| 223 | + path: /etc/ssl/certs |
| 224 | + - name: ssl-pki |
| 225 | + hostPath: |
| 226 | + path: /etc/pki/ca-trust/extracted |
| 227 | + {{- end }} |
0 commit comments