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

Render extraEnvs so it can be configured with templated values #403

Open
NeodymiumFerBore opened this issue Oct 31, 2024 · 0 comments · May be fixed by #405
Open

Render extraEnvs so it can be configured with templated values #403

NeodymiumFerBore opened this issue Oct 31, 2024 · 0 comments · May be fixed by #405
Labels
enhancement New feature or request

Comments

@NeodymiumFerBore
Copy link

NeodymiumFerBore commented Oct 31, 2024

Proposed functionality

Render the .Values.extraEnvs list so we can use templated values in it.

Use case

This feature would solve the issue exposed in this example Values. When deploying "extra" resources, we cannot reference their name in extraEnvs by using the templated form.

extraDeploy:
- |
  apiVersion: v1
  kind: Secret
  metadata:
    # templated name, for multi-env portability
    name: {{ include "common.secrets.name" (dict "defaultNameSuffix" "extra-env" "context" $) }}
    labels: {} # omitted
  type: Opaque
  data:
    CUSTOM_SECRET: {{ .Values.CUSTOM_SECRET | b64enc | quote }}

# This would be set from command line
CUSTOM_SECRET: mySuperPassword

extraEnvs:
- name: CUSTOM_SECRET
  valueFrom:
    secretKeyRef:
      name: how do we reference it without hardcoding the Release name here?
      key: CUSTOM_SECRET

This problem can be worked around by variabilizing the secret name, but then we must "not forget" to update it from an environment to another. Implementing this feature request would allow to write:

extraEnvs:
- name: CUSTOM_SECRET
  valueFrom:
    secretKeyRef:
      name: '{{ include "common.secrets.name" (dict "defaultNameSuffix" "extra-env" "context" $) }}'
      key: CUSTOM_SECRET
@NeodymiumFerBore NeodymiumFerBore added the enhancement New feature or request label Oct 31, 2024
LeoColomb added a commit that referenced this issue Nov 1, 2024
LeoColomb added a commit that referenced this issue Nov 1, 2024
Also add `extraEnvVarsCM` and `extraEnvVarsSecret` as shortcuts
to gather vars from CM or Secret directly.

Resolves #403
LeoColomb added a commit that referenced this issue Nov 1, 2024
Also add `extraEnvVarsCM` and `extraEnvVarsSecret` as shortcuts
to gather vars from CM or Secret directly.

Resolves #403
@LeoColomb LeoColomb linked a pull request Nov 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant