Skip to content

Is there any way to use environment variables in kustomization patches? #4179

Answered by makkes
devantler asked this question in Q&A
Discussion options

You must be logged in to vote

You can't feed environment variables into Kustomizations (how would kustomization-controller get them?) but you can use post-build substitutions: https://fluxcd.io/flux/components/kustomize/kustomization/#post-build-variable-substitution. This lets you either create multiple Kustomizations with pre-defined .spec.postBuild.substitute values or use a single Kustomization with .spec.postBuild.substituteFrom and create ConfigMaps for each environment.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@devantler
Comment options

Answer selected by devantler
Comment options

You must be logged in to vote
1 reply
@stefanprodan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants