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

easy way to get environment variables from a ConfigMap #724

Open
dhduvall opened this issue Apr 29, 2022 · 0 comments · May be fixed by #866
Open

easy way to get environment variables from a ConfigMap #724

dhduvall opened this issue Apr 29, 2022 · 0 comments · May be fixed by #866
Labels
enhancement New feature or request

Comments

@dhduvall
Copy link

Is your feature request related to a problem? Please describe.
I want to configure some things in Vault by using environment variables that differ between instances. These are not secrets, so they don't belong in server.extraSecretEnvironmentVars, but I also don't want to hard-code them into values.yaml in server.extraEnvironmentVars, or have to put them on the command-line with --set each time I deploy.

Describe the solution you'd like
My preference would be to put the variables into a ConfigMap and have the Vault Helm chart pull from that. For instance, the Datadog Helm chart lets you do this:

envFrom:
- configMapRef
  name: config-map-name

where

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-map-name
data:
  ENV_VAR_1: value_1
  ENV_VAR_2: value_2

Describe alternatives you've considered
Put the HCL that configures the same thing into a ConfigMap, mount it, and point Vault at that. This should work, but is also much more verbose. For example,

volumes:
  - name: extra-env
    configMap:
      name: extra-env
      items:
        - key: config
          path: config.hcl

volumeMounts:
  - mountPath: /vault/userconfig/extra-env
  - name: extra-env

extraArgs: "-c /vault/userconfig/extra-env/config.hcl"

and if there's any reason why merging that config file with the main one doesn't do what you want, then you're out of luck. For instance, what happens if you've got multiple storage stanzas, each with a different part of the config?

@dhduvall dhduvall added the enhancement New feature or request label Apr 29, 2022
mikutas added a commit to mikutas/vault-helm that referenced this issue Apr 4, 2023
@mikutas mikutas linked a pull request Apr 4, 2023 that will close this issue
mikutas added a commit to mikutas/vault-helm that referenced this issue Apr 4, 2023
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