helm: Support valueFrom by setting a dict value in zulip.environment.

This is possibly useful with both `SECRET_...`[^1] and
`SETTING_...`[^2][^3] values.

[^1]: https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/
[^2]: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/
[^3]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/

Co-authored-by: Alex Vandiver <alexmv@zulip.com>
This commit is contained in:
Alessandro Ogier
2025-01-18 22:23:14 +01:00
committed by Alex Vandiver
parent 140a042591
commit d3aee4a418
2 changed files with 17 additions and 0 deletions

View File

@@ -144,6 +144,19 @@ 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 (i.e., a string or
integer), or a projected value from a secret or configmap. For
example:
```yaml
SETTING_EXTERNAL_HOST: zulip.example.com
SECRETS_email_password:
valueFrom:
secretKeyRef:
name: email
key: password
```
### Dependencies
The chart uses Memcached, RabbitMQ and Redis helm charts defined in

View File

@@ -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 }}