K3s-cluster/gitlab/cronjob.yaml

26 lines
821 B
YAML
Raw Normal View History

apiVersion: batch/v1
kind: CronJob
metadata:
name: backup-job
namespace: gitlab
spec:
schedule: "0 4 * * *" # Every day at 4AM
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- name: maria-backup
image: mariadb
command: ["sh", "-c", "echo hi"]
volumeMounts:
- name: gitlab-backup
mountPath: /backup/gitlab
subPath: gitlab
volumes:
- name: gitlab-backup
persistentVolumeClaim:
claimName: gitlab-backup-pvc
restartPolicy: OnFailure