Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support env vars from an existing secret #482

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kubernetes/chart/zulip/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1. To create a realm so you can sign in:

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "zulip.name" . }}" -o jsonpath="{.items[0].metadata.name}")
kubectl -n {{ .Release.Namespace }} exec -it "$POD_NAME" -c zulip -- sudo -u zulip /home/zulip/deployments/current/manage.py generate_realm_creation_link
kubectl -n {{ .Release.Namespace }} exec -it "$POD_NAME" -c zulip -- sudo -Eu zulip /home/zulip/deployments/current/manage.py generate_realm_creation_link

2. Zulip will be available on:

Expand Down
10 changes: 10 additions & 0 deletions kubernetes/chart/zulip/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,26 @@ include all env variables for Zulip pods
value: "{{ template "common.names.fullname" .Subcharts.rabbitmq }}"
- name: SETTING_REDIS_HOST
value: "{{ template "common.names.fullname" .Subcharts.redis }}-headless"
{{- if .Values.rabbitmq.auth.password }}
- name: SECRETS_rabbitmq_password
value: "{{ .Values.rabbitmq.auth.password }}"
{{- end }}
{{- if .Values.postgresql.auth.password }}
- name: SECRETS_postgres_password
value: "{{ .Values.postgresql.auth.password }}"
{{- end }}
{{- if .Values.memcached.memcachedPassword }}
- name: SECRETS_memcached_password
value: "{{ .Values.memcached.memcachedPassword }}"
{{- end }}
{{- if .Values.redis.auth.password }}
- name: SECRETS_redis_password
value: "{{ .Values.redis.auth.password }}"
{{- end }}
{{- if .Values.zulip.password }}
- name: SECRETS_secret_key
value: "{{ .Values.zulip.password }}"
{{- end }}
{{- range $key, $value := .Values.zulip.environment }}
- name: {{ $key }}
value: {{ $value | quote }}
Expand Down
5 changes: 5 additions & 0 deletions kubernetes/chart/zulip/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ spec:
mountPath: /data/post-setup.d
env:
{{ include "zulip.env" . | nindent 12 }}
{{- if .Values.zulip.secretEnvironment }}
envFrom:
- secretRef:
name: {{ .Values.zulip.secretEnvironment }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.livenessProbe.enabled }}
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/chart/zulip/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ zulip:
SETTING_EMAIL_USE_SSL: "False"
SETTING_EMAIL_USE_TLS: "True"
ZULIP_AUTH_BACKENDS: "EmailAuthBackend"
## An existing secret from which populate environment variablgwes.
secretEnvironment: ""
## If `persistence.existingClaim` is not set, a PVC (Persistent
## Volume Claim) is generated with these specifications.
persistence:
Expand Down