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

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

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

Loading…
Cancel
Save