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.


Master GitHub Actions with a Senior Infrastructure Engineer

As a senior staff infrastructure engineer, I share exclusive, behind-the-scenes insights that you won't find anywhere else. Get the strategies and techniques I've used to save companies $500k in CI costs and transform teams with GitOps best practices—delivered straight to your inbox.

Not sure yet? Check out the archive.

Unsubscribe at any time.