forked from Talend/vault-sidecar-injector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp-dep-2-secrets.yaml
49 lines (49 loc) · 1.42 KB
/
app-dep-2-secrets.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: app2
namespace: default
spec:
replicas: 1
selector:
matchLabels:
com.ovai.application: test2
com.ovai.service: test-app2-svc
template:
metadata:
annotations:
ovai.asaintsever.org/inject: "true"
ovai.asaintsever.org/secrets-destination: "secrets.properties,secrets2.properties"
ovai.asaintsever.org/secrets-template: |
{{ with secret "secret/test2/test-app2-svc" }}
{{ if .Data.SECRET1 }}
bob={{ .Data.SECRET1 }}
{{ end }}
{{ end }}
---
{{ with secret "secret/test2/test-app2-svc" }}
{{ if .Data.SECRET2 }}
alice={{ .Data.SECRET2 }}
joe={{ .Data.SECRET3 }}
{{ end }}
{{ end }}
labels:
com.ovai.application: test2
com.ovai.service: test-app2-svc
spec:
serviceAccountName: default
containers:
- name: app2-container-1
image: busybox:1.28
command:
- "sh"
- "-c"
- >
while true;do echo "My secrets are: $(cat /opt/ovai/secrets/secrets.properties)"; sleep 5; done
- name: app2-container-2
image: busybox:1.28
command:
- "sh"
- "-c"
- >
while true;do echo "My secrets 2 are: $(cat /opt/ovai/secrets/secrets2.properties)"; sleep 5; done