From 19dcf1c421e14d6b71cc13386fabbbfe09282f40 Mon Sep 17 00:00:00 2001 From: Florent Delannoy Date: Mon, 11 Nov 2019 15:00:11 +0000 Subject: [PATCH 1/2] Support mounting existing secrets as files --- charts/kubernetes-external-secrets/Chart.yaml | 2 +- .../templates/deployment.yaml | 16 ++++++++++++++++ charts/kubernetes-external-secrets/values.yaml | 8 +++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/charts/kubernetes-external-secrets/Chart.yaml b/charts/kubernetes-external-secrets/Chart.yaml index 57f6a340..9b57e11c 100644 --- a/charts/kubernetes-external-secrets/Chart.yaml +++ b/charts/kubernetes-external-secrets/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: kubernetes-external-secrets -version: 2.1.0 +version: 2.1.1 appVersion: 2.1.0 description: Kubernetes External Secrets CustomResourceDefinition keywords: diff --git a/charts/kubernetes-external-secrets/templates/deployment.yaml b/charts/kubernetes-external-secrets/templates/deployment.yaml index 8ac3afee..a35f377f 100644 --- a/charts/kubernetes-external-secrets/templates/deployment.yaml +++ b/charts/kubernetes-external-secrets/templates/deployment.yaml @@ -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 }} @@ -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 }} diff --git a/charts/kubernetes-external-secrets/values.yaml b/charts/kubernetes-external-secrets/values.yaml index 46986773..ea722d27 100644 --- a/charts/kubernetes-external-secrets/values.yaml +++ b/charts/kubernetes-external-secrets/values.yaml @@ -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 @@ -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 From 6331361dc3937b3ac170d971024bc906a1bec2e6 Mon Sep 17 00:00:00 2001 From: Markus Maga Date: Mon, 11 Nov 2019 19:34:31 +0100 Subject: [PATCH 2/2] revert chart version --- charts/kubernetes-external-secrets/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kubernetes-external-secrets/Chart.yaml b/charts/kubernetes-external-secrets/Chart.yaml index 9b57e11c..57f6a340 100644 --- a/charts/kubernetes-external-secrets/Chart.yaml +++ b/charts/kubernetes-external-secrets/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: kubernetes-external-secrets -version: 2.1.1 +version: 2.1.0 appVersion: 2.1.0 description: Kubernetes External Secrets CustomResourceDefinition keywords: