-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcronjob_template.yaml
48 lines (48 loc) · 1.5 KB
/
cronjob_template.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
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: postgres-bkup
spec:
schedule: "0 2 * * *"
concurrencyPolicy: "Replace"
jobTemplate:
spec:
template:
spec:
containers:
- name: backup
image: jmwhorton/postgres-bkup:0.1.30
imagePullPolicy: IfNotPresent
env:
- name: DATABASE_NAME
value: <postgres db name>
- name: DATABASE_USER
value: <postgres db root user, ex. postgres>
- name: DATABASE_HOST
value: <postgres hostname, ex. database>
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: <existing secret file with postgres info>
key: <postgres root password key>
- name: STORAGE_USER
valueFrom:
secretKeyRef:
name: bkup-secret
key: storage_user
- name: STORAGE_PASSWORD
valueFrom:
secretKeyRef:
name: bkup-secret
key: storage_password
- name: STORAGE_HOST
valueFrom:
secretKeyRef:
name: bkup-secret
key: storage_host
- name: STORAGE_PATH
valueFrom:
secretKeyRef:
name: bkup-secret
key: storage_path
restartPolicy: OnFailure