Skip to content

Commit

Permalink
Add note about prefixing variables
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Feb 11, 2021
1 parent f694414 commit 812ec14
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/spec/v1beta1/kustomization.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,8 @@ kind: Namespace
metadata:
name: apps
labels:
environment: ${env:=dev}
region: "${region}"
environment: ${cluster_env:=dev}
region: "${cluster_region}"
```

You can specify the variables and their values in the Kustomization definition under
Expand All @@ -721,10 +721,13 @@ spec:
path: "./apps/"
postBuild:
substitute:
env: "prod"
region: "eu-central-1"
cluster_env: "prod"
cluster_region: "eu-central-1"
````

Note that you should prefix the variables that get replaced by kustomize-controller
to avoid conflicts with any existing scripts embedded in ConfigMaps or container commands.

You can replicate the controller post-build substitutions locally using
[kustomize](https://github.com/kubernetes-sigs/kustomize)
and Drone's [envsubst](https://github.com/drone/envsubst):
Expand Down

0 comments on commit 812ec14

Please sign in to comment.