forked from BackupTools/postgres-backup-s3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkubernetes-cronjob.yml
32 lines (32 loc) · 923 Bytes
/
kubernetes-cronjob.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
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: my-postgres-backup
spec:
schedule: "5 */8 * * *"
concurrencyPolicy: Replace
startingDeadlineSeconds: 200
successfulJobsHistoryLimit: 2
failedJobsHistoryLimit: 10
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: postgres-backup-my-app
image: backuptools/postgres-backup-s3
env:
- name: PG_URI
value: postgres://db-svc-or-hostname:27017/dbname
# Available: pigz, xz, bzip2, lrzip, brotli, zstd
- name: COMPRESS
value: pigz
- name: S3_URI
value: https://your-key:your-secret@s3.host.tld
- name: S3_NAME
value: folder-name/backup-name
- name: S3_BUCK
value: backup-s3-bucket-name
---