-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsecrets-store-csi-driver.yaml
507 lines (507 loc) · 15.8 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
apiVersion: {{GetStorageAPIVersion}}
kind: CSIDriver
metadata:
name: secrets-store.csi.k8s.io
labels:
addonmanager.kubernetes.io/mode: Reconcile
spec:
podInfoOnMount: true
attachRequired: false
volumeLifecycleModes:
- Ephemeral
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: secrets-store-csi-driver
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: Reconcile
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: secretproviderclasses-role
labels:
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- secrets-store.csi.x-k8s.io
resources:
- secretproviderclasses
verbs:
- get
- list
- watch
- apiGroups:
- secrets-store.csi.x-k8s.io
resources:
- secretproviderclasspodstatuses
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- secrets-store.csi.x-k8s.io
resources:
- secretproviderclasspodstatuses/status
verbs:
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: secretproviderclasses-rolebinding
labels:
addonmanager.kubernetes.io/mode: Reconcile
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: secretproviderclasses-role
subjects:
- kind: ServiceAccount
name: secrets-store-csi-driver
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: secretprovidersyncing-role
labels:
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: secretprovidersyncing-rolebinding
labels:
addonmanager.kubernetes.io/mode: Reconcile
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: secretprovidersyncing-role
subjects:
- kind: ServiceAccount
name: secrets-store-csi-driver
namespace: kube-system
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
creationTimestamp: null
name: secretproviderclasses.secrets-store.csi.x-k8s.io
labels:
addonmanager.kubernetes.io/mode: Reconcile
spec:
group: secrets-store.csi.x-k8s.io
names:
kind: SecretProviderClass
listKind: SecretProviderClassList
plural: secretproviderclasses
singular: secretproviderclass
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: SecretProviderClass is the Schema for the secretproviderclasses API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: SecretProviderClassSpec defines the desired state of SecretProviderClass
properties:
parameters:
additionalProperties:
type: string
description: Configuration for specific provider
type: object
provider:
description: Configuration for provider name
type: string
secretObjects:
items:
description: SecretObject defines the desired state of synced K8s secret objects
properties:
data:
items:
description: SecretObjectData defines the desired state of synced K8s secret object data
properties:
key:
description: data field to populate
type: string
objectName:
description: name of the object to sync
type: string
type: object
type: array
labels:
additionalProperties:
type: string
description: labels of K8s secret object
type: object
secretName:
description: name of the K8s secret object
type: string
type:
description: type of K8s secret object
type: string
type: object
type: array
type: object
status:
description: SecretProviderClassStatus defines the observed state of SecretProviderClass
properties:
byPod:
items:
description: ByPodStatus defines the state of SecretProviderClass as seen by an individual controller
properties:
id:
description: id of the pod that wrote the status
type: string
namespace:
description: namespace of the pod that wrote the status
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
creationTimestamp: null
name: secretproviderclasspodstatuses.secrets-store.csi.x-k8s.io
labels:
addonmanager.kubernetes.io/mode: Reconcile
spec:
group: secrets-store.csi.x-k8s.io
names:
kind: SecretProviderClassPodStatus
listKind: SecretProviderClassPodStatusList
plural: secretproviderclasspodstatuses
singular: secretproviderclasspodstatus
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: SecretProviderClassPodStatus is the Schema for the secretproviderclassespodstatus API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
status:
description: SecretProviderClassPodStatusStatus defines the observed state of SecretProviderClassPodStatus
properties:
mounted:
type: boolean
objects:
items:
description: SecretProviderClassObject defines the object fetched from external secrets store
properties:
id:
type: string
version:
type: string
type: object
type: array
podName:
type: string
secretProviderClassName:
type: string
targetPath:
type: string
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
{{- /* A priority class for the daemonset such that they are not */}}
{{- /* frozen out of a node due to the node filling up with "normal" */}}
{{- /* pods before the daemonset controller can get the daemonset */}}
{{- /* pods to be scheduled. */}}
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: csi-secrets-store
labels:
addonmanager.kubernetes.io/mode: EnsureExists
value: 1000
globalDefault: false
description: "This is the daemonset priority class for csi-secrets-store"
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: csi-secrets-store
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: Reconcile
spec:
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 50%
selector:
matchLabels:
app: csi-secrets-store
template:
metadata:
labels:
app: csi-secrets-store
spec:
priorityClassName: csi-secrets-store
serviceAccountName: secrets-store-csi-driver
hostNetwork: true
containers:
- name: node-driver-registrar
image: {{ContainerImage "csi-node-driver-registrar"}}
args:
- --v=5
- --csi-address=/csi/csi.sock
- --kubelet-registration-path=/var/lib/kubelet/plugins/csi-secrets-store/csi.sock
env:
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
imagePullPolicy: IfNotPresent
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: registration-dir
mountPath: /registration
resources:
limits:
cpu: {{ContainerCPULimits "csi-node-driver-registrar"}}
memory: {{ContainerMemLimits "csi-node-driver-registrar"}}
requests:
cpu: {{ContainerCPUReqs "csi-node-driver-registrar"}}
memory: {{ContainerMemReqs "csi-node-driver-registrar"}}
- name: secrets-store
image: {{ContainerImage "secrets-store"}}
args:
- "--endpoint=$(CSI_ENDPOINT)"
- "--nodeid=$(KUBE_NODE_NAME)"
- "--provider-volume=/etc/kubernetes/secrets-store-csi-providers"
- "--grpc-supported-providers=azure"
- "--metrics-addr=:{{ContainerConfig "metricsPort"}}"
- "--enable-secret-rotation={{ContainerConfig "enableSecretRotation"}}"
- "--rotation-poll-interval={{ContainerConfig "rotationPollInterval"}}"
env:
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
ports:
- containerPort: 9808
name: healthz
protocol: TCP
livenessProbe:
failureThreshold: 5
httpGet:
path: /healthz
port: healthz
initialDelaySeconds: 30
timeoutSeconds: 10
periodSeconds: 15
volumeMounts:
- name: plugin-dir
mountPath: /csi
- name: mountpoint-dir
mountPath: /var/lib/kubelet/pods
mountPropagation: Bidirectional
- name: providers-dir
mountPath: /etc/kubernetes/secrets-store-csi-providers
{{- if IsCustomCloudProfile}}
- name: custom-environment
mountPath: /etc/kubernetes/azurestackcloud.json
readOnly: true
{{end}}
resources:
limits:
cpu: {{ContainerCPULimits "secrets-store"}}
memory: {{ContainerMemLimits "secrets-store"}}
requests:
cpu: {{ContainerCPUReqs "secrets-store"}}
memory: {{ContainerMemReqs "secrets-store"}}
- name: liveness-probe
image: {{ContainerImage "livenessprobe"}}
imagePullPolicy: IfNotPresent
args:
- --csi-address=/csi/csi.sock
- --probe-timeout=3s
- --http-endpoint=0.0.0.0:9808
- -v=2
volumeMounts:
- name: plugin-dir
mountPath: /csi
resources:
limits:
cpu: {{ContainerCPULimits "livenessprobe"}}
memory: {{ContainerMemLimits "livenessprobe"}}
requests:
cpu: {{ContainerCPUReqs "livenessprobe"}}
memory: {{ContainerMemReqs "livenessprobe"}}
volumes:
- name: mountpoint-dir
hostPath:
path: /var/lib/kubelet/pods
type: DirectoryOrCreate
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry/
type: Directory
- name: plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/csi-secrets-store/
type: DirectoryOrCreate
- name: providers-dir
hostPath:
path: /etc/kubernetes/secrets-store-csi-providers
type: DirectoryOrCreate
{{- if IsCustomCloudProfile}}
- name: custom-environment
hostPath:
path: /etc/kubernetes/azurestackcloud.json
type: FileOrCreate
{{end}}
nodeSelector:
kubernetes.io/os: linux
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-secrets-store-provider-azure
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: Reconcile
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: csi-secrets-store-provider-azure
namespace: kube-system
labels:
app: csi-secrets-store-provider-azure
addonmanager.kubernetes.io/mode: Reconcile
spec:
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 50%
selector:
matchLabels:
app: csi-secrets-store-provider-azure
template:
metadata:
labels:
app: csi-secrets-store-provider-azure
spec:
priorityClassName: csi-secrets-store
serviceAccountName: csi-secrets-store-provider-azure
hostNetwork: true
containers:
- name: provider-azure-installer
image: {{ContainerImage "provider-azure-installer"}}
imagePullPolicy: IfNotPresent
args:
- --endpoint=unix:///etc/kubernetes/secrets-store-csi-providers/azure.sock
lifecycle:
preStop:
exec:
command:
- "rm /etc/kubernetes/secrets-store-csi-providers/azure.sock"
volumeMounts:
- mountPath: "/etc/kubernetes/secrets-store-csi-providers"
name: providervol
- name: mountpoint-dir
mountPath: /var/lib/kubelet/pods
mountPropagation: HostToContainer
resources:
limits:
cpu: {{ContainerCPULimits "provider-azure-installer"}}
memory: {{ContainerMemLimits "provider-azure-installer"}}
requests:
cpu: {{ContainerCPUReqs "provider-azure-installer"}}
memory: {{ContainerMemReqs "provider-azure-installer"}}
volumes:
- name: providervol
hostPath:
path: "/etc/kubernetes/secrets-store-csi-providers"
- name: mountpoint-dir
hostPath:
path: /var/lib/kubelet/pods
nodeSelector:
kubernetes.io/os: linux