News for hackers. Stuff that matters.
Re:How we migrated onto K8s in less than 12 months by stackskipton on Thursday August 08, 2024 @06:11PM (#41196890)
Lack of Variable substitution in Kustomize is downright frustrating. We use Flux so we have the feature anyways, but I wish it was built into Kustomize.
Re:How we migrated onto K8s in less than 12 months by no_circuit on Friday August 09, 2024 @12:37PM (#41203374)
I don't miss variable substitution at all.

For my setup anything that needs to be variable or secret gets specified in a custom json/yaml file which is read by a plugin which in turn outputs the rendered manifest if I can't write it as a "patch". That way the CI/CD runner can access things like the resolved secrets for production without being accessible by developers without elevated access. It requires some digging but there are even annotations that can be used to control things like if Kustomize should add a hash suffix or not to ConfigMap or Secret manifests you generate with plugins.

Re:How we migrated onto K8s in less than 12 months by hronecviktor on Sunday August 11, 2024 @04:56PM (#41219258)
Trivial to work around using _envsubst_ utility (part of _gettext_). If you write something like: name: app-$KUSTOMIZE_NAMESPACE and run `kubectl kustomize | envsubst "$(printf '${%s} ' ${!KUSTOMIZE_} ${!CI_} ${!GITLAB_*})" | kubectl apply -f -` it will substitute the env vars that match the wildcard.