Skip to content

Commit

Permalink
Add support for secret env vars (#99)
Browse files Browse the repository at this point in the history
* Add support for secret env vars

Signed-off-by: Kévin Dunglas <[email protected]>

* Update Chart.yaml

Signed-off-by: Kévin Dunglas <[email protected]>

* Update restic-daemonset.yaml

Signed-off-by: Kévin Dunglas <[email protected]>
  • Loading branch information
dunglas authored Apr 23, 2020
1 parent b6a28d7 commit dac2338
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
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.14
version: 2.9.15
home: https://github.com/vmware-tanzu/velero
icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png
sources:
Expand Down
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 | quote }}
{{- 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
15 changes: 15 additions & 0 deletions charts/velero/templates/restic-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,21 @@ spec:
value: /credentials/cloud
{{- end }}
{{- end }}
{{- with .Values.configuration.extraEnvVars }}
{{- range $key, $value := . }}
- name: {{ default "none" $key | quote }}
value: {{ default "none" $value | quote }}
{{- 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 }}
securityContext:
privileged: {{ .Values.restic.privileged }}
{{- with .Values.restic.securityContext }}
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: 2 additions & 0 deletions charts/velero/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,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 dac2338

Please sign in to comment.