blob: 0ee52ca2664fb8c5e037fb228f457ae9e2aa2fda [file] [log] [blame]
Giorgi Lekveishvilib38f7362023-06-05 13:36:02 +04001---
2kind: Deployment
3apiVersion: apps/v1
4metadata:
5 name: {{ .Values.controller.name }}
6 namespace: {{ .Release.Namespace }}
7{{ include "smb.labels" . | indent 2 }}
8spec:
9 replicas: {{ .Values.controller.replicas }}
10 selector:
11 matchLabels:
12 app: {{ .Values.controller.name }}
13 template:
14 metadata:
15{{ include "smb.labels" . | indent 6 }}
16 app: {{ .Values.controller.name }}
17 {{- if .Values.podLabels }}
18{{- toYaml .Values.podLabels | nindent 8 }}
19 {{- end }}
20{{- if .Values.podAnnotations }}
21 annotations:
22{{ toYaml .Values.podAnnotations | indent 8 }}
23{{- end }}
24 spec:
25{{- with .Values.controller.affinity }}
26 affinity:
27{{ toYaml . | indent 8 }}
28{{- end }}
29 hostNetwork: true
30 dnsPolicy: {{ .Values.controller.dnsPolicy }}
31 serviceAccountName: {{ .Values.serviceAccount.controller }}
32 nodeSelector:
33{{- with .Values.controller.nodeSelector }}
34{{ toYaml . | indent 8 }}
35{{- end }}
36 kubernetes.io/os: linux
37 {{- if .Values.controller.runOnMaster}}
38 node-role.kubernetes.io/master: ""
39 {{- end}}
40 {{- if .Values.controller.runOnControlPlane}}
41 node-role.kubernetes.io/control-plane: ""
42 {{- end}}
43 priorityClassName: {{ .Values.priorityClassName | quote }}
44 {{- if .Values.securityContext }}
45 securityContext: {{- toYaml .Values.securityContext | nindent 8 }}
46 {{- end }}
47{{- with .Values.controller.tolerations }}
48 tolerations:
49{{ toYaml . | indent 8 }}
50{{- end }}
51 {{- include "smb.pullSecrets" . | indent 6 }}
52 containers:
53 - name: csi-provisioner
54{{- if hasPrefix "/" .Values.image.csiProvisioner.repository }}
55 image: "{{ .Values.image.baseRepo }}{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}"
56{{- else }}
57 image: "{{ .Values.image.csiProvisioner.repository }}:{{ .Values.image.csiProvisioner.tag }}"
58{{- end }}
59 args:
60 - "-v=2"
61 - "--csi-address=$(ADDRESS)"
62 - "--leader-election"
63 - "--leader-election-namespace={{ .Release.Namespace }}"
64 - "--extra-create-metadata=true"
65 env:
66 - name: ADDRESS
67 value: /csi/csi.sock
68 imagePullPolicy: {{ .Values.image.csiProvisioner.pullPolicy }}
69 volumeMounts:
70 - mountPath: /csi
71 name: socket-dir
72 resources: {{- toYaml .Values.controller.resources.csiProvisioner | nindent 12 }}
73 securityContext:
74 readOnlyRootFilesystem: true
75 - name: liveness-probe
76{{- if hasPrefix "/" .Values.image.livenessProbe.repository }}
77 image: "{{ .Values.image.baseRepo }}{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
78{{- else }}
79 image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
80{{- end }}
81 args:
82 - --csi-address=/csi/csi.sock
83 - --probe-timeout=3s
84 - --health-port={{ .Values.controller.livenessProbe.healthPort }}
85 - --v=2
86 imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }}
87 volumeMounts:
88 - name: socket-dir
89 mountPath: /csi
90 resources: {{- toYaml .Values.controller.resources.livenessProbe | nindent 12 }}
91 securityContext:
92 readOnlyRootFilesystem: true
93 - name: smb
94{{- if hasPrefix "/" .Values.image.smb.repository }}
95 image: "{{ .Values.image.baseRepo }}{{ .Values.image.smb.repository }}:{{ .Values.image.smb.tag }}"
96{{- else }}
97 image: "{{ .Values.image.smb.repository }}:{{ .Values.image.smb.tag }}"
98{{- end }}
99 imagePullPolicy: {{ .Values.image.smb.pullPolicy }}
100 args:
101 - "--v={{ .Values.controller.logLevel }}"
102 - "--endpoint=$(CSI_ENDPOINT)"
103 - "--metrics-address=0.0.0.0:{{ .Values.controller.metricsPort }}"
104 - "--drivername={{ .Values.driver.name }}"
105 - "--working-mount-dir={{ .Values.controller.workingMountDir }}"
106 ports:
107 - containerPort: {{ .Values.controller.livenessProbe.healthPort }}
108 name: healthz
109 protocol: TCP
110 - containerPort: {{ .Values.controller.metricsPort }}
111 name: metrics
112 protocol: TCP
113 livenessProbe:
114 failureThreshold: 5
115 httpGet:
116 path: /healthz
117 port: healthz
118 initialDelaySeconds: 30
119 timeoutSeconds: 10
120 periodSeconds: 30
121 env:
122 - name: CSI_ENDPOINT
123 value: unix:///csi/csi.sock
124 securityContext:
125 privileged: true
126 readOnlyRootFilesystem: true
127 volumeMounts:
128 - mountPath: /csi
129 name: socket-dir
130 - mountPath: {{ .Values.controller.workingMountDir }}
131 name: tmp-dir
132 resources: {{- toYaml .Values.controller.resources.smb | nindent 12 }}
133 volumes:
134 - name: socket-dir
135 emptyDir: {}
136 - name: tmp-dir
137 emptyDir: {}