Helm and Kustomize Under Exam Conditions

Topics Covered

Helm on the Exam: Charts, Repositories and Releases

Four words: chart, repository, release, revision

Adding and searching repositories

Looking inside a chart before installing it

The basic install

Where Helm keeps release state

What the grader checks

A two minute warm up before any Helm task

Helm and Kustomize both turn a set of files into Kubernetes objects, and both now sit in the official curricula. The CKAD lists using Helm to deploy existing packages and using Kustomize among its application deployment skills, and the CKA asks you to use Helm and Kustomize to install cluster components. Neither exam expects you to write a chart from scratch. They expect you to install, configure, inspect, upgrade, roll back and remove a release quickly, and to build or apply a Kustomize directory without breaking it. This lesson covers both tools at that level: the commands you will actually type, the fields you will actually edit and the traps that cost points.

You already know from the Containers and Kubernetes course what a Deployment and a Service are. Here the question is only how they get created when someone else has packaged them. The first section sets up the Helm vocabulary and the commands for finding a chart. The second covers values. The third covers the release lifecycle. The last two do the same for Kustomize and then compare the tools under time pressure.

Four words: chart, repository, release, revision

A chart is a directory (or a packaged .tgz of one) that contains a Chart.yaml describing the chart, a values.yaml with default settings, and a templates directory full of Kubernetes manifests with placeholders. A repository is an HTTP server that publishes an index.yaml listing the charts it serves and their versions. Charts can also live in OCI registries, the same kind of registry that stores container images, and you refer to them with an oci:// URL instead of a repository name.

A release is one installed copy of a chart in a cluster, identified by a name and a namespace. You can install the same chart three times under three names, and you get three independent releases. Every time a release changes, through an install, an upgrade or a rollback, Helm records a new revision with a number that only ever goes up. Revisions are what make rollback possible.

A repository serves charts; a chart plus values installed under a name becomes a release.

Helm 3 and later run entirely as a client. There is no in-cluster server component. Helm talks to the API server with your kubeconfig, exactly like kubectl, which means it uses your current context and is bound by your RBAC permissions. If kubectl is pointed at the wrong cluster, so is Helm. The exam task will usually tell you which context to switch to first; do that before any Helm command.

Adding and searching repositories

The exam environment normally has Helm installed and sometimes has repositories already configured. Check before you add anything:

bash
1helm version
2helm repo list
3helm repo add bitnami https://charts.bitnami.com/bitnami
4helm repo update
5helm search repo nginx
6helm search repo bitnami/nginx --versions | head

The repo add command stores a name and URL in your local Helm configuration, and repo update downloads the latest index for every configured repository. Forgetting repo update after adding a repository rarely matters, because add fetches the index once, but it matters when the task says to install a chart version that was published after your cached index. If helm search repo does not show the version you were asked for, run repo update and search again. The repository URLs in this lesson are examples; vendors move them over time (Bitnami, for instance, now publishes mainly to an OCI registry), so always use the URL the task gives.

Note the difference between helm search repo and helm search hub. The first searches the repositories you have added, using your local cache. The second queries Artifact Hub over the internet, which the exam environment may not allow. On the exam, use search repo.

The versions flag lists every chart version the index knows about, with two version columns: CHART VERSION, which is the version of the packaging, and APP VERSION, which is the version of the software inside. A task that says install version 1.2.3 of the chart means the chart version, and you pass it with the version flag. Do not confuse the two; the app version is informational.

Looking inside a chart before installing it

Three show commands answer most questions about a chart without installing anything:

bash
1helm show chart bitnami/nginx      # Chart.yaml: name, version, appVersion
2helm show values bitnami/nginx     # the full default values.yaml
3helm show readme bitnami/nginx     # the chart's own documentation
4helm pull bitnami/nginx --version 18.2.4 --untar   # download and unpack locally

helm show values is the one you will use most. It prints every setting the chart exposes with its default, so you can find the exact key path for a value the task mentions, such as replicaCount, service.type or image.tag. Pipe it into grep, or redirect it to a file and open it in vim. Guessing key paths is the most common Helm mistake on the exam: a misspelled key is silently ignored, the install succeeds and the setting you were asked for never takes effect.

helm pull with untar gives you the chart directory on disk. That is useful when a task asks you to install from a local chart path, or when you want to read a template to see how a value is used. You can then install with a path instead of a repository reference, for example helm install web ./nginx.

The basic install

A minimal install takes a release name, a chart reference and a namespace:

bash
helm install web bitnami/nginx -n shop --create-namespace
helm list -n shop
kubectl get all -n shop

The namespace flag sets where the release record is stored and where namespaced objects are created, unless the chart hard codes a namespace. The create-namespace flag creates the namespace if it does not exist; without it, the install fails on a missing namespace. If the task says the namespace already exists, leave the flag out so you do not mask a typo in the namespace name.

If you do not want to choose a name, generate-name lets Helm pick one, but exam tasks almost always specify the release name, and the grader checks for it. Use the exact name given. A release named web-app is not the release named webapp.

Where Helm keeps release state

Helm stores each revision as a Secret in the release namespace, with type helm.sh/release.v1 and a name such as sh.helm.release.v1.web.v3. The Secret holds a compressed record of the chart, the values and the rendered manifest for that revision. You can see them with kubectl:

bash
kubectl get secrets -n shop -l owner=helm
kubectl get secrets -n shop --field-selector type=helm.sh/release.v1

This explains several behaviours you will meet. helm list only shows releases in the current namespace unless you pass all-namespaces, because the records live in namespaces. Deleting the namespace deletes the release history along with everything else. And if someone deletes those Secrets by hand, Helm forgets the release even though its Deployment is still running, which is one way a later install fails with a name already in use or resource ownership error.

What the grader checks

Helm tasks are usually checked by looking at the cluster, not at your shell history. The grader may run helm list in a namespace and look for a release with a given name, chart and status, or it may look at the objects the release created, such as a Deployment with a certain replica count or a Service of a certain type. So the outcome must be visible in the cluster: the release must be in the named namespace, its status must be deployed, and the setting must have actually taken effect. A habit that costs ten seconds and saves the task: after every Helm command, run helm list in the namespace and one kubectl get on the object the task cares about.

A two minute warm up before any Helm task

When a Helm task appears, a short routine prevents most errors. Read the whole task first and underline the four facts that the grader will check: the release name, the namespace, the chart with its version, and the setting. Switch context. Run helm repo list to see what is already configured, because adding a repository under a second name is harmless but wastes time. Run helm list in the target namespace in case a release with that name already exists from an earlier attempt or a setup script; if it does, the task probably wants an upgrade rather than an install. Only then run show values and start typing. The routine takes under two minutes and it means the actual install is one correct command instead of three attempts.

Context first, then Helm

Helm uses your current kubeconfig context exactly like kubectl. Run the context switch command from the task header before the first helm command, or you will install into the wrong cluster and score nothing.