forked from rinormaloku/postgre-backup-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pg-backup-cronJob.yaml
32 lines (32 loc) · 914 Bytes
/
pg-backup-cronJob.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
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: batch-every-twelve-hours
spec:
schedule: "0 */12 * * *"
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: pgsql-backup
image: rinormaloku/postgres-back-up
env:
- name: PGHOST
value: "PGHOST_PLACEHOLDER"
- name: PGPORT
value: "PGPORT_PLACEHOLDER"
- name: PGDATABASE
value: "PGDATABASE_PLACEHOLDER"
- name: PGUSER
value: "PGUSER_PLACEHOLDER"
- name: PGPASSWORD
value: "PGPASSWORD_PLACEHOLDER"
volumeMounts:
- mountPath: "/pg_backup"
name: backup-volume
volumes:
- name: backup-volume
persistentVolumeClaim:
claimName: pg-backup-pvc