From 034c5feb94e8ed796620e1fa2ea20772da81e41d Mon Sep 17 00:00:00 2001 From: Alessandro Ogier Date: Sat, 18 Jan 2025 22:23:14 +0100 Subject: [PATCH] env map value --- kubernetes/chart/zulip/README.md | 11 +++++++++++ kubernetes/chart/zulip/templates/_helpers.tpl | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/kubernetes/chart/zulip/README.md b/kubernetes/chart/zulip/README.md index 3364323ab8..ebe8a8d65f 100644 --- a/kubernetes/chart/zulip/README.md +++ b/kubernetes/chart/zulip/README.md @@ -143,6 +143,17 @@ are defined in the `values.yaml` under `zulip.environment`. These environment variables are forwarded to the Docker container, you can read more about configuring Zulip through environment variables [here](https://github.com/zulip/docker-zulip/#configuration). +Variables can be either a plain scalar value ie. string/int or a projected value +from a secret or configmap, eg: + +```yaml +SETTING_EXTERNAL_HOST: zulip.example.com +SECRETS_email_password: + valueFrom: + secretKeyRef: + name: email + key: password +``` ### Dependencies diff --git a/kubernetes/chart/zulip/templates/_helpers.tpl b/kubernetes/chart/zulip/templates/_helpers.tpl index 39cd659d0b..a6fbde30a8 100644 --- a/kubernetes/chart/zulip/templates/_helpers.tpl +++ b/kubernetes/chart/zulip/templates/_helpers.tpl @@ -90,6 +90,10 @@ include all env variables for Zulip pods value: "{{ .Values.zulip.password }}" {{- range $key, $value := .Values.zulip.environment }} - name: {{ $key }} + {{- if kindIs "map" $value }} + {{- toYaml $value | nindent 2 }} + {{- else }} value: {{ $value | quote }} + {{- end }} {{- end }} {{- end }}