Skip to content

Commit

Permalink
[monochart] Add envFrom section (#231)
Browse files Browse the repository at this point in the history
* [monochart] Add `envFrom` section

* [monochart] Add `envFrom` section
  • Loading branch information
aknysh authored Mar 11, 2020
1 parent 63fe75e commit df2e4c8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 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.18.4
appVersion: 0.18.4
version: 0.19.0
appVersion: 0.19.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
10 changes: 10 additions & 0 deletions incubator/monochart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ env:
value: {{ default "" $value | quote }}
{{- end }}
{{- end }}
{{- with $root.Values.envFrom }}
{{- range $name := .configMaps -}}
- configMapRef:
name: {{ $name }}
{{- end }}
{{- range $name := .secrets -}}
- secretRef:
name: {{ $name }}
{{- end }}
{{- end }}
{{- end -}}


Expand Down
11 changes: 10 additions & 1 deletion incubator/monochart/values.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,19 @@ secrets:
secret.test.txt: |-
some text
# Inline environment
# Inline ENV variables
env:
INLINE_ENV_NAME: ENV_VALUE

# ENV variables from existing Kubernetes secrets and ConfigMaps
envFrom:
secrets:
- secret-1
- secret-2
configMaps:
- config-1
- config-2

deployment:
enabled: true
## Pods replace strategy
Expand Down
13 changes: 11 additions & 2 deletions incubator/monochart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,19 @@ secrets:
# group:
# key: value

# Inline environment
# Inline ENV variables
env:
# ENV_NAME: ENV_VALUE

# ENV variables from existing Kubernetes secrets and ConfigMaps
#envFrom:
# secrets:
# - secret-1
# - secret-2
# configMaps:
# - config-1
# - config-2

deployment:
enabled: false
## Pods replace strategy
Expand Down Expand Up @@ -407,4 +416,4 @@ crd:
# name: https
# protocol: HTTPS
# location: MESH_EXTERNAL
# resolution: DNS
# resolution: DNS

0 comments on commit df2e4c8

Please sign in to comment.