Skaffold: Support reading environment variables passed to skaffold from file (e.g. .env)

Created on 5 May 2020  路  4Comments  路  Source: GoogleContainerTools/skaffold

Considering skaffold could use environment variables to populate templated fields - https://skaffold.dev/docs/environment/templating/, it would super convenient to have the ability to pass environment variables to skaffold from file - similar to (or the same as) how docker-compose does that.

Originally, this feature request just got lost here - https://github.com/GoogleContainerTools/skaffold/issues/543.

areconfig areenv-vars help wanted kinfeature-request prioritp2

Most helpful comment

when we shut down https://github.com/GoogleContainerTools/skaffold/pull/1458 last year, I think we were a bit closed-minded on our stance to templating as a whole, in that we were strictly against it in skaffold. over time, I think our opinion on this has relaxed: there are scenarios in which introducing environment variables into the skaffold pipeline can still fit in with our principles on the tool, and I think this issue is one of them. we don't want to allow full-blown templating of the skaffold.yaml and k8s resources (e.g. Jinja). however, we recognize that using env vars in build and deploy configuration can be a common use case, especially in CI/CD workflows, and we don't want to shut these use cases down completely.

tl;dr - our stance on supporting this feature in skaffold has changed, and while we probably won't prioritize it ourselves, we'd be open to a contribution if anyone is interested.

All 4 comments

+1

when we shut down https://github.com/GoogleContainerTools/skaffold/pull/1458 last year, I think we were a bit closed-minded on our stance to templating as a whole, in that we were strictly against it in skaffold. over time, I think our opinion on this has relaxed: there are scenarios in which introducing environment variables into the skaffold pipeline can still fit in with our principles on the tool, and I think this issue is one of them. we don't want to allow full-blown templating of the skaffold.yaml and k8s resources (e.g. Jinja). however, we recognize that using env vars in build and deploy configuration can be a common use case, especially in CI/CD workflows, and we don't want to shut these use cases down completely.

tl;dr - our stance on supporting this feature in skaffold has changed, and while we probably won't prioritize it ourselves, we'd be open to a contribution if anyone is interested.

Interesting.... we need such feature too!

Was this page helpful?
0 / 5 - 0 ratings