-
Notifications
You must be signed in to change notification settings - Fork 5
/
deployment.yaml
42 lines (42 loc) · 1.5 KB
/
deployment.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
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "true" # isset as the autoscaler will stop downscaling on pods with local volumes
labels:
app: test-app
name: test-app
namespace: default
spec:
selector:
matchLabels:
app: test-app
template:
metadata:
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "true" # isset as the autoscaler will stop downscaling on pods with local volumes
labels:
app: test-app
spec:
containers:
- image: mytestapp
name: test-app
volumeMounts:
- mountPath: /secrets # mount our volume with secrets
name: secrets
initContainers: # the fun part
- name: secret-dumper
args: # inline json is the easiest when running as init
- '{"format":"env","output":"/secrets","prefix":"PREFIX_","secrets":["secret/data/secret/dev",{"secret/data/foo":{"keys":["APIKEY"]}}]}'
env:
- name: VAULT_ADDR # which vault server it should connect to
value: https://vault.example.com
- name: CLUSTER_NAME # the kubernetes auth method
value: testcluster
image: europe-docker.pkg.dev/artifacts-pub-prod-b57f/public-docker/harpocrates
volumeMounts: # mount the volume to export secrets
- mountPath: /secrets
name: secrets
volumes: # volume spec
- name: secrets
emptyDir: {}