Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add schedule #317

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions application/templates/backup.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions application/templates/schedule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if (.Values.schedule).enabled }}
apiVersion: velero.io/v1
kind: Schedule
metadata:
name: {{ printf "%s-schedule" .Values.applicationName | trunc 63 | quote }}
namespace: {{ .Values.schedule.namespace | default ( include "application.namespace" . ) | quote }}
spec:
schedule: {{ .Values.schedule.cronSchedule | quote }}
template:
labelSelector:
matchLabels:
app.kubernetes.io/part-of: {{ include "application.name" . }}
includedNamespaces:
- {{ include "application.namespace" . }}
defaultVolumesToRestic: {{ .Values.schedule.defaultVolumesToRestic | default true }}
snapshotVolumes: {{ .Values.schedule.snapshotVolumes | default true }}
storageLocation: {{ .Values.schedule.storageLocation | quote }}
ttl: {{ .Values.schedule.ttl | default "24h0m0s" }}
{{- if .Values.schedule.includedResources }}
includedResources:
{{ toYaml .Values.schedule.includedResources | indent 6 }}
{{- end -}}
{{- if .Values.schedule.excludedResources }}
excludedResources:
{{ toYaml .Values.schedule.excludedResources | indent 6 }}
{{- end -}}
{{- end }}
2 changes: 1 addition & 1 deletion application/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ cronJob:
cpu: 1

# Take backup of application namespace
backup:
schedule:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of schedule we can be a little more explicit about what this is for in the value's own name.

Suggested change
schedule:
backupSchedule:

What do you think, @AsfaMumtaz?

namespace: openshift-adp
enabled: true
snapshotVolumes: true
Expand Down
4 changes: 2 additions & 2 deletions application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,8 @@ grafanaDashboard:
# app: test-2

##########################################################
# Backup object for creating back using OADP/Velero
# Backup schedule object for creating back using OADP/Velero
##########################################################
backup:
schedule:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same suggestion as in the other thread I opened.

enabled: false

Loading