-
Notifications
You must be signed in to change notification settings - Fork 1
/
vault.yaml
106 lines (106 loc) · 2.59 KB
/
vault.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
apiVersion: v1
kind: Service
metadata:
name: vault
labels:
app: vault
spec:
clusterIP: None
ports:
- name: http
port: 8200
- name: server
port: 8201
selector:
app: vault
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: vault
labels:
app: vault
spec:
serviceName: "vault"
selector:
matchLabels:
app: vault
replicas: 1
template:
metadata:
labels:
app: vault
spec:
# affinity:
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: app
# operator: In
# values:
# - vault
# topologyKey: kubernetes.io/hostname
initContainers:
- name: config
image: busybox
env:
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
command: ["/bin/sh", "-c"]
args:
- |
cat > /etc/vault/config/vault.hcl <<EOF
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = "true"
}
storage "consul" {
address = "${NODE_IP}:8500"
scheme = "http"
path = "vault"
service_address = ""
}
ui = true
EOF
volumeMounts:
- name: vault-config
mountPath: /etc/vault/config
containers:
- name: vault-init
image: vault-init:latest
imagePullPolicy: IfNotPresent
- name: vault
image: vault
args:
- "server"
- "-config=/etc/vault/config/vault.hcl"
env:
- name: "VAULT_API_ADDR"
value: "http://0.0.0.0:8200"
ports:
- name: http
containerPort: 8200
protocol: "TCP"
- name: server
containerPort: 8201
protocol: "TCP"
securityContext:
capabilities:
add:
- IPC_LOCK
readinessProbe:
httpGet:
path: "/v1/sys/health?standbyok=true"
port: 8200
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
volumeMounts:
- name: vault-config
mountPath: /etc/vault/config
volumes:
- name: vault-config
emptyDir: {}