Browse Source

Emailleg backup to use snapshots and FS backup

master
Fábio Kaiser Rauber 2 years ago
parent
commit
86d6cde826
  1. 22
      charts/emailleg/v1.4.0/templates/velero-schedule-monthly.yaml
  2. 22
      charts/emailleg/v1.4.0/templates/velero-schedule-weekdays.yaml
  3. 12
      charts/emailleg/v1.4.0/templates/velero-schedule-weekly.yaml
  4. 2
      charts/emailleg/v1.4.0/values.yaml

22
charts/emailleg/v1.4.0/templates/velero-schedule-monthly.yaml

@ -0,0 +1,22 @@
{{- if .Values.velero.backup.enabled }}
apiVersion: velero.io/v1
kind: Schedule
metadata:
name: {{ include "emailleg.fullname" . }}-monthly
namespace: {{ .Values.velero.namespace }}
spec:
# generate a random backup time between 1 and 5 AM on first day of every month
schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} 1 * *
template:
includedNamespaces:
- {{ .Release.Namespace }}
{{- with .Values.velero.backup.excludedResources }}
excludedResources:
{{- toYaml . | nindent 8 }}
{{- end }}
snapshotVolumes: false
# every monthly backup is good for 6 months (~180 days)
ttl: 4380h0m0s
defaultVolumesToFsBackup: true
useOwnerReferencesInBackup: false
{{- end }}

22
charts/emailleg/v1.4.0/templates/velero-schedule-weekdays.yaml

@ -0,0 +1,22 @@
{{- if .Values.velero.backup.enabled }}
apiVersion: velero.io/v1
kind: Schedule
metadata:
name: {{ include "emailleg.fullname" . }}-weekdays
namespace: {{ .Values.velero.namespace }}
spec:
# generate a random backup time between 1 and 5 AM on weekdays
schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 1-5
template:
includedNamespaces:
- {{ .Release.Namespace }}
{{- with .Values.velero.backup.excludedResources }}
excludedResources:
{{- toYaml . | nindent 8 }}
{{- end }}
snapshotVolumes: true
# every backup is good for 7 days (one week)
ttl: 168h0m0s
defaultVolumesToFsBackup: false
useOwnerReferencesInBackup: false
{{- end }}

12
charts/emailleg/v1.4.0/templates/velero-schedule-weekly.yaml

@ -5,8 +5,8 @@ metadata:
name: {{ include "emailleg.fullname" . }}-weekly
namespace: {{ .Values.velero.namespace }}
spec:
# generate a random backup time between 1 and 5 AM on Monday, Wednesday and Friday
schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * MON,WED,FRI
# generate a random backup time between 1 and 5 AM on sunday
schedule: {{ mod (randNumeric 2) 60 }} {{ mod (randNumeric 1) 6 }} * * 0
template:
includedNamespaces:
- {{ .Release.Namespace }}
@ -14,9 +14,9 @@ spec:
excludedResources:
{{- toYaml . | nindent 8 }}
{{- end }}
snapshotVolumes: {{ .Values.velero.backup.snapshotVolumes }}
# every backup is good for 7 days (one week)
ttl: 168h0m0s
defaultVolumesToRestic: {{ .Values.velero.backup.defaultVolumesToRestic }}
snapshotVolumes: false
# every sunday backup is good for 30 days (aprox. 1 month)
ttl: 744h0m0s
defaultVolumesToFsBackup: true
useOwnerReferencesInBackup: false
{{- end }}

2
charts/emailleg/v1.4.0/values.yaml

@ -108,8 +108,6 @@ velero:
namespace: velero
backup:
enabled: true
snapshotVolumes: false
defaultVolumesToRestic: true
# cert-manager objects are usually blocked during backup
excludedResources:
- certificates.cert-manager.io

Loading…
Cancel
Save