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

Allow extending env value more easily #958

Closed
2 tasks done
jnoordsij opened this issue Nov 7, 2023 · 5 comments · Fixed by #1213
Closed
2 tasks done

Allow extending env value more easily #958

jnoordsij opened this issue Nov 7, 2023 · 5 comments · Fixed by #1213
Labels
good first issue Good for newcomers kind/enhancement New feature or request

Comments

@jnoordsij
Copy link
Collaborator

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you expect to see?

Currently the env key in the values file is a list. This means that it is not easily extendable, since Helm will overwrite list values when set, rather than merging them. This means that when one wants to pass an additional env variable, e.g. TZ=US/Alaska, the entire list contained in this repo has to be copied and passed with it, or else will get lost:

  env:
    # This has to be copied (current values.yaml content)
    - name: POD_NAME
      valueFrom:
        fieldRef:
          fieldPath: metadata.name
    - name: POD_NAMESPACE
      valueFrom:
        fieldRef:
          fieldPath: metadata.namespace
    # Custom additions can then be placed afterwards
    - name: TZ
      value: US/Alaska

It would be nice to have another value type, e.g. key-based, for the environment, so Helm can properly merge it. This can then be parsed into the correct format within the relevant templates.

Suggested implementation: the approach on the following StackExchange question might be a good place to start:
https://stackoverflow.com/questions/59394422/helm-charts-with-multiple-lists-in-multiple-values-files

@mloiseleur
Copy link
Contributor

\o Yes you're right !
We didn't think about it when we added those two fields.

@lusson-luo
Copy link

lusson-luo commented Nov 13, 2023

@mloiseleur

so, what is next, values.yaml add two env config, default_env and custom_env?default_env include POD_NAME and POD_NAMESPACE

@mloiseleur mloiseleur added the good first issue Good for newcomers label Nov 14, 2023
@mloiseleur
Copy link
Contributor

@lusson-luo The next step is to open a PR to fix this issue. @jnoordsij shared a stackoverflow link with what seems an easy way to fix it.

@shubhamch71
Copy link

@mloiseleur Is this issue still open to work on??

@mloiseleur
Copy link
Contributor

Yes it is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants