Hacker News new | ask | show | jobs
by degenerate 913 days ago
Any advice/ideas/articles/references on using kustomize efficiently?

I love the idea of using a tool bundled with kubectl for zero dependencies, but their examples and tutorials are horrible. I can't figure out how to use it correctly to have 1 copy of YAML that would deploy to 5 different environments. It seems I would need multiple copies of kustomization.yaml in multiple folders, if I have multiple namespaces/pods/etc...

3 comments

The model is base yaml with patches applied to it results in final yaml that get sent to the api, so the typical structure for us is to have the base yaml live with the service source, be maintained by the service owners and include all environment-agnostic properties. We then have one folder per targeted environment for that service which includes any patches and the kustomization.yaml manifest. Basically in line with what other replies have mentioned.
Thanks everyone that replied, I thought I was doing something wrong!
Not a kustomize expert - but yes, you likely would have a folder for each thing you target.

It wasn't bad once I got through the docs / examples. They just assume so much existing knowledge I didn't have.

We use kustomize with multiple copies of kustomization.yaml and I don't know if there is a way to do it without that. Basically, there's a base kustomization.yaml and then there's test/kustomization.yaml, prod1/kustomization.yaml, prod2/kustomization.yaml, and so on.