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

Environment variables? #1

Closed
ajoslin opened this issue Mar 14, 2017 · 3 comments
Closed

Environment variables? #1

ajoslin opened this issue Mar 14, 2017 · 3 comments

Comments

@ajoslin
Copy link

ajoslin commented Mar 14, 2017

It would be awesome if Helmfile could cause Charts.yml to interpolate environment variables.

I currently have my project's deployment in a chart directory in my repo. I pass environment variables in via set:

helm upgrade my-project-$NODE_ENV ./kubernetes/my-project/ \
     --set namespace=$NODE_ENV \
     --set web.imageName=$WEB_NAME \
     --set api.imageName=$API_NAME \
     --set env.dockerRepoUrl=$DOCKER_REPO_PREFIX \
     --set env.dockerImageTag=$DOCKER_REPO_TAG \
     --set env.hostname=$NODE_ENV.$KUBERNETES_HOST \
     --install --debug

This is just about the only imperative part of my build step. I'd love to move it into the Helmfile format, but it'd be nice not to have to add a step to run my Helmfile through envsubst.

What do you think of the idea of Helmfile doing environment variable substitution on its own?

@roboll
Copy link
Owner

roboll commented Mar 19, 2017

I'm not quite convinced this is a good idea, but it would be relatively simple to template the file. One of the things I like most about the current approach is having everything encoded in the helmfile.

I'm not using kubernetes much right now though, so if you think this is a worthy change and can't think of a way to do it without env vars in the file, feel free to submit a pr and I'll accept.

Running it through text/template with a env function would let you have something like {{ env "KEY" "fallback-value" }} maybe.

@natevecc
Copy link
Contributor

I created #2 to address my need for environment variable support. It doesn't do anything fancy with text/template but instead exposes a way for the Chart.yaml file to grab them from the current execution context. Interested in your feedback.

@roboll
Copy link
Owner

roboll commented Apr 12, 2017

This is available in v0.4.

raxod502-plaid pushed a commit to raxod502-plaid/helmfile that referenced this issue Jun 30, 2022
…tions (roboll#1)

* introduce DISABLE_INSECURE_FEATURES to disable insecure executions

Signed-off-by: Quan TRAN <account@itscaro.me>

* disable remote sources when DISABLE_INSECURE_FEATURES is set to "true"

Signed-off-by: Quan TRAN <account@itscaro.me>

* refactor envvar package

Signed-off-by: Quan TRAN <account@itscaro.me>

* (test) fix test fixtures

Signed-off-by: Quan TRAN <account@itscaro.me>

* use absolute path to avoid unit test failure

Signed-off-by: Quan TRAN <account@itscaro.me>

* Fix conflicts

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
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

No branches or pull requests

3 participants