Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
feat(chart): support mounting existing secrets as files (#213)
Browse files Browse the repository at this point in the history
* Support mounting existing secrets as files
  • Loading branch information
Pluies authored and Flydiverny committed Nov 11, 2019
1 parent 9441216 commit ac9b9e2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
16 changes: 16 additions & 0 deletions charts/kubernetes-external-secrets/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ spec:
name: {{ $value.secretKeyRef | quote }}
key: {{ $value.key | quote }}
{{- end }}
{{- with .Values.filesFromSecret }}
volumeMounts:
{{- range $key, $value := . }}
- name: {{ $key }}
mountPath: {{ $value.mountPath }}
readOnly: true
{{- end }}
{{- end }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
Expand All @@ -64,3 +72,11 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.filesFromSecret }}
volumes:
{{- range $key, $value := . }}
- name: {{ $key }}
secret:
secretName: {{ $value.secret }}
{{- end }}
{{- end }}
8 changes: 7 additions & 1 deletion charts/kubernetes-external-secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
METRICS_PORT: 3001
VAULT_ADDR: http://127.0.0.1:8200

# Create environment variables from exists k8s secrets
# Create environment variables from existing k8s secrets
# envVarsFromSecret:
# AWS_ACCESS_KEY_ID:
# secretKeyRef: aws-credentials
Expand All @@ -19,6 +19,12 @@ env:
# secretKeyRef: aws-credentials
# key: key

# Create files from existing k8s secrets
# filesFromSecret:
# examplefile:
# secret: secretname
# mountPath: /a/mount/point/

rbac:
# Specifies whether RBAC resources should be created
create: true
Expand Down

0 comments on commit ac9b9e2

Please sign in to comment.