forked from dennyzhang/challenges-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 2
/
cronjob.yaml
35 lines (35 loc) · 1.03 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
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: my-wordpress-mariadb-backup
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: my-wordpress-mariadb-backup
image: mysql
command: ["bash", "-ex",
"/git-code/challenges-kubernetes/Scenario-302/backup_db.sh"]
volumeMounts:
- mountPath: /backup
name: backup
- mountPath: /git-code
name: git-volume
- mountPath: "/etc/credential"
name: db-secret
readOnly: true
volumes:
- name: backup
persistentVolumeClaim:
claimName: mariadb-backup
- name: git-volume
gitRepo:
repository: "https://github.com/DennyZhang/challenges-kubernetes.git"
- name: db-secret
secret:
secretName: db-user-pass