From 43bdc6a0c135724ccaa6db6f3ef5b5d07176fbe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Mon, 18 Sep 2023 13:15:48 +0200 Subject: [PATCH] [common]: add envfrom (#115) * feat: add envFrom container arg * feat: add envFrom container arg * feat: add envFrom container arg * feat: add envFrom container arg --- charts/common/Chart.yaml | 4 ++-- charts/common/README.md | 2 +- charts/common/templates/_container.yaml | 8 +++++++- charts/common/values.schema.json | 6 ++++++ charts/common/values.yaml | 14 ++++++++++++++ 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 5f141efe..6a825f70 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -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 @@ -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" diff --git a/charts/common/README.md b/charts/common/README.md index 0351a79e..6d10d6e3 100644 --- a/charts/common/README.md +++ b/charts/common/README.md @@ -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 diff --git a/charts/common/templates/_container.yaml b/charts/common/templates/_container.yaml index 55b33a9f..55281bbc 100644 --- a/charts/common/templates/_container.yaml +++ b/charts/common/templates/_container.yaml @@ -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 }} diff --git a/charts/common/values.schema.json b/charts/common/values.schema.json index c26aa2db..596a0581 100644 --- a/charts/common/values.schema.json +++ b/charts/common/values.schema.json @@ -87,6 +87,9 @@ "envSecret": { "type": "object" }, + "envFrom": { + "type": ["array"] + }, "envConfigMap": { "type": "object" }, @@ -785,6 +788,9 @@ "envConfigMap": { "type": "object" }, + "envFrom": { + "type": ["array"] + }, "replicas": { "type": "integer", "default": 1 diff --git a/charts/common/values.yaml b/charts/common/values.yaml index 8294c500..820e4272 100644 --- a/charts/common/values.yaml +++ b/charts/common/values.yaml @@ -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 @@ -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)