Skip to content

Commit

Permalink
[velero] Allow better customization for upgrade-crds job (vmware-tanz…
Browse files Browse the repository at this point in the history
…u#257)

* Allow better customization for upgrade-crds job

Signed-off-by: Frederic Marchand <[email protected]>

* Allow better customization for upgrade-crds and cleanup-crds jobs

Signed-off-by: Frederic Marchand <[email protected]>

* Apply requested changes

Signed-off-by: Frederic Marchand <[email protected]>
  • Loading branch information
uncycler authored May 7, 2021
1 parent 9828af1 commit dda4393
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 11 deletions.
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: v2
appVersion: 1.6.0
description: A Helm chart for velero
name: velero
version: 2.19.3
version: 2.20.0
home: https://github.com/vmware-tanzu/velero
icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png
sources:
Expand Down
18 changes: 15 additions & 3 deletions charts/velero/templates/cleanup-crds.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.cleanUpCRDs }}
{{- if .Values.cleanUpCRDs }}
# This job is meant primarily for cleaning up on CI systems.
# Using this on production systems, especially those that have multiple releases of Velero, will be destructive.
apiVersion: batch/v1
Expand All @@ -19,6 +19,14 @@ spec:
template:
metadata:
name: velero-cleanup-crds
{{- with .Values.kubectl.labels }}
labels:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kubectl.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if .Values.image.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -29,8 +37,12 @@ spec:
serviceAccountName: {{ include "velero.serverServiceAccount" . }}
containers:
- name: kubectl
image: docker.io/bitnami/kubectl:1.14.3
imagePullPolicy: IfNotPresent
{{- if .Values.kubectl.image.digest }}
image: "{{ .Values.kubectl.image.repository }}@{{ .Values.kubectl.image.digest }}"
{{- else }}
image: "{{ .Values.kubectl.image.repository }}:{{ .Values.kubectl.image.tag }}"
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /bin/sh
- -c
Expand Down
24 changes: 19 additions & 5 deletions charts/velero/templates/upgrade-crds.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.upgradeCRDs }}
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -16,6 +17,14 @@ spec:
template:
metadata:
name: velero-upgrade-crds
{{- with .Values.kubectl.labels }}
labels:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.kubectl.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if .Values.image.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -26,11 +35,11 @@ spec:
serviceAccountName: {{ include "velero.serverServiceAccount" . }}
initContainers:
- name: velero
{{- if .Values.image.digest }}
{{- if .Values.image.digest }}
image: "{{ .Values.image.repository }}@{{ .Values.image.digest }}"
{{- else }}
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
{{- end }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /bin/sh
Expand All @@ -41,8 +50,12 @@ spec:
name: crds
containers:
- name: kubectl
image: docker.io/bitnami/kubectl:1.14.3
imagePullPolicy: IfNotPresent
{{- if .Values.kubectl.image.digest }}
image: "{{ .Values.kubectl.image.repository }}@{{ .Values.kubectl.image.digest }}"
{{- else }}
image: "{{ .Values.kubectl.image.repository }}:{{ .Values.kubectl.image.tag }}"
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /bin/sh
- -c
Expand All @@ -54,3 +67,4 @@ spec:
- name: crds
emptyDir: {}
restartPolicy: OnFailure
{{- end }}
23 changes: 21 additions & 2 deletions charts/velero/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
image:
repository: velero/velero
tag: v1.6.0
# Digest value example: sha256:d238835e151cec91c6a811fe3a89a66d3231d9f64d09e5f3c49552672d271f38. If used, it will
# take precedence over the image.tag.
# Digest value example: sha256:d238835e151cec91c6a811fe3a89a66d3231d9f64d09e5f3c49552672d271f38.
# If used, it will take precedence over the image.tag.
# digest:
pullPolicy: IfNotPresent
# One or more secrets to be used when pulling images
Expand Down Expand Up @@ -105,6 +105,25 @@ metrics:
# ServiceMonitor namespace. Default to Velero namespace.
# namespace:

kubectl:
image:
repository: docker.io/bitnami/kubectl
tag: 1.14.3
# Digest value example: sha256:d238835e151cec91c6a811fe3a89a66d3231d9f64d09e5f3c49552672d271f38.
# If used, it will take precedence over the kubectl.image.tag.
# digest:
# Annotations to set for the upgrade/cleanup job. Optional.
annotations: {}
# Labels to set for the upgrade/cleanup job. Optional.
labels: {}

# This job upgrades the CRDs.
upgradeCRDs: true

# This job is meant primarily for cleaning up CRDs on CI systems.
# Using this on production systems, especially those that have multiple releases of Velero, will be destructive.
cleanUpCRDs: false

##
## End of deployment-related settings.
##
Expand Down

0 comments on commit dda4393

Please sign in to comment.