KubeZero/charts/kubezero-addons/templates/cluster-backup/cronjob.yaml

64 lines
1.8 KiB
YAML
Raw Normal View History

2021-12-01 12:35:18 +00:00
{{- if .Values.clusterBackup.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: kubezero-backup
namespace: kube-system
spec:
schedule: "0 * * * *"
2022-11-09 16:08:22 +00:00
concurrencyPolicy: "Replace"
2021-12-01 12:35:18 +00:00
jobTemplate:
spec:
backoffLimit: 1
2022-04-08 15:10:17 +00:00
activeDeadlineSeconds: 300
2021-12-21 15:05:08 +00:00
ttlSecondsAfterFinished: 3600
2021-12-01 12:35:18 +00:00
template:
spec:
containers:
- name: kubezero-admin
image: "{{ .Values.clusterBackup.image.name }}:{{ default .Chart.AppVersion .Values.clusterBackup.image.tag }}"
2021-12-01 12:35:18 +00:00
imagePullPolicy: Always
command: ["kubezero.sh"]
args:
- backup
volumeMounts:
- name: host
mountPath: /host
- name: workdir
mountPath: /tmp
env:
- name: DEBUG
2022-08-24 15:13:39 +00:00
value: ""
2021-12-01 12:35:18 +00:00
- name: RESTIC_REPOSITORY
valueFrom:
secretKeyRef:
name: kubezero-backup-restic
key: repository
- name: RESTIC_PASSWORD
valueFrom:
secretKeyRef:
name: kubezero-backup-restic
key: password
2021-12-03 21:16:22 +00:00
{{- with .Values.clusterBackup.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
2021-12-01 12:35:18 +00:00
#securityContext:
# readOnlyRootFilesystem: true
hostNetwork: true
volumes:
- name: host
hostPath:
path: /
type: Directory
- name: workdir
emptyDir: {}
nodeSelector:
node-role.kubernetes.io/control-plane: ""
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
2022-10-27 12:27:42 +00:00
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
2021-12-01 12:35:18 +00:00
restartPolicy: Never
{{- end }}