File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -704,8 +704,8 @@ kind: Namespace
704704metadata:
705705 name: apps
706706 labels:
707- environment: ${env :=dev}
708- region: "${region }"
707+ environment: ${cluster_env :=dev}
708+ region: "${cluster_region }"
709709` ` `
710710
711711You can specify the variables and their values in the Kustomization definition under
@@ -721,18 +721,21 @@ spec:
721721 path : " ./apps/"
722722 postBuild :
723723 substitute :
724- env : " prod"
725- region : " eu-central-1"
724+ cluster_env : " prod"
725+ cluster_region : " eu-central-1"
726726` ` ` `
727727
728+ Note that you should prefix the variables that get replaced by kustomize-controller
729+ to avoid conflicts with any existing scripts embedded in ConfigMaps or container commands.
730+
728731You can replicate the controller post-build substitutions locally using
729732[kustomize](https://github.com/kubernetes-sigs/kustomize)
730733and Drone's [envsubst](https://github.com/drone/envsubst) :
731734
732735` ` ` console
733736$ go install github.com/drone/envsubst/cmd/envsubst
734737
735- $ export region =eu-central-1
738+ $ export cluster_region =eu-central-1
736739$ kustomize build ./apps/ | $GOPATH/bin/envsubst
737740---
738741apiVersion: v1
You can’t perform that action at this time.
0 commit comments