-
Notifications
You must be signed in to change notification settings - Fork 0
/
cronjob.yaml
44 lines (44 loc) · 1.22 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: postgres-backup
spec:
schedule: "0 2 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: postgres-backup
image: YOUR_DOCKER_IMAGE
env:
- name: POSTGRES_USER
value: your_postgres_user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: database-postgresql
key: postgresql-password
- name: POSTGRES_DATABASE
value: your_database
- name: POSTGRES_HOST
value: database-postgresql
- name: POSTGRES_PORT
value: "5432"
- name: BACKUP_GCS_BUCKET
value: YOUR_GCS_BUCKET
- name: GOOGLE_CLOUD_KEY
valueFrom:
secretKeyRef:
name: postgres-sa
key: key.json
resources:
limits:
memory: 256M
cpu: "250m"
requests:
memory: 100M
cpu: "10m"
restartPolicy: OnFailure
imagePullSecrets:
- name: pull-secret