backup.cronjob.yaml 913 B

1234567891011121314151617181920212223242526272829303132
  1. apiVersion: batch/v1
  2. kind: CronJob
  3. metadata:
  4. name: backup
  5. spec:
  6. schedule: "30 3 * * 1,3,5"
  7. jobTemplate:
  8. spec:
  9. template:
  10. spec:
  11. containers:
  12. - args: ["backup", "--repo", "/data/repo", "--insecure-no-password", "/data/glusterfs"]
  13. image: restic/restic:0.17.2
  14. imagePullPolicy: IfNotPresent
  15. name: restic
  16. volumeMounts:
  17. - name: restic-repo-vol
  18. mountPath: /data/repo
  19. - name: backup-data-vol
  20. mountPath: /data/glusterfs
  21. volumes:
  22. - name: restic-repo-vol
  23. hostPath:
  24. path: /data/backup
  25. type: Directory
  26. - name: backup-data-vol
  27. hostPath:
  28. path: /mnt
  29. type: Directory
  30. restartPolicy: Never
  31. nodeSelector:
  32. kubernetes.io/hostname: raspberrypi4