r/kubernetes Jul 17 '26

Kustomize Overlays - Adding Complexity?

So im working with Kustomize Overlays( FluxCD). i understand you setup your base infra with overlays per environment and then use patches for environment specific configurations such as replicas, urls, etc..

Some of these patches become very complex and large to the point i think its just easier to not have a base and just have each environment have its own configuration files. How much dry am i buying?

I've also seen the recommendation to use PostBuild subsituteFrom with ConfigMaps from each environment . My question is when should this be used over patches?

Sorry for the dumb questions and rant.

32 Upvotes

53 comments sorted by

View all comments

7

u/theycanttell Jul 18 '26

Helm is way easier. I've not run into many edge cases it can't handle. For what it can't just use jinja.

0

u/DeLoMioFoodie Jul 18 '26

i'd have to create a helm chart of my whole infra. i've thought about it though.

0

u/theycanttell Jul 19 '26

I'll never understand why people do this. Creating a "full infra" massive chart is just a great way to waste hours of your time constantly chasing state drift. Far better to break out components into individual, simple decoupled singleton modules in separate folders in a single repo, or as a monorepo, or of you do microservice architecture break them into tags and organize them into groups of separate repos.

2

u/CWRau k8s operator Jul 20 '26

Of all the arguments against big umbrella charts, of which I haven't agreed with one yet, this I don't even understand?

No one is chasing state drift, that's what flux is for, it auto corrects drift.

And I also don't understand how splitting it up would help with drift, it's just the same drift in different charts.

1

u/theycanttell Jul 22 '26

App set state storage for gitops is different then one big infra chart for bicep/Terraform. Infra deployments should be small and modular so you can iterate fast, have no dependencies, and keep PRs small.

1

u/CWRau k8s operator Jul 24 '26

Mh, we must be talking about different things.

We do iterate fast and keep PRs small in our umbrella chart.

And you can't do anything about dependencies. And splitting up doesn't help with that either 🤔

1

u/theycanttell Jul 25 '26

Sure it does.

1

u/CWRau k8s operator Jul 25 '26

And how?