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

env map value #485

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

env map value #485

wants to merge 1 commit into from

Conversation

aogier
Copy link
Contributor

@aogier aogier commented Jan 19, 2025

Ciao, this PR exploits the possibilities of kubernetes to more richly express secrets in the environment by using secrets/configmap projections.
It is inobtrusive as it only mangle maps leaving any other value alone.

helm template zulip . \
  --set zulip.environment.SECRETS_email_password=password \
  --set-json zulip.environment.SECRETS_password='
    {"valueFrom":{"secretKeyRef":{"name": "secret", "key": "key"}}}' \
  -s templates/statefulset.yaml \
| yq -Y '.spec.template.spec.containers[] .env[] 
         | select((.name=="SETTING_EXTERNAL_HOST") 
                  or .name=="SECRETS_password")'

- name: SECRETS_email_password
  value: "password"
- name: SECRETS_password
  valueFrom:
    secretKeyRef:
      key: key
      name: secret

This easily unlocks the possibility to specify existing secrets in env vars without defining a dedicated one and going the #482 way. It does not breaks current workflow, but enable whoever want to do that to have it :)

Hope this helps, ciao!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant