forked from bank-vaults/bank-vaults
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-deploy-va.yaml
57 lines (55 loc) · 1.37 KB
/
test-deploy-va.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: vault-agent-pki
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: vault-agent-pki
template:
metadata:
labels:
app.kubernetes.io/name: vault-agent-pki
annotations:
vault.security.banzaicloud.io/vault-addr: "https://vault:8200"
vault.security.banzaicloud.io/vault-tls-secret: vault-tls
vault.security.banzaicloud.io/vault-agent-configmap: vault-agent-pki
spec:
containers:
- name: alpine
image: alpine
command: ["sh", "-c", "apk add openssl; while true; do openssl x509 -text -noout -in /vault/secrets/my-server.crt; echo; sleep 5; done"]
resources:
limits:
memory: "128Mi"
cpu: "100m"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: vault-agent-pki
labels:
app.kubernetes.io/name: vault-agent-pki
data:
config.hcl: |
auto_auth {
method "kubernetes" {
mount_path = "auth/kubernetes"
config = {
role = "default"
}
}
sink "file" {
config = {
path = "/vault/.vault-token"
}
}
}
template {
contents = <<EOH
{{- with secret "pki/issue/default" "common_name=localhost" -}}
{{ .Data.certificate }}{{- end -}}
EOH
destination = "/vault/secrets/my-server.crt"
}