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

[velero] Pass config trough tpl and implement reload trigger #525

Merged
merged 8 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -3,7 +3,7 @@ appVersion: 1.12.2
kubeVersion: ">=1.16.0-0"
description: A Helm chart for velero
name: velero
version: 5.1.5
version: 5.1.6
home: https://github.com/vmware-tanzu/velero
icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png
sources:
Expand Down
7 changes: 5 additions & 2 deletions charts/velero/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- end }}
{{- if or .Values.podAnnotations .Values.metrics.enabled }}
{{- if or .Values.podAnnotations .Values.metrics.enabled (and .Values.credentials.useSecret (not .Values.credentials.existingSecret) .Values.credentials.restartOnChange) }}
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
Expand All @@ -50,6 +50,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- if and .Values.credentials.useSecret (not .Values.credentials.existingSecret) .Values.credentials.restartOnChange }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- end }}
{{- end }}
spec:
{{- if .Values.image.imagePullSecrets }}
Expand Down Expand Up @@ -218,7 +221,7 @@ spec:
{{- with .Values.configuration.extraEnvVars }}
{{- range $key, $value := . }}
- name: {{ default "none" $key }}
value: {{ default "none" $value | quote }}
value: {{ tpl (default "none" $value) $ | quote }}
{{- end }}
{{- end }}
{{- with .Values.credentials.extraEnvVars }}
Expand Down
9 changes: 6 additions & 3 deletions charts/velero/templates/node-agent-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- end }}
{{- if or .Values.podAnnotations .Values.metrics.enabled }}
{{- if or .Values.podAnnotations .Values.metrics.enabled (and .Values.credentials.useSecret (not .Values.credentials.existingSecret) .Values.credentials.restartOnChange) }}
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
Expand All @@ -43,6 +43,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- if and .Values.credentials.useSecret (not .Values.credentials.existingSecret) .Values.credentials.restartOnChange }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- end }}
{{- end }}
spec:
{{- if .Values.image.imagePullSecrets }}
Expand Down Expand Up @@ -150,7 +153,7 @@ spec:
{{- with .Values.configuration.extraEnvVars }}
{{- range $key, $value := . }}
- name: {{ default "none" $key }}
value: {{ default "none" $value | quote }}
value: {{ tpl (default "none" $value) $ | quote }}
{{- end }}
{{- end }}
{{- with .Values.credentials.extraEnvVars }}
Expand Down Expand Up @@ -191,7 +194,7 @@ spec:
{{- with .Values.nodeAgent.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.nodeAgent.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/velero/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ metadata:
type: Opaque
data:
{{- range $key, $value := .Values.credentials.secretContents }}
{{ $key }}: {{ $value | b64enc | quote }}
{{ $key }}: {{ tpl $value $ | b64enc | quote }}
{{- end }}
{{- range $key, $value := .Values.credentials.extraEnvVars }}
{{ $key }}: {{ $value | b64enc | quote }}
{{ $key }}: {{ tpl $value $ | b64enc | quote }}
{{- end }}
{{- end -}}
4 changes: 3 additions & 1 deletion charts/velero/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ serviceAccount:
credentials:
# Whether a secret should be used. Set to false if, for examples:
# - using kube2iam or kiam to provide AWS IAM credentials instead of providing the key file. (AWS only)
# - using workload identity instead of providing the key file. (GCP only)
# - using workload identity instead of providing the key file. (Azure/GCP only)
useSecret: true
# Name of the secret to create if `useSecret` is true and `existingSecret` is empty
name:
Expand All @@ -497,6 +497,8 @@ credentials:
# that will be used to load environment variables into velero and node-agent.
# Secret should be in format - https://kubernetes.io/docs/concepts/configuration/secret/#use-case-as-container-environment-variables
extraSecretRef: ""
# If true, the velero controller will be restarted if the secret has been changed.
restartOnChange: false
jkroepke marked this conversation as resolved.
Show resolved Hide resolved

# Whether to create backupstoragelocation crd, if false => do not create a default backup location
backupsEnabled: true
Expand Down