Skip to content

Commit

Permalink
[monochart] Add envFromFieldRefFieldPath config (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
aknysh authored Oct 3, 2020
1 parent 8c7bf99 commit b7cf8b1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions incubator/monochart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
12 changes: 12 additions & 0 deletions incubator/monochart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}


Expand Down
6 changes: 6 additions & 0 deletions incubator/monochart/values.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions incubator/monochart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b7cf8b1

Please sign in to comment.