k8wiz
Flux CD
Medium
Concepts

How do you substitute a per-cluster value such as ${cluster_region} into the manifests a Flux Kustomization applies?

Select your answer:

Show answer and explanation

Answer: With spec.postBuild.substitute, or substituteFrom a ConfigMap or Secret

Explanation

After building the manifests, kustomize-controller replaces ${var} with values from postBuild.substitute or from the ConfigMaps and Secrets in substituteFrom. ${var:=default} sets a fallback for a missing variable.