diff --git a/incubator/monochart/Chart.yaml b/incubator/monochart/Chart.yaml index 1712f2e1..bddb6598 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.23.2 -appVersion: 0.23.2 +version: 0.24.0 +appVersion: 0.24.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 91a2e919..740e3348 100644 --- a/incubator/monochart/templates/_helpers.tpl +++ b/incubator/monochart/templates/_helpers.tpl @@ -61,6 +61,18 @@ env: value: {{ default "" $value | quote }} {{- end }} {{- end }} +{{/* +https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#use-pod-fields-as-values-for-environment-variables +*/}} +{{- with $root.Values.envFromFieldRefFieldPath }} +env: +{{- range $name, $value := . }} + - name: {{ $name }} + valueFrom: + fieldRef: + fieldPath: {{ $value }} +{{- end }} +{{- end }} {{- end -}} diff --git a/incubator/monochart/values.example.yaml b/incubator/monochart/values.example.yaml index 57536253..06b35c16 100644 --- a/incubator/monochart/values.example.yaml +++ b/incubator/monochart/values.example.yaml @@ -60,6 +60,12 @@ envFrom: - config-1 - config-2 +# ENV variables from fieldRef.fieldPath +# https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#use-pod-fields-as-values-for-environment-variables +envFromFieldRefFieldPath: + ENV_1: path-1 + ENV_2: path-2 + deployment: enabled: true ## Pods replace strategy diff --git a/incubator/monochart/values.yaml b/incubator/monochart/values.yaml index 90e939ec..9505af04 100644 --- a/incubator/monochart/values.yaml +++ b/incubator/monochart/values.yaml @@ -66,6 +66,12 @@ env: {} # - config-1 # - config-2 +# ENV variables from fieldRef.fieldPath +# https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#use-pod-fields-as-values-for-environment-variables +#envFromFieldRefFieldPath: +# ENV_1: path-1 +# ENV_2: path-2 + deployment: enabled: false ## Pods replace strategy