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

Allow independent backup/snapshot providers #82

Merged
merged 3 commits into from
Apr 9, 2020
Merged
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
2 changes: 1 addition & 1 deletion charts/velero/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 1.3.1
description: A Helm chart for velero
name: velero
version: 2.9.8
version: 2.9.9
home: https://github.com/vmware-tanzu/velero
icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png
sources:
Expand Down
36 changes: 36 additions & 0 deletions charts/velero/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,39 @@ Create the Restic priority class name.
{{- include "velero.fullname" . -}}
{{- end -}}
{{- end -}}

{{/*
Create the backup storage location name
*/}}
{{- define "velero.backupStorageLocation.name" -}}
{{- with .Values.configuration.backupStorageLocation -}}
{{ default "default" .name }}
{{- end -}}
{{- end -}}

{{/*
Create the backup storage location provider
*/}}
{{- define "velero.backupStorageLocation.provider" -}}
{{- with .Values.configuration -}}
{{ default .backupStorageLocation.provider .provider }}
{{- end -}}
{{- end -}}

{{/*
Create the volume snapshot location name
*/}}
{{- define "velero.volumeSnapshotLocation.name" -}}
{{- with .Values.configuration.volumeSnapshotLocation -}}
{{ default "default" .name }}
{{- end -}}
{{- end -}}

{{/*
Create the volume snapshot location provider
*/}}
{{- define "velero.volumeSnapshotLocation.provider" -}}
{{- with .Values.configuration -}}
{{ default .volumeSnapshotLocation.provider .provider }}
{{- end -}}
{{- end -}}
42 changes: 5 additions & 37 deletions charts/velero/templates/backupstoragelocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,23 @@
apiVersion: velero.io/v1
kind: BackupStorageLocation
metadata:
name: default
name: {{ include "velero.backupStorageLocation.name" . }}
labels:
app.kubernetes.io/name: {{ include "velero.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "velero.chart" . }}
spec:
{{- with .Values.configuration }}
provider: {{ .provider }}
{{- with .backupStorageLocation }}
provider: {{ include "velero.backupStorageLocation.provider" . }}
{{- with .Values.configuration.backupStorageLocation }}
objectStorage:
bucket: {{ .bucket }}
{{- with .prefix }}
prefix: {{ . }}
{{- end }}
{{- with .config }}
{{ with .config }}
config:
{{- with .region }}
region: {{ . }}
{{- end }}
{{- with .s3ForcePathStyle }}
s3ForcePathStyle: {{ . | quote }}
{{- end }}
{{- with .s3Url }}
s3Url: {{ . }}
{{- end }}
{{- with .kmsKeyId }}
kmsKeyId: {{ . }}
{{- end }}
{{- with .resourceGroup }}
resourceGroup: {{ . }}
{{- end }}
{{- with .storageAccount }}
storageAccount: {{ . }}
{{- end }}
{{- with .subscriptionId }}
subscriptionId: {{ . }}
{{- end }}
{{- if .publicUrl }}
{{- with .publicUrl }}
publicUrl: {{ . }}
{{- end }}
{{- end }}
{{- if .serviceAccount }}
{{- with .serviceAccount }}
serviceAccount: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{ toYaml . }}
{{- end }}
{{- end }}
{{- end }}
31 changes: 5 additions & 26 deletions charts/velero/templates/volumesnapshotlocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,16 @@
apiVersion: velero.io/v1
kind: VolumeSnapshotLocation
metadata:
name: default
name: {{ include "velero.volumeSnapshotLocation.name" . }}
labels:
app.kubernetes.io/name: {{ include "velero.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "velero.chart" . }}
spec:
{{- with .Values.configuration }}
provider: {{ .provider }}
{{- with .volumeSnapshotLocation }}
{{ with .config }}
provider: {{ include "velero.volumeSnapshotLocation.provider" . }}
{{- with .Values.configuration.volumeSnapshotLocation.config }}
config:
{{- with .region }}
region: {{ . }}
{{- end }}
{{- with .apitimeout }}
apiTimeout: {{ . }}
{{- end }}
{{- with .resourceGroup }}
resourceGroup: {{ . }}
{{- end }}
{{- with .subscriptionId }}
subscriptionId: {{ . }}
{{- end }}
{{- with .snapshotLocation }}
snapshotLocation: {{ . }}
{{- end }}
{{- with .project }}
project: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{ toYaml .config }}
{{- end -}}
{{- end }}