-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstandby-deployment.yaml
51 lines (51 loc) · 1.76 KB
/
standby-deployment.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: sit727-standby
spec:
replicas: 1
selector:
matchLabels:
app: sit727-standby
template:
metadata:
labels:
type: sit727-standby
app: sit727-standby
spec:
containers:
- image: postgres:10
imagePullPolicy: IfNotPresent
name: sit727-standby
ports:
- containerPort: 5432
envFrom:
- configMapRef:
name: sit727-config
volumeMounts:
- name: sit727-standby-mnt
mountPath: /var/lib/postgresql/data
subPath: sit727_standby/data
volumes:
- name: sit727-standby-mnt
persistentVolumeClaim:
# use nfs for dev and nfs-standby for prod
#claimName: nfs
claimName: nfs-standby
- name: sit727-standby-config-mnt
configMap:
name: sit727-standby-conf-files-config
initContainers:
- name: init-sit727-standby
image: timescale/timescaledb:latest-pg10
command: ['sh', '-c', 'cp /var/lib/postgresql/data/postgresql.main.conf /var/lib/postgresql/data/postgresql.conf && cp /var/lib/postgresql/data/recovery.main.conf /var/lib/postgresql/data/recovery.conf && chmod 600 /var/lib/postgresql/data/postgresql.conf && chmod 600 /var/lib/postgresql/data/recovery.conf']
volumeMounts:
- name: sit727-standby-mnt
mountPath: /var/lib/postgresql/data
subPath: sit727_standby/data
- name: sit727-standby-config-mnt
mountPath: /var/lib/postgresql/data/postgresql.main.conf
subPath: postgresql.conf
- name: sit727-standby-config-mnt
mountPath: /var/lib/postgresql/data/recovery.main.conf
subPath: recovery.conf