Helm and Kustomize better together

By on ・ Helm et Kustomize fonctionnent mieux ensemble ・

TL; DR

To patch an Helm chart without modifying manually the template, you can combine Kustomize’s patch transformer and Helm chart generator .

The premise

I guess like every other Helm charts, the Dell CSM Helm charts see more and more variables being templatized.

This has proven to be challenging to maintain and a burden for users who want to customize original Helm charts.

For example, here the contributor needs to control the priority and preemption of the CSI Driver for PowerScale Pod and pushed for a change.

Making that change in this Helm chart means for the maintainer of the repository to propagate that change in every other Helm charts (no less than 14 at the time of the writing) and of course document the new variables.

The solution

Instead of waiting for a change to be released in the official chart we can use Kustomize to install a patched Helm chart.

In this case, we need to use the:

  • The helmCharts generator to configure the deployment of the driver use the public repository
  • The patches transformer to add the priorityClassName to the rendered files

Once we have the files ready, we can render the Helm chart with the kustomize build --enable-helm . . It creates a charts directory you can use for installation with kubectl apply -f charts.

Conclusion

Kustomize is a bliss to easily patch deployment and it the same trick can be used at scale with a GitOps agent like Flux or Argo CD.

This is indeed better to combine it with a GitOps agent since, by using Helm for template rendering and kubectl to apply the configuration we lose all the Helm features like helm ls, helm uninstall, helm update, etc.

Sources