-
Notifications
You must be signed in to change notification settings - Fork 0
/
vault_statefulset.yaml
58 lines (58 loc) · 1.57 KB
/
vault_statefulset.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
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: vault
namespace: vault-consul
labels:
app: vault
spec:
serviceName: vault
replicas: 2
template:
metadata:
labels:
app: vault
spec:
terminationGracePeriodSeconds: 10
securityContext:
fsGroup: 1000
containers:
- name: vault
command: ["vault", "server", "-config", "/vault/config/vault.hcl"]
image: "vault:0.10.3"
imagePullPolicy: IfNotPresent
securityContext:
capabilities:
add:
- IPC_LOCK
volumeMounts:
- name: configurations
mountPath: /vault/config/vault.hcl
subPath: vault.hcl
- name: consul-vault-agent
image: "consul:1.2.0"
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
args:
- "agent"
- "-retry-join=consul-0.consul.$(NAMESPACE).svc.cluster.local"
- "-retry-join=consul-1.consul.$(NAMESPACE).svc.cluster.local"
- "-retry-join=consul-2.consul.$(NAMESPACE).svc.cluster.local"
- "-retry-join=consul-3.consul.$(NAMESPACE).svc.cluster.local"
- "-domain=cluster.local"
- "-datacenter=cv1"
- "-disable-host-node-id"
lifecycle:
preStop:
exec:
command:
- /bin/sh
- -c
- consul leave
volumes:
- name: configurations
configMap:
name: vault