-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubernetes-postgres-backup-k8s.yml
41 lines (41 loc) · 1.25 KB
/
kubernetes-postgres-backup-k8s.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
# Use this in cronjobs
apiVersion: batch/v1
kind: CronJob
metadata:
name: postgresql-backup-k8s-job
spec:
# You can adjust anything here
schedule: "0 1 * * 0"
jobTemplate:
spec:
template:
spec:
containers:
- name: postgresql-backup-job-pod
image: your-registry.dev/itsecasia-soc/backup-postgres:latest
env:
- name: GCP_ACCESS_KEY
value: "ACCESS_KEY"
- name: GCP_SECRET_KEY
value: "SECRET_KEY"
- name: BUCKET_GCP
value: "path/to/bucket"
- name: PG_PASS
value: "YOUR_POSGRES_PASS"
- name: PG_USER
value: "POSGRES_USER"
- name: PG_HOST
value: "postgres.your-name-space.svc.cluster.local"
- name: PG_PORT
value: "5432"
- name: WEBHOOK_GOOGLE_CHAT
value: "WEBHOOKGOOGLESPACE"
imagePullPolicy: Always
args:
- /bin/bash
- -c
- bash /root/postgres-backup.sh;
restartPolicy: OnFailure
imagePullSecrets:
- name: ibregcred
backoffLimit: 3