forked from jordancabral-zz/gke-mongo-backup
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cron.yaml
43 lines (43 loc) · 1.24 KB
/
cron.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
#####Sample
apiVersion: batch/v1
kind: CronJob
metadata:
name: mongo-backup
spec:
schedule: "0 0 * * *"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
volumes:
- name: gcp-bucket-sa
secret:
secretName: gcs-key
containers:
- name: mongo-backup
image: k4mrul/gke-mongo-backup
volumeMounts:
- name: gcp-bucket-sa
mountPath: /var/secrets/google
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/secrets/google/gcp_service_account.json
- name: MONGO_HOST
value: mongo-svc.default.svc.cluster.local
- name: MONGO_USERNAME
valueFrom:
secretKeyRef:
name: mongo-standalone-secrets
key: mongo-username
- name: MONGO_PASSWORD
valueFrom:
secretKeyRef:
name: mongo-standalone-secrets
key: mongo-password
- name: BUCKET_NAME
value: dokan-mongo-backup
- name: FOLDER_NAME
value: dev
restartPolicy: OnFailure