|
|
@@ -0,0 +1,32 @@
|
|
|
+apiVersion: batch/v1
|
|
|
+kind: CronJob
|
|
|
+metadata:
|
|
|
+ name: backup
|
|
|
+spec:
|
|
|
+ schedule: "30 3 * * 1,3,5"
|
|
|
+ jobTemplate:
|
|
|
+ spec:
|
|
|
+ template:
|
|
|
+ spec:
|
|
|
+ containers:
|
|
|
+ - args: ["backup", "--repo", "/data/repo", "--insecure-no-password", "/data/glusterfs"]
|
|
|
+ image: restic/restic:0.17.2
|
|
|
+ imagePullPolicy: IfNotPresent
|
|
|
+ name: restic
|
|
|
+ volumeMounts:
|
|
|
+ - name: restic-repo-vol
|
|
|
+ mountPath: /data/repo
|
|
|
+ - name: backup-data-vol
|
|
|
+ mountPath: /data/glusterfs
|
|
|
+ volumes:
|
|
|
+ - name: restic-repo-vol
|
|
|
+ hostPath:
|
|
|
+ path: /data/backup
|
|
|
+ type: Directory
|
|
|
+ - name: backup-data-vol
|
|
|
+ hostPath:
|
|
|
+ path: /mnt
|
|
|
+ type: Directory
|
|
|
+ restartPolicy: Never
|
|
|
+ nodeSelector:
|
|
|
+ kubernetes.io/hostname: raspberrypi4
|