-
Notifications
You must be signed in to change notification settings - Fork 2
/
4-3-master-statefulset.yml
94 lines (94 loc) · 2.45 KB
/
4-3-master-statefulset.yml
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
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: master
namespace: citus-cluster
spec:
selector:
matchLabels:
app: master
serviceName: master
template:
metadata:
labels:
app: master
spec:
volumes:
- name: donor-init
configMap:
name: init
- name: donor-config
configMap:
name: master
- name: init
emptyDir: {}
- name: config
emptyDir: {}
initContainers:
- name: init
image: alpine
volumeMounts:
- name: donor-init
mountPath: /from/init
- name: donor-config
mountPath: /from/config
- name: init
mountPath: /to/init
- name: config
mountPath: /to/config
command:
- sh
- -c
- cp -r /from/init/. /to/init ; cp -r /from/config/. /to/config
containers:
- name: master
image: watchdg/citus:9
imagePullPolicy: Always
volumeMounts:
- name: init
mountPath: /docker-entrypoint-initdb.d
- name: config
mountPath: /var/lib/postgresql/config
- name: data
mountPath: /var/lib/postgresql/data
args:
- --config_file=/var/lib/postgresql/config/postgresql.conf
ports:
- containerPort: 5432
env:
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: citus-cluster
key: password
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: citus-cluster
key: password
livenessProbe:
exec:
command:
- ./pg_healthcheck
initialDelaySeconds: 60
lifecycle:
postStart:
exec:
command:
- sh
- -c
- |
sleep 30 &&
psql -U postgres -c "alter extension citus update;" ; echo "end"
volumeClaimTemplates:
- metadata:
name: data
namespace: citus-cluster
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi