Skip to content

Commit

Permalink
[common]: add envfrom (#115)
Browse files Browse the repository at this point in the history
* feat: add envFrom container arg

* feat: add envFrom container arg

* feat: add envFrom container arg

* feat: add envFrom container arg
  • Loading branch information
oliverbaehler authored Sep 18, 2023
1 parent 2ddda80 commit 43bdc6a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/common/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: common
description: "Bedag's common Helm chart to use for creating other Helm charts"
version: 10.6.1
version: 10.6.2
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
Expand All @@ -27,4 +27,4 @@ annotations:
artifacthub.io/prerelease: "false"
artifacthub.io/license: Apache-2.0
artifacthub.io/changes: |
- "[Added]: support for clusterIP field"
- "[Added]: support for envFrom"
2 changes: 1 addition & 1 deletion charts/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![Version: 10.6.1](https://img.shields.io/badge/Version-10.6.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 10.6.2](https://img.shields.io/badge/Version-10.6.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Bedag's common Helm chart to use for creating other Helm charts

Expand Down
8 changes: 7 additions & 1 deletion charts/common/templates/_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,14 @@
subPath: {{ $key }}
{{- end }}
{{- end }}
{{- if or $containerValues.envSecret $containerValues.envConfigMap $controllerValues.envSecret $controllerValues.envConfigMap }}
{{- if or $containerValues.envFrom $controllerValues.envFrom $containerValues.envSecret $containerValues.envConfigMap $controllerValues.envSecret $controllerValues.envConfigMap }}
envFrom:
{{- with $containerValues.envFrom }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $controllerValues.envFrom }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if $controllerValues.envSecret }}
- secretRef:
name: {{ template "library.name" $root }}-{{ $componentName }}
Expand Down
6 changes: 6 additions & 0 deletions charts/common/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
"envSecret": {
"type": "object"
},
"envFrom": {
"type": ["array"]
},
"envConfigMap": {
"type": "object"
},
Expand Down Expand Up @@ -785,6 +788,9 @@
"envConfigMap": {
"type": "object"
},
"envFrom": {
"type": ["array"]
},
"replicas": {
"type": "integer",
"default": 1
Expand Down
14 changes: 14 additions & 0 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@ components:
# envConfigMap is a dictionary of environment variables set for every container in a pod, key: value
# envConfigMap: {}

# envFrom is a list of environment references
# envFrom: []
# - secretRef:
# name: my-secret
# - configMapRef:
# name: my-configmap

# gatherMetrics is true: service get a label which triggers serviceMonitor to gather metrics
gatherMetrics: false

Expand Down Expand Up @@ -511,6 +518,13 @@ components:
# envConfigMap is a dictionary of environment variables set for the current container, key: value
# envConfigMap: {}

# envFrom is a list of environment references
# envFrom: []
# - secretRef:
# name: my-secret
# - configMapRef:
# name: my-configmap

# configFilesDefaultMode sets permissions for all configFiles mounted.
# See 'pod.spec.volumes.configMap.defaultMode' or 'pod.spec.volumes.secret.defaultMode' for more information
# Comment out for using default (0644)
Expand Down

0 comments on commit 43bdc6a

Please sign in to comment.