-
Notifications
You must be signed in to change notification settings - Fork 16
/
workers.yaml
73 lines (73 loc) · 1.66 KB
/
workers.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
apiVersion: v1
kind: Service
metadata:
name: citus-workers
labels:
app: citus-workers
spec:
selector:
app: citus-workers
clusterIP: None
ports:
- port: 5432
---
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
name: citus-worker
spec:
selector:
matchLabels:
app: citus-workers
serviceName: citus-workers
replicas: 3
template:
metadata:
labels:
app: citus-workers
spec:
containers:
- name: citus-worker
image: citusdata/citus:7.3.0
lifecycle:
postStart:
exec:
command:
- /bin/sh
- -c
- if [ ${POD_IP} ]; then psql --host=citus-master --username=postgres --command="SELECT * from master_add_node('${HOSTNAME}.citus-workers', 5432);" ; fi
ports:
- containerPort: 5432
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: citus-secrets
key: password
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: citus-secrets
key: password
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
- name: storage
mountPath: /var/lib/postgresql/data
livenessProbe:
exec:
command:
- ./pg_healthcheck
initialDelaySeconds: 60
volumeClaimTemplates:
- metadata:
name: storage
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 50Gi