Add a sample backup cronjob

This commit is contained in:
Nico Schottelius 2022-05-25 23:27:33 +02:00
parent 027ec6ceeb
commit fc7707aff2
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name:
backup-test
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: backup
image: instrumentisto/rsync-ssh:alpine3.16
args:
- sh
- -c
- "rsync -a /etc/ /mnt/etc-dir/$(date +%a%H%M)"
volumeMounts:
- mountPath: /mnt
name: backup
restartPolicy: Never
nodeSelector:
kubernetes.io/hostname: "server101"
volumes:
- name: backup
hostPath:
path: /mnt
type: Directory