Skip to content

feat: add envFrom value to Helm chart #9587

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

Merged
merged 4 commits into from
Sep 19, 2023
Merged

feat: add envFrom value to Helm chart #9587

merged 4 commits into from
Sep 19, 2023

Conversation

ericpaulsen
Copy link
Member

@ericpaulsen ericpaulsen commented Sep 7, 2023

this PR adds support for the coder.envFrom value to the Helm chart. this will allow for Coder's environment variables to be passed from a single secret.

i'm pushing this in draft mode, because there is one caveat; the $hasAccessURL variable cannot identify if CODER_ACCESS_URL is set in the secret, so it will always default to the cluster-internal URL unless the access URL is specified using the traditional coder.env variable.

ideally, we parse the vars from the secret and pass them into the existing containers.env section in the template, but I have not gotten this to work. something akin to:

{{ if .Values.coder.envFrom }}
{{- range $secretKey, $secretValue := .Values.coder.envFrom }}
# Handle the coder.envFrom case
{{- range $key, $value := dict $secretValue }}
- name: {{ $key.name }}
  value: {{ $value | b64dec | quote }}
{{- end }}
{{- end }}
{{- end }}

@ericpaulsen ericpaulsen self-assigned this Sep 7, 2023
@ericpaulsen ericpaulsen marked this pull request as draft September 7, 2023 20:23
Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

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

w.r.t the CODER_ACCESS_URL being automatically set, you could just put that behind a new value too like coder.useClusterAccessURL or something

@ericpaulsen ericpaulsen marked this pull request as ready for review September 13, 2023 15:34
Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

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

Please add a test that uses this with a new golden file

Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

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

LGTM but I contributed so I won't approve

@ericpaulsen ericpaulsen enabled auto-merge (squash) September 15, 2023 20:16
@ericpaulsen ericpaulsen merged commit e9c183d into main Sep 19, 2023
@ericpaulsen ericpaulsen deleted the helm-envFrom-value branch September 19, 2023 12:03
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants