Skip to content

Commit

Permalink
Add support for secret env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Apr 13, 2020
1 parent 36b3d98 commit eee7b23
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/velero/templates/backupstoragelocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ spec:
{{- with .prefix }}
prefix: {{ . }}
{{- end }}
{{ with .config }}
{{- with .config }}
config:
{{ toYaml . }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/velero/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ spec:
value: {{ default "none" $value }}
{{- end }}
{{- end }}
{{- with .Values.credentials.extraEnvVars }}
{{- range $key, $value := . }}
- name: {{ default "none" $key }}
valueFrom:
secretKeyRef:
name: {{ include "velero.fullname" $ }}
key: {{ default "none" $key }}
{{- end }}
{{- end }}
{{- if .Values.initContainers }}
initContainers:
{{- toYaml .Values.initContainers | nindent 8 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/velero/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ data:
{{- range $key, $value := .Values.credentials.secretContents }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
{{- range $key, $value := .Values.credentials.extraEnvVars }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/velero/templates/volumesnapshotlocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ spec:
provider: {{ include "velero.volumeSnapshotLocation.provider" . }}
{{- with .Values.configuration.volumeSnapshotLocation.config }}
config:
{{ toYaml .config }}
{{ toYaml . | indent 4 }}
{{- end -}}
{{- end }}
2 changes: 2 additions & 0 deletions charts/velero/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ credentials:
# true and `existingSecret` is empty. This should be the contents
# of your IAM credentials file.
secretContents: {}
# additional key/value pairs to be used as environment variables such as "DIGITALOCEAN_TOKEN: <your-key>". Values will be stored in the secret.
extraEnvVars: {}

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

0 comments on commit eee7b23

Please sign in to comment.