Skip to content
LF Cert Trainer

Lesson 137 · Section 11: Helm & Kustomize

Lesson 137: Helm vs Kustomize: when to use which, and how to use both

Templates and releases against plain YAML and overlays: what each tool is good at, how to tell which one manages an object you find in a cluster, how to combine them by patching a chart's output, and a quick way to choose in the exam. · 14 min read · 2 min video

Official competency this lesson covers

1/6Helm vs Kustomize
0:00 / 1:42

Narrated by the local narrator voice. Keys: Space plays and pauses, J and L step, C captions, F full screen.

Same problem, opposite answers

Both tools exist because one application needs many slightly different installs. They disagree on how:

Two ways to get from source to clusterTemplates + valuescharthelm upgraderender + recordReleaserevisions, rollbackPlain YAML + kustomizationbase, overlayskubectl apply -ktransform + applyFiles in Githistory, reviewCluster objectssame result
Two ways to get from source to cluster. Helm fills placeholders in templates and tracks the result as a release with revisions. Kustomize starts from complete manifests, transforms them, and leaves tracking to kubectl and whatever stores the files.

Parts:

  • Templates + values (chart)
  • helm upgrade (render + record)
  • Release (revisions, rollback)
  • Plain YAML + kustomization (base, overlays)
  • kubectl apply -k (transform + apply)
  • Files in Git (history, review)
  • Cluster objects (same result)

Connections:

  • Templates + values to helm upgrade
  • helm upgrade to Release
  • Release to Cluster objects
  • Plain YAML + kustomization to kubectl apply -k
  • kubectl apply -k to Files in Git
  • kubectl apply -k to Cluster objects

Side by side

HelmKustomize
InputA chart: templates with {{ }} + values.yamlPlain manifests + kustomization.yaml
How you change thingsValues exposed by the chart authorTransformers and patches on any field
A field the author did not exposeFork the chart, or post-renderJust patch it
Install trackingRelease records in the cluster, helm listNone beyond the objects themselves
Upgrade and rollbackhelm upgrade, helm rollback NApply a new version of the files; roll back by applying the old files (from Git)
Sharing and versioningCharts in repositories and OCI registries, versionedFolders, Git URLs
Where it runsThe helm binaryBuilt into kubectl (-k), or the kustomize binary
Learning curveGo templates for authors; values for usersMostly YAML, a few concepts
Typical useInstalling ingress controllers, CNI, CSI drivers, monitoring, operatorsYour team's apps in dev, staging and prod; GitOps repositories

Neither is "better". Most clusters use both: Helm for cluster components from vendors, Kustomize for the in-house applications, often driven by a GitOps tool such as Argo CD or Flux, which understand both.

Using both

Using both: patch what a chart rendersChart + valuesvendor's packagehelm templateplain YAMLkustomizationyour patchesapply -kpatched objectsPost-renderersame, inside helm
Using both: patch what a chart renders. Render the chart with helm template, then let a kustomization patch the result. With a Helm post-renderer the patch runs inside helm upgrade and the release keeps its history.

