-
Notifications
You must be signed in to change notification settings - Fork 1
/
postgres_manual_restore.yaml
99 lines (99 loc) · 2.78 KB
/
postgres_manual_restore.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
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: postgres
name: postgres
spec:
serviceName: postgres
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- image: postgres:12-alpine
name: backup-restore-sidecar
command:
- tail
- -f
- /etc/os-release
env:
- name: BACKUP_RESTORE_SIDECAR_GCP_PROJECT
valueFrom:
secretKeyRef:
key: projectID
name: backup-restore-sidecar-backup-provider-config
- name: BACKUP_RESTORE_SIDECAR_GCP_BUCKET_NAME
valueFrom:
secretKeyRef:
key: bucketName
name: backup-restore-sidecar-backup-provider-config
- name: BACKUP_RESTORE_SIDECAR_GCP_BUCKET_LOCATION
valueFrom:
secretKeyRef:
key: bucketLocation
name: backup-restore-sidecar-backup-provider-config
- name: BACKUP_RESTORE_SIDECAR_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
key: POSTGRES_PASSWORD
name: postgres
- name: BACKUP_RESTORE_SIDECAR_POSTGRES_USER
valueFrom:
secretKeyRef:
key: POSTGRES_USER
name: postgres
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /gcp/credentials/serviceaccount.json
volumeMounts:
- name: postgres
mountPath: /data
- name: bin-provision
subPath: backup-restore-sidecar
mountPath: /usr/local/bin/backup-restore-sidecar
- name: backup-restore-sidecar-config
mountPath: /etc/backup-restore-sidecar
- name: gcp-credentials
mountPath: /gcp/credentials
readOnly: true
initContainers:
- name: backup-restore-sidecar-provider
image: ghcr.io/metal-stack/backup-restore-sidecar:latest
imagePullPolicy: IfNotPresent
command:
- cp
- /backup-restore-sidecar
- /bin-provision
volumeMounts:
- name: bin-provision
mountPath: /bin-provision
volumes:
- name: postgres
persistentVolumeClaim:
claimName: postgres
- name: backup-restore-sidecar-config
configMap:
name: backup-restore-sidecar-config-postgres
- name: gcp-credentials
secret:
secretName: backup-restore-sidecar-backup-provider-config
items:
- key: serviceaccount.json
path: serviceaccount.json
- name: bin-provision
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: postgres
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi