diff --git a/incubator/monochart/Chart.yaml b/incubator/monochart/Chart.yaml index bddb6598..81286391 100644 --- a/incubator/monochart/Chart.yaml +++ b/incubator/monochart/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: A declarative helm chart for deploying common types of services on Kubernetes name: monochart -version: 0.24.0 -appVersion: 0.24.0 +version: 0.25.0 +appVersion: 0.25.0 home: https://github.com/cloudposse/charts/tree/master/incubator/monochart icon: https://raw.githubusercontent.com/cloudposse/charts/master/incubator/monochart/logo.png maintainers: diff --git a/incubator/monochart/templates/_helpers.tpl b/incubator/monochart/templates/_helpers.tpl index 740e3348..70e4eb86 100644 --- a/incubator/monochart/templates/_helpers.tpl +++ b/incubator/monochart/templates/_helpers.tpl @@ -73,6 +73,18 @@ env: fieldPath: {{ $value }} {{- end }} {{- end }} +{{/* +https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables +*/}} +{{- with $root.Values.envFromSecretKeyRef }} +{{- range $data := . }} + - name: {{ $data.name }} + valueFrom: + secretKeyRef: + name: {{ $data.secret }} + key: {{ $data.key }} +{{- end }} +{{- end }} {{- end -}} diff --git a/incubator/monochart/values.example.yaml b/incubator/monochart/values.example.yaml index 06b35c16..aeedd05d 100644 --- a/incubator/monochart/values.example.yaml +++ b/incubator/monochart/values.example.yaml @@ -66,6 +66,13 @@ envFromFieldRefFieldPath: ENV_1: path-1 ENV_2: path-2 +# ENV variables from secretkeyref +# https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables +envFromSecretKeyRef: + - name: MY_ENV_VARIABLE + secret: kubernetes-secret-name + key: key-name-in-secret + deployment: enabled: true ## Pods replace strategy diff --git a/incubator/monochart/values.yaml b/incubator/monochart/values.yaml index 4f19c5a7..dbbf021e 100644 --- a/incubator/monochart/values.yaml +++ b/incubator/monochart/values.yaml @@ -72,6 +72,13 @@ env: {} # ENV_1: path-1 # ENV_2: path-2 +# ENV variables from secretkeyref +# https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables +# envFromSecretKeyRef: +# - name: MY_ENV_VARIABLE +# secret: kubernetes-secret-name +# key: key-name-in-secret + deployment: enabled: false ## Pods replace strategy