-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
csi-workspace.yaml
61 lines (61 loc) · 1.23 KB
/
csi-workspace.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
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: vault-database
spec:
provider: vault
secretObjects:
- data:
- key: password
objectName: db-password
secretName: dbpass
type: Opaque
parameters:
vaultAddress: "http://vault.default:8200"
roleName: "database"
objects: |
- objectName: "db-password"
secretPath: "secret/data/db-pass"
secretKey: "password"
---
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: csi-task
spec:
workspaces:
- name: secret-password
steps:
- name: fetch-csi
image: mirror.gcr.io/ubuntu
script: cat $(workspaces.secret-password.path)/db-password
---
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: csi-pipeline
spec:
workspaces:
- name: secret-vault
tasks:
- name: fetch-csi
taskRef:
name: csi-task
workspaces:
- name: secret-password
workspace: secret-vault
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: csi-credential-
spec:
pipelineRef:
name: csi-pipeline
workspaces:
- name: secret-vault
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "vault-database"