Parts:

  • Chart + values (vendor's package)
  • helm template (plain YAML)
  • kustomization (your patches)
  • apply -k (patched objects)
  • Post-renderer (same, inside helm)

Connections:

  • Chart + values to helm template
  • helm template to kustomization
  • kustomization to apply -k
  • helm template to Post-renderer

The common reason to combine them: a chart does not expose a value you need (a toleration, a security context, an annotation). Instead of forking the chart:

mkdir -p metrics && cd metrics
helm template metrics-server metrics-server/metrics-server -n kube-system \
  --set 'args={--kubelet-insecure-tls}' > rendered.yaml
# metrics/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - rendered.yaml
patches:
  - target:
      kind: Deployment
      name: metrics-server
    patch: |-
      - op: add
        path: /spec/template/spec/tolerations
        value:
          - key: node-role.kubernetes.io/control-plane
            effect: NoSchedule
kubectl kustomize . | grep -A3 tolerations
kubectl apply -k .

The trade-off: helm list knows nothing about this install, so upgrades mean rendering again and re-applying. Two ways keep Helm in charge:

  • A post-renderer: helm upgrade --install ... --post-renderer NAME pipes the rendered manifests through a program (in Helm 4, a post-renderer plugin) that can run Kustomize on them. The release, its history and rollback stay intact.
  • Kustomize's helmCharts field does the opposite: the kustomization names a chart, version and values, and kustomize build --enable-helm runs helm template for you. Popular in GitOps repositories; again no Helm release is recorded.

Who manages this object?

Before changing something you find in a cluster, find out what created it. Changing a Helm-managed object with kubectl works until the next helm upgrade, which puts it back.

SignMeans
Label app.kubernetes.io/managed-by: HelmCreated by a Helm release
Annotations meta.helm.sh/release-name, meta.helm.sh/release-namespaceWhich release
Secrets sh.helm.release.v1.* in the namespaceHelm releases live here
Generated names like app-config-7k8f2m9b4cProbably a Kustomize generator
A kustomization.yaml in the task's folderChange the files and apply with -k
managedFields with manager kubectl-client-side-apply or kubectlApplied with kubectl (-f or -k)
kubectl -n shop get deploy --show-labels | grep managed-by
kubectl get secrets -A -l owner=helm

Choosing in the exam

Choosing in the examRead the taskwhat does it name?A chart or repoor a releasekustomization.yamlor overlaysPlain manifestschange per envUse helminstall, upgradeUse apply -kedit the overlayAdd a kustomizationno manifest edits
Choosing in the exam. The task usually decides for you. Look at what it names and what is already there.

Parts:

  • Read the task (what does it name?)
  • A chart or repo (or a release)
  • kustomization.yaml (or overlays)
  • Plain manifests (change per env)
  • Use helm (install, upgrade)
  • Use apply -k (edit the overlay)
  • Add a kustomization (no manifest edits)

Connections:

  • Read the task to A chart or repo
  • Read the task to kustomization.yaml
  • Read the task to Plain manifests
  • A chart or repo to Use helm
  • kustomization.yaml to Use apply -k
  • Plain manifests to Add a kustomization

The task almost always tells you. It names a chart, a repository or a release: use helm. It points at a folder with a kustomization.yaml or overlays: edit those files and use kubectl apply -k. It gives plain manifests and asks for a change per environment "without modifying the original files": write a kustomization next to them.

Example · Two tasks, two tools

"Install the chart traefik from https://traefik.github.io/charts as release edge in namespace ingress, with 2 replicas."

helm repo add traefik https://traefik.github.io/charts && helm repo update
helm show values traefik/traefik | grep -n -i replica
helm install edge traefik/traefik -n ingress --create-namespace --set deployment.replicas=2
helm list -n ingress

"The manifests in /opt/shop/base are used by /opt/shop/overlays/prod. Make production run image tag 2.4.1."

cd /opt/shop/overlays/prod
cat kustomization.yaml          # is there already an images entry?
images:
  - name: registry.local/shop
    newTag: "2.4.1"
kubectl kustomize . | grep image:
kubectl apply -k .

Each tool for its job, and each change made where the next person will look for it.

Tricks

Common mistakes

  • Editing a Helm-managed object with kubectl and seeing the change disappear at the next upgrade.
  • Expecting helm list to show a kustomize install, or kubectl apply -k to give you a rollback command.
  • Forking a chart for one missing field when a Kustomize patch on helm template output would do.
  • Using helm template | kubectl apply -f - for a task that asks for a release: no release is created, and helm list stays empty.
  • Choosing a tool by taste when the task already names one.

Recap

  • Helm: templates + values, packaged and versioned charts, releases with upgrade and rollback.
  • Kustomize: plain YAML transformed by kustomizations, bases and overlays, built into kubectl.
  • Helm for packaged third-party software; Kustomize for your own manifests across environments.
  • Combine with helm template plus a kustomization, a Helm post-renderer, or Kustomize's helmCharts.
  • Check app.kubernetes.io/managed-by and the meta.helm.sh/* annotations, and change an object with the tool that manages it.

Official docs

Quiz: check what you learned

4 questions on this lesson · about 2 min · instant feedback. Missed questions come back in your review queue.

Sign in to take the quiz and keep your score.

Discussion

Learners ask and answer questions here. Sign in to read and join the discussion.