From b4591cda102045f2c8f1adeac41703d9d20f3f66 Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Sat, 7 Feb 2026 17:07:22 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(helm)=20allow=20keys=20in=20configMap?= =?UTF-8?q?=20or=20secret=20as=20env=20var?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current envVars construct only allows single keys in a configMap or secret to be used as environment variables. This commits keeps this functionality for backwards compatibility, but adds another envFrom variable that allows using all keys in a secret or configMap as environment variables. Signed-off-by: Johannes Kastl --- .../impress/templates/backend_deployment.yaml | 4 +++ .../templates/celery_worker_deployment.yaml | 4 +++ .../impress/templates/docspec_deployment.yaml | 4 +++ .../templates/frontend_deployment.yaml | 4 +++ .../templates/yprovider_deployment.yaml | 4 +++ src/helm/impress/values.yaml | 32 +++++++++++++++++++ 6 files changed, 52 insertions(+) diff --git a/src/helm/impress/templates/backend_deployment.yaml b/src/helm/impress/templates/backend_deployment.yaml index f9bb002e..b43e9aa8 100644 --- a/src/helm/impress/templates/backend_deployment.yaml +++ b/src/helm/impress/templates/backend_deployment.yaml @@ -53,6 +53,10 @@ spec: env: {{- $envVars | indent 12 }} {{- end }} + {{- if .Values.backend.envFrom }} + envFrom: + {{- toYaml .Values.backend.envFrom | nindent 12 }} + {{- end }} {{- with .Values.backend.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/src/helm/impress/templates/celery_worker_deployment.yaml b/src/helm/impress/templates/celery_worker_deployment.yaml index a372a8fb..56743c4d 100644 --- a/src/helm/impress/templates/celery_worker_deployment.yaml +++ b/src/helm/impress/templates/celery_worker_deployment.yaml @@ -53,6 +53,10 @@ spec: env: {{- $envVars | indent 12 }} {{- end }} + {{- if .Values.backend.envFrom }} + envFrom: + {{- toYaml .Values.backend.envFrom | nindent 12 }} + {{- end }} {{- with .Values.backend.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/src/helm/impress/templates/docspec_deployment.yaml b/src/helm/impress/templates/docspec_deployment.yaml index 984b98d1..8ac9f786 100644 --- a/src/helm/impress/templates/docspec_deployment.yaml +++ b/src/helm/impress/templates/docspec_deployment.yaml @@ -39,6 +39,10 @@ spec: env: {{- $envVars | indent 12 }} {{- end }} + {{- if .Values.backend.envFrom }} + envFrom: + {{- toYaml .Values.backend.envFrom | nindent 12 }} + {{- end }} {{- with .Values.docSpec.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/src/helm/impress/templates/frontend_deployment.yaml b/src/helm/impress/templates/frontend_deployment.yaml index da994072..487a3c08 100644 --- a/src/helm/impress/templates/frontend_deployment.yaml +++ b/src/helm/impress/templates/frontend_deployment.yaml @@ -53,6 +53,10 @@ spec: env: {{- $envVars | indent 12 }} {{- end }} + {{- if .Values.frontend.envFrom }} + envFrom: + {{- toYaml .Values.frontend.envFrom | nindent 12 }} + {{- end }} {{- with .Values.frontend.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/src/helm/impress/templates/yprovider_deployment.yaml b/src/helm/impress/templates/yprovider_deployment.yaml index 549b2cd2..953c088d 100644 --- a/src/helm/impress/templates/yprovider_deployment.yaml +++ b/src/helm/impress/templates/yprovider_deployment.yaml @@ -53,6 +53,10 @@ spec: env: {{- $envVars | indent 12 }} {{- end }} + {{- if .Values.yProvider.envFrom }} + envFrom: + {{- toYaml .Values.yProvider.envFrom | nindent 12 }} + {{- end }} {{- with .Values.yProvider.securityContext }} securityContext: {{- toYaml . | nindent 12 }} diff --git a/src/helm/impress/values.yaml b/src/helm/impress/values.yaml index f818c217..6196c2e6 100644 --- a/src/helm/impress/values.yaml +++ b/src/helm/impress/values.yaml @@ -243,6 +243,14 @@ backend: envVars: <<: *commonEnvVars + ## @skip backend.envFrom List of environment variables taken from Secrets or configMaps + envFrom: [] + # envFrom: + # - secret: + # name: super-secret-user-credentials + # - configMapRef: + # name: my-environment-variables + ## @param backend.podAnnotations Annotations to add to the backend Pod podAnnotations: {} @@ -471,6 +479,14 @@ frontend: envVars: <<: *commonEnvVars + ## @skip frontend.envFrom List of environment variables taken from Secrets or configMaps + envFrom: [] + # envFrom: + # - secret: + # name: super-secret-user-credentials + # - configMapRef: + # name: my-environment-variables + ## @param frontend.podAnnotations Annotations to add to the frontend Pod podAnnotations: {} @@ -648,6 +664,14 @@ yProvider: envVars: <<: *commonEnvVars + ## @skip yProvider.envFrom List of environment variables taken from Secrets or configMaps + envFrom: [] + # envFrom: + # - secret: + # name: super-secret-user-credentials + # - configMapRef: + # name: my-environment-variables + ## @param yProvider.podAnnotations Annotations to add to the yProvider Pod podAnnotations: {} @@ -749,6 +773,14 @@ docSpec: ## @param docSpec.envVars Configure docSpec container environment variables envVars: {} + ## @skip docSpec.envFrom List of environment variables taken from Secrets or configMaps + envFrom: [] + # envFrom: + # - secret: + # name: super-secret-user-credentials + # - configMapRef: + # name: my-environment-variables + ## @param docSpec.service Configure docSpec service service: type: ClusterIP