-
Notifications
You must be signed in to change notification settings - Fork 277
/
secrets-store-csi-driver.yaml
204 lines (204 loc) · 7.78 KB
/
secrets-store-csi-driver.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
{{- if .Values.linux.enabled }}
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: {{ template "sscd.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "sscd.labels" . | indent 4 }}
{{- if .Values.linux.daemonsetAnnotations }}
annotations:
{{ toYaml .Values.linux.daemonsetAnnotations | indent 4 }}
{{- end }}
spec:
selector:
matchLabels:
app: {{ template "sscd.name" . }}
updateStrategy:
{{ toYaml .Values.linux.updateStrategy | indent 4 }}
template:
metadata:
labels:
{{ include "sscd.labels" . | indent 8 }}
{{- if .Values.linux.podLabels }}
{{- toYaml .Values.linux.podLabels | nindent 8 }}
{{- end }}
annotations:
kubectl.kubernetes.io/default-container: secrets-store
{{- if .Values.linux.podAnnotations }}
{{ toYaml .Values.linux.podAnnotations | indent 8 }}
{{- end }}
spec:
serviceAccountName: secrets-store-csi-driver
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
affinity:
{{ toYaml .Values.linux.affinity | indent 8 }}
containers:
- name: node-driver-registrar
image: "{{ .Values.linux.registrarImage.repository }}:{{ .Values.linux.registrarImage.tag }}"
args:
- --v={{ .Values.linux.registrar.logVerbosity }}
- --csi-address=/csi/csi.sock
- --kubelet-registration-path={{ .Values.linux.kubeletRootDir }}/plugins/csi-secrets-store/csi.sock
livenessProbe:
exec:
command:
- /csi-node-driver-registrar
- --kubelet-registration-path={{ .Values.linux.kubeletRootDir }}/plugins/csi-secrets-store/csi.sock
- --mode=kubelet-registration-probe
initialDelaySeconds: 30
timeoutSeconds: 15
imagePullPolicy: {{ .Values.linux.registrarImage.pullPolicy }}
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
{{- with .Values.linux.registrar.resources }}
resources:
{{ toYaml . | indent 12 }}
{{- end }}
- name: secrets-store
image: "{{ .Values.linux.image.repository }}:{{ .Values.linux.image.tag }}"
args:
{{- if .Values.logVerbosity }}
- -v={{ .Values.logVerbosity }}
{{- end }}
{{- if .Values.logFormatJSON }}
- --log-format-json={{ .Values.logFormatJSON }}
{{- end }}
- "--endpoint=$(CSI_ENDPOINT)"
- "--nodeid=$(KUBE_NODE_NAME)"
- "--provider-volume={{ .Values.linux.providersDir }}"
- "--additional-provider-volume-paths={{ join "," .Values.linux.additionalProvidersDirs }}"
{{- if and (semverCompare ">= v0.0.15-0" .Values.linux.image.tag) .Values.enableSecretRotation }}
- "--enable-secret-rotation={{ .Values.enableSecretRotation }}"
{{- end }}
{{- if and (semverCompare ">= v0.0.15-0" .Values.linux.image.tag) .Values.rotationPollInterval }}
- "--rotation-poll-interval={{ .Values.rotationPollInterval }}"
{{- end }}
- "--metrics-addr={{ .Values.linux.metricsAddr }}"
{{- if and (semverCompare ">= v0.0.22-0" .Values.linux.image.tag) .Values.providerHealthCheck }}
- "--provider-health-check={{ .Values.providerHealthCheck }}"
{{- end }}
{{- if and (semverCompare ">= v0.0.22-0" .Values.linux.image.tag) .Values.providerHealthCheckInterval }}
- "--provider-health-check-interval={{ .Values.providerHealthCheckInterval }}"
{{- end }}
{{- if .Values.maxCallRecvMsgSize }}
- "--max-call-recv-msg-size={{ .Values.maxCallRecvMsgSize | int64 }}"
{{- end }}
env:
{{- with .Values.linux.env }}
{{- toYaml . | nindent 10 }}
{{- end }}
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
imagePullPolicy: {{ .Values.linux.image.pullPolicy }}
securityContext:
privileged: true
{{- if semverCompare ">= v0.0.8-0" .Values.linux.image.tag }}
ports:
- containerPort: {{ .Values.livenessProbe.port }}
name: healthz
protocol: TCP
- containerPort: {{ trimPrefix ":" .Values.linux.metricsAddr }}
name: metrics
protocol: TCP
livenessProbe:
failureThreshold: 5
httpGet:
path: /healthz
port: healthz
initialDelaySeconds: 30
timeoutSeconds: 10
periodSeconds: 15
{{- end }}
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: mountpoint-dir
mountPath: {{ .Values.linux.kubeletRootDir }}/pods
mountPropagation: Bidirectional
{{- $providersDir := .Values.linux.providersDir }}
- name: providers-dir
mountPath: {{ $providersDir }}
{{- range $i, $path := .Values.linux.additionalProvidersDirs }}
{{- if ne $path $providersDir }}
- name: providers-dir-{{ $i }}
mountPath: "{{ $path }}"
{{- end }}
{{- end }}
{{- if .Values.linux.volumeMounts }}
{{- toYaml .Values.linux.volumeMounts | nindent 12 }}
{{- end }}
{{- with .Values.linux.driver.resources }}
resources:
{{ toYaml . | indent 12 }}
{{- end }}
{{- if semverCompare ">= v0.0.8-0" .Values.linux.image.tag }}
- name: liveness-probe
image: "{{ .Values.linux.livenessProbeImage.repository }}:{{ .Values.linux.livenessProbeImage.tag }}"
imagePullPolicy: {{ .Values.linux.livenessProbeImage.pullPolicy }}
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --http-endpoint=0.0.0.0:{{ .Values.livenessProbe.port }}
- -v={{ .Values.livenessProbe.logLevel }}
volumeMounts:
- name: plugin-dir
mountPath: /csi
{{- with .Values.linux.livenessProbe.resources }}
resources:
{{ toYaml . | indent 12 }}
{{- end }}
{{- end }}
{{- if .Values.linux.priorityClassName }}
priorityClassName: {{ .Values.linux.priorityClassName | quote }}
{{- end }}
volumes:
- name: mountpoint-dir
hostPath:
path: {{ .Values.linux.kubeletRootDir }}/pods
type: DirectoryOrCreate
- name: registration-dir
hostPath:
path: {{ .Values.linux.kubeletRootDir }}/plugins_registry/
type: Directory
- name: plugin-dir
hostPath:
path: {{ .Values.linux.kubeletRootDir }}/plugins/csi-secrets-store/
type: DirectoryOrCreate
{{- $providersDir := .Values.linux.providersDir }}
- name: providers-dir
hostPath:
path: {{ $providersDir }}
type: DirectoryOrCreate
{{- range $i, $path := .Values.linux.additionalProvidersDirs }}
{{- if ne $path $providersDir }}
- name: providers-dir-{{ $i }}
hostPath:
path: "{{ $path }}"
type: DirectoryOrCreate
{{- end }}
{{- end }}
{{- if .Values.linux.volumes }}
{{- toYaml .Values.linux.volumes | nindent 8 }}
{{- end }}
nodeSelector:
kubernetes.io/os: linux
{{- if .Values.linux.nodeSelector }}
{{- toYaml .Values.linux.nodeSelector | nindent 8 }}
{{- end }}
{{- with .Values.linux.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end -}}