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

helm: add the posibility to add external secrets as env variables #465

Open
wants to merge 4 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
7 changes: 7 additions & 0 deletions kubernetes/chart/zulip/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ spec:
mountPath: /data/post-setup.d
env:
{{ include "zulip.env" . | nindent 12 }}
{{- if .Values.zulip.envSecrets }}
envFrom:
{{- range .Values.zulip.envSecrets }}
- secretRef:
name: {{ . }}
{{- end }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.livenessProbe.enabled }}
Expand Down
20 changes: 20 additions & 0 deletions kubernetes/chart/zulip/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ zulip:
SETTING_EMAIL_USE_SSL: "False"
SETTING_EMAIL_USE_TLS: "True"
ZULIP_AUTH_BACKENDS: "EmailAuthBackend"
# -- Mount environment variables from secrets. Use the secret name.
# If you have a secret with env. variables created named zulip-secrets
# you will add:
# ```
# envSecrets:
# - zulip-secrets
# - other-secrets
# The secrets file you manually create in the namespace, can look something
# like this (secrets need to be base64 encoded):
# ---
# apiVersion: v1
# kind: Secret
# metadata:
# name: zulip-secrets
# type: Opaque
# data:
# SECRETS_email_password: MTIzNDU2Nzg5
# SECRET: Zm9vaXNiYXI=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the SECRET one do -- is the point that it's not passed into zulip-secrets, or is it? I feel like the documentation needs to be clearer about how to interpret this example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, I will add better example.

envSecrets:
[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it useful/necessary to have the [] here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the newline?

There is a mix of practice of this.

This:

  envSecrets:
    []

And this:

  envSecrets: []

Have the same meaning, but I like the first one better - because it also indicates that the values that it is entered should be on a new line:

  envSecrets:
    - secret_ONE: ERTY
    - secret_TWO: YTRE

So I think it helps the user.

But as there are mix of standards in the helm chart, like:

podSecurityContext:
  {}

And

podAnnotations: {}

There should be maybe a consensus around what should be used. I like the newline myself, as I think it helps to guide the user.

# -- If `persistence.existingClaim` is not set, a PVC is generated with these
# specifications.
persistence:
Expand Down