Skip to content

Commit

Permalink
Add flux envsubst example to docs
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Apr 8, 2024
1 parent 1837d1c commit f8ace6f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docs/spec/v1/kustomizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ kind: Kustomization
metadata:
name: apps
spec:
interval: 5m
path: "./apps/"
# ...omitted for brevity
postBuild:
substitute:
cluster_env: "prod"
Expand Down Expand Up @@ -629,6 +628,7 @@ kind: Kustomization
metadata:
name: apps
spec:
# ...omitted for brevity
postBuild:
substitute:
var_substitution_enabled: "true"
Expand All @@ -640,13 +640,11 @@ enclosed in double quotes vars to be treated as strings, for more information se

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):
and the Flux CLI:

```console
$ go install github.com/drone/envsubst/cmd/envsubst
$ export cluster_region=eu-central-1
$ kustomize build ./apps/ | $GOPATH/bin/envsubst
$ kustomize build ./apps/ | flux envsubst --strict
---
apiVersion: v1
kind: Namespace
Expand Down

0 comments on commit f8ace6f

Please sign in to comment.