This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
cronjob.yaml
52 lines (52 loc) · 1.88 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
45
46
47
48
49
50
51
52
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: backup-to-bucket
spec:
concurrencyPolicy: Forbid
schedule: '0 */6 * * *' # This job will run every 6 hours. You can also use " schedule: '* * * * *' " to run this cron job instantly
jobTemplate:
spec:
backoffLimit: 0
template:
spec:
volumes:
- name: koku-metrics-operator-data
persistentVolumeClaim:
claimName: koku-metrics-operator-data
- name: backup-scripts
configMap:
name: backup-scripts
containers:
- name: s3sync
image: quay.io/operate-first/curator-s3-sync:latest
envFrom:
- secretRef:
name: backup-credentials
- configMapRef:
name: backup-config
command:
- python3
- /scripts/unzip_backup.py
volumeMounts:
- name: backup-scripts
mountPath: /scripts
- name: koku-metrics-operator-data
mountPath: /tmp/koku-metrics-operator-data #koku meterics operator storage path
- name: mc
image: docker.io/minio/mc
envFrom:
- secretRef:
name: backup-credentials
- configMapRef:
name: backup-config
command:
- sh
args:
['-c', '[ "$HAS_S3_ACCESS" ] || exit 1; if [[ $HAS_S3_ACCESS == true ]]; then sh ./scripts/run-backup.sh; else echo no S3 bucket provided; exit 0; fi;']
volumeMounts:
- name: backup-scripts
mountPath: /scripts
- name: koku-metrics-operator-data
mountPath: /tmp/koku-metrics-operator-data
restartPolicy: Never