Helm vs Kustomize

Helm fills templates with values and tracks releases you can roll back; Kustomize patches plain YAML with overlays and keeps no state. How each works, the same change made both ways, how to use them together, and which to choose.

GazeekHEAD TO HEAD·EPISODE 4
EPISODE 4

Helm vs Kustomize

Helm fills templates with values and tracks releases you can roll back; Kustomize patches plain YAML with overlays and keeps no state. How each works, the same change made both ways, how to use them together, and which to choose.

0:00 / 5:33

Diagrams in this video · 3Free in archhy

Copy and edit in archhy: Templates, or patches (new tab)
Copy and edit in archhy: Using them together (new tab)
Copy and edit in archhy: The decision: two questions (new tab)

After this lesson you can

  • Explain how Helm and Kustomize each get YAML into a cluster
  • Compare them on customizing, state, hooks, distribution and tooling
  • Choose Helm, Kustomize or both for third-party software, your own app and the exam
Transcript

Helm vs Kustomize

G'day. Space Llama here, with Head to Head, where two tools meet and you decide. Today, Helm versus Kustomize. Both answer one question: how do I deploy one app to several environments without copying YAML? One fills templates. The other patches plain YAML.

Templates, or patches

Helm first, on the left. A chart is a folder of Go templates, with a Chart dot yaml file. You pass in values: the chart's defaults, plus your own file, like prod values. Helm upgrade, dash dash install, fills the templates and applies the result. Then it records a revision in the cluster. That's why helm history and helm rollback work. Kustomize, on the right. The base is plain, valid YAML. No templates at all. A production overlay lists only what's different: replicas, the image tag, a patch. Kubectl apply dash k patches the YAML and applies it. Kustomize is built into kubectl, so there's nothing to install. And it keeps no state. To roll back, you apply an older commit.

The same change, both ways

Now one change, made both ways. Production needs three replicas and a different image tag. With Helm, the chart must expose those as values. Most do, so you set them in a prod values file. With Kustomize, the overlay states the change directly, against plain YAML. Then production needs a toleration the chart author never thought of. With Helm's values alone, you hope there's a tolerations value, or you fork the chart. Hope is not a deployment strategy. With Kustomize, you write a patch. That's the main reason people put Kustomize on top of Helm.

Side by side

Side by side, then. Helm writes YAML from templates. Kustomize edits YAML that already exists. Customizing: Helm's values change only what the chart author exposed. Kustomize can patch any field of any resource. State: Helm stores release revisions in the cluster, the last ten by default. Kustomize keeps none. Hooks: Helm has pre-install, pre-upgrade and the rest. Kustomize has none, so you use Jobs and your pipeline. Sharing: Helm charts are published in repositories and container registries, with versions and dependencies. Kustomize bases are folders, usually in Git. And Helm is a separate binary. Kustomize is already in kubectl.

Using them together

Many teams use both. There are two common ways. The first way: render, then patch. Helm template renders the chart to a file, and that file becomes a Kustomize base. Everything that reaches the cluster is in Git, where you can review it. The catch: it's not a Helm release. No helm history, no helm rollback, and the chart's hooks become ordinary resources, with no lifecycle timing. The second way: let Kustomize call Helm. The helm charts field renders a chart at build time. You need the helm binary and the enable helm flag. Pin a version, or each build may pull a newer chart. Argo CD, a continuous delivery tool, can apply this pattern too. Same trade-off: Kustomize's patching, but no Helm release.

The decision: two questions

So which one? Two questions settle most cases. Is it software you install but don't write, like an ingress controller, cert-manager or monitoring? Helm. The vendor's chart is the supported install path. Add Kustomize on top only for a change the chart doesn't expose. Your own app? Start with Kustomize if one team deploys it to a few environments. No templates to debug. Move to a Helm chart when other teams or customers install it with their own settings, or you want versioned charts in a registry, or lifecycle hooks.

For the exam: both

And the exam? Both. The CKA, Certified Kubernetes Administrator, asks you to use Helm and Kustomize to install cluster components. The CKAD, Certified Kubernetes Application Developer, covers Helm packages and Kustomize under Application Deployment. Expect to install, upgrade or roll back a release, and to apply an overlay with kubectl apply dash k. Practice the commands until you can type them without looking them up. Faster than a llama in low gravity.

Recap

Recap. Helm fills templates and tracks releases you can roll back. Kustomize patches plain YAML and keeps no state. Software you install? Helm. Your own app, one team? Start with Kustomize. Need a change the chart doesn't expose? Use both.

Practice and what's next

The full comparison, with the same change made both ways, is on gazeek.com. The link is in the description. To feel the difference, the lab Ship it two ways, in Gazeek Labs, has you ship one app with Helm and another with Kustomize on a real cluster. Every diagram here opens in archhy, from the description too. That's Head to Head. Two tools went in. You picked the winner. See you next time. More videos on the channel. Alpaca Mango. I'll be there. I'm always there. Mate.

Gazeek Flash · free

Exam questions on your phone

Free questions on Application Deployment: quick-fire batches and timed exams, on the web or Android.