From 02dc9da850509230b8234428a448857c3151cc14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Mon, 18 Sep 2023 12:32:29 +0200 Subject: [PATCH 1/4] feat: add envFrom container arg --- charts/common/Chart.yaml | 4 ++-- charts/common/README.md | 2 +- charts/common/templates/_container.yaml | 5 ++++- charts/common/values.schema.json | 3 +++ charts/common/values.yaml | 7 +++++++ 5 files changed, 17 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..59003f18 100644 --- a/charts/common/templates/_container.yaml +++ b/charts/common/templates/_container.yaml @@ -70,8 +70,11 @@ subPath: {{ $key }} {{- end }} {{- end }} - {{- if or $containerValues.envSecret $containerValues.envConfigMap $controllerValues.envSecret $controllerValues.envConfigMap }} + {{- if or $containerValues.envFrom $containerValues.envSecret $containerValues.envConfigMap $controllerValues.envSecret $controllerValues.envConfigMap }} envFrom: + {{- with $containerValues.envFrom }} + {{- toYaml . | nidnent 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..453e5d43 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" }, diff --git a/charts/common/values.yaml b/charts/common/values.yaml index 8294c500..39db9940 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 From 58832bae4dd61144e07abdbb3a5d9789591842f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Mon, 18 Sep 2023 12:56:22 +0200 Subject: [PATCH 2/4] feat: add envFrom container arg --- charts/common/templates/_container.yaml | 5 ++++- charts/common/values.schema.json | 3 +++ charts/common/values.yaml | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/charts/common/templates/_container.yaml b/charts/common/templates/_container.yaml index 59003f18..6e0fbe01 100644 --- a/charts/common/templates/_container.yaml +++ b/charts/common/templates/_container.yaml @@ -70,11 +70,14 @@ subPath: {{ $key }} {{- end }} {{- end }} - {{- if or $containerValues.envFrom $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 . | nidnent 4 }} {{- end }} + {{- with $controllerValues.envFrom }} + {{- toYaml . | nidnent 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 453e5d43..596a0581 100644 --- a/charts/common/values.schema.json +++ b/charts/common/values.schema.json @@ -788,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 39db9940..509b193f 100644 --- a/charts/common/values.yaml +++ b/charts/common/values.yaml @@ -518,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) From 9336d629a5e452eb16a983063fd0084950c0237f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Mon, 18 Sep 2023 13:00:48 +0200 Subject: [PATCH 3/4] feat: add envFrom container arg --- charts/common/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/common/values.yaml b/charts/common/values.yaml index 509b193f..820e4272 100644 --- a/charts/common/values.yaml +++ b/charts/common/values.yaml @@ -300,7 +300,7 @@ components: # envConfigMap: {} # envFrom is a list of environment references - envFrom: [] + # envFrom: [] # - secretRef: # name: my-secret # - configMapRef: From b3f324bb18bc8d3bccc2fed0a5cbc7a60756bf0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Mon, 18 Sep 2023 13:02:37 +0200 Subject: [PATCH 4/4] feat: add envFrom container arg --- charts/common/templates/_container.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/common/templates/_container.yaml b/charts/common/templates/_container.yaml index 6e0fbe01..55281bbc 100644 --- a/charts/common/templates/_container.yaml +++ b/charts/common/templates/_container.yaml @@ -73,10 +73,10 @@ {{- if or $containerValues.envFrom $controllerValues.envFrom $containerValues.envSecret $containerValues.envConfigMap $controllerValues.envSecret $controllerValues.envConfigMap }} envFrom: {{- with $containerValues.envFrom }} - {{- toYaml . | nidnent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} {{- with $controllerValues.envFrom }} - {{- toYaml . | nidnent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} {{- if $controllerValues.envSecret }} - secretRef: