Merging Helm Chart Values With Kustomize

A while back, I wrote about using Kustomize and Helm together.

It’s a good strategy to get the best of both worlds. You get the nice developer UX from using Kustomize, at the same time, you can use Helm when templating is useful.

The main reason I advocate for using both is if you want to create a shared, base set of manifests with Helm that you inflate with Kustomize. It’s like extracting out the common parts into a library, which happens to be a helm chart.

One thing I just figured out recently is how to merge values using the helmCharts directive in Kustomize.

I found a repository with a demonstration of how to do it.

It uses a kind: HelmChartInflationGenerator so that you can use Kustomize to merge the values of your helmCharts directive like you would be able to normally.

Without this, you can’t merge the manifests generated by your Helm charts in Kustomize. For example, if I wanted a Kustomize base with a Helm chart, and then only provide the new values in each environment’s overlay, I couldn’t.

You would get an error like this: behavior must be merge or replace.

Join the 80/20 DevOps Newsletter

If you're an engineering leader or developer, you should subscribe to my 80/20 DevOps Newsletter. Give me 1 minute of your day, and I'll teach you essential DevOps skills. I cover topics like Kubernetes, AWS, Infrastructure as Code, and more.

Not sure yet? Check out the archive.

Unsubscribe at any time.