CKA prep, by exam domain · Lesson 7 of 12 · about 55 minutes

Helm, Kustomize and CRDs

Installing and extending the cluster: install, upgrade, roll back and render a Helm chart, build environments from a Kustomize base and overlay, then create a custom resource type of your own and watch the API server validate it. Plus where the runtime, network and storage plugins fit.

Exam domain: Cluster architecture, installation and configuration · 25% of the exam

By the end you'll know

  • What Helm is for, and how charts, values, releases and revisions fit together
  • How to install, upgrade, roll back, render and remove a chart
  • Why helm upgrade can quietly drop a setting, and how to stop it
  • How Kustomize builds each environment from a base and an overlay, with no templates
  • What a CRD is, how to make one, and what it does and doesn't do
  • Where the container runtime, network and storage interfaces fit

Before you start

  • You need: the cluster from Lesson 2, all nodes Ready.
  • Internet access on cp1: Helm and a chart are downloaded.
  • The output below is from real runs on November 27, 2026, in New York, on an Apple silicon Mac.

These three were added to the exam's Cluster Architecture domain (25%) in 2025, so older study guides often skip them. They're also how most software really gets into clusters.

Helm: a package manager for Kubernetes

Helm does three jobs:

  • Packaging: all the YAML an app needs, bundled into one chart and installed as a unit.
  • Templating: the chart's YAML has gaps, filled in per install from values, so one chart works anywhere.
  • Release history: every install and upgrade is a numbered revision, which you can roll back to.
WordMeans
ChartThe package: Chart.yaml (name and versions), values.yaml (default settings) and templates/ (YAML with gaps)
ValuesThe settings that fill the gaps
ReleaseOne installed copy of a chart, with a name you choose
RevisionOne version of a release: install is 1, each upgrade or rollback adds one
ManifestThe finished YAML, gaps filled, that Helm sends to the API server

Helm is a client, like kubectl. It reads the same ~/.kube/config and talks to the API server. Nothing of Helm's runs in the cluster.

Install Helm

(cp1)

BASH
HELM_VER=v4.3.1
ARCH=$(dpkg --print-architecture)
cd /tmp
curl -fsSLO https://get.helm.sh/helm-${HELM_VER}-linux-${ARCH}.tar.gz
curl -fsSLO https://get.helm.sh/helm-${HELM_VER}-linux-${ARCH}.tar.gz.sha256sum
sha256sum -c helm-${HELM_VER}-linux-${ARCH}.tar.gz.sha256sum
  • get.helm.sh: Helm's official download host. The .sha256sum file holds the expected checksum.
OUTPUT
helm-v4.3.1-linux-arm64.tar.gz: OK
BASH
tar -xzf helm-${HELM_VER}-linux-${ARCH}.tar.gz
sudo install linux-${ARCH}/helm /usr/local/bin/
helm version
cd ~
OUTPUT
version.BuildInfo{Version:"v4.3.1", GitCommit:"c0d08d0d6d9424d4a14febb5e8a3e51b0dd00dff", GitTreeState:"clean", GoVersion:"go1.27.2", KubeClientVersion:"v1.37"}

KubeClientVersion:"v1.37": Helm carries kubectl's client code, matched to your cluster. On a machine you didn't set up, check with helm version before installing it.

Find a chart and look before installing

We'll use podinfo, a small demo web app made for exactly this kind of practice:

BASH
helm repo add podinfo https://stefanprodan.github.io/podinfo
helm repo update
helm search repo podinfo
helm show values podinfo/podinfo | head -25
  • repo add NAME URL: registers a chart repository under a nickname you choose, like adding a source to apt.
  • repo update: downloads the repository's current chart list.
  • podinfo/podinfo: REPO/CHART. Your nickname for the repository, then the chart's name inside it. One-chart projects often name both the same, like ingress-nginx/ingress-nginx; a repo with many charts reads like bitnami/redis.
  • show values: the chart's defaults, every one of which you can override.
OUTPUT
# Default values for podinfo.

replicaCount: 1
logLevel: info
...
image:
  repository: ghcr.io/stefanprodan/podinfo
  tag: 6.17.0
  pullPolicy: IfNotPresent
...
ui:
  color: "#34577c"
  message: ""

Install

BASH
k create ns helm-lab
helm install web podinfo/podinfo -n helm-lab --set replicaCount=2
helm list -n helm-lab
  • helm install RELEASE CHART: web is the release name. Install the same chart again under another name and you get a second, separate copy.
  • --set replicaCount=2: overrides one default.
OUTPUT
NAME: web
LAST DEPLOYED: Fri Nov 27 18:25:05 2026
NAMESPACE: helm-lab
STATUS: deployed
REVISION: 1
DESCRIPTION: Install complete
...
NAME	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART         	APP VERSION
web 	helm-lab 	1       	2026-11-27 18:25:05.045717569 +0000 UTC	deployed	podinfo-6.17.0	6.17.0
  • CHART: podinfo-6.17.0 is the chart's own version. APP VERSION: 6.17.0 is the app inside it. They match here, but often don't: a chart can get a template fix while the app stays the same.
  • The pods are named web-podinfo-...: RELEASE-CHART, so two installs never clash.

Upgrade with a values file

--set works for one or two values. For more, use a file:

BASH
cat > web-values.yaml <<'EOF'
replicaCount: 3
ui:
  message: "Hello from revision 2"
  color: "#2e7d32"
EOF
helm upgrade web podinfo/podinfo -n helm-lab -f web-values.yaml
k get pods -n helm-lab
  • helm upgrade RELEASE CHART: changes an installed release. -f supplies values from a file.
OUTPUT
Release "web" has been upgraded. Happy Helming!
...
REVISION: 2
DESCRIPTION: Upgrade complete
...
NAME                           READY   STATUS              RESTARTS   AGE
web-podinfo-59fbfc5df-6n6vj    0/1     ContainerCreating   0          0s
web-podinfo-59fbfc5df-bcz77    0/1     ContainerCreating   0          0s
web-podinfo-864975cbdc-kmtxh   0/1     Terminating         0          0s
web-podinfo-864975cbdc-pwghp   1/1     Running             0          92m
web-podinfo-864975cbdc-z5fgv   1/1     Running             0          92m

Caught mid-rollout: the new ReplicaSet (59fbfc5df) starting while the old one (864975cbdc) still serves. A minute later, three new pods were running.

Where did the first install's value go?

BASH
helm get values web -n helm-lab --revision 2
OUTPUT
USER-SUPPLIED VALUES:
replicaCount: 3
ui:
  color: '#2e7d32'
  message: Hello from revision 2

Revision 2 kept only the file's values. The install's --set replicaCount=2 didn't carry over. It made no difference here, because the file set replicaCount too. But had the file left it out, the upgrade would have quietly dropped the release to the chart's default of one pod.

helm upgrade forgets earlier values

helm upgrade starts from the chart's defaults plus what you pass this time. To keep earlier settings: add --reuse-values (keep the last revision's values and apply yours on top), or save them first with helm get values RELEASE -n NS -o yaml > current.yaml, edit, and pass -f current.yaml.

My first two tries at that command show another trap:

OUTPUT
vagrant@cp1:~$ helm get values -n web helm-lab
Error: release: not found
vagrant@cp1:~$ helm get values web -n hem-lab
Error: release: not found

-n is the namespace in Helm too, and the release name is the argument. The first read web as the namespace and helm-lab as the release. The second had a typo in the namespace, and nothing complains about a namespace that doesn't exist when you only read: you just find nothing.

Roll back

BASH
helm rollback web 1 -n helm-lab
helm history web -n helm-lab
k get pods -n helm-lab
helm get values web -n helm-lab
OUTPUT
Rollback was a success! Happy Helming!
REVISION	UPDATED                 	STATUS    	CHART         	APP VERSION	DESCRIPTION
1       	Fri Nov 27 18:25:05 2026	superseded	podinfo-6.17.0	6.17.0     	Install complete
2       	Fri Nov 27 19:57:19 2026	superseded	podinfo-6.17.0	6.17.0     	Upgrade complete
3       	Fri Nov 27 20:06:04 2026	deployed  	podinfo-6.17.0	6.17.0     	Rollback to 1
NAME                           READY   STATUS    RESTARTS   AGE
web-podinfo-864975cbdc-9ldm4   1/1     Running   0          46s
web-podinfo-864975cbdc-pvqhd   1/1     Running   0          46s
USER-SUPPLIED VALUES:
replicaCount: 2
  • A rollback is a new revision, "Rollback to 1". Helm never rewrites history, so you could still roll forward to 2.
  • The pods carry revision 1's ReplicaSet hash, 864975cbdc. The rollback restored the exact old pod template, so the Deployment scaled the old ReplicaSet back up instead of building a new one.

Render without installing

BASH
helm template web podinfo/podinfo --set replicanCount=2 > podinfo-rendered.yaml
grep "^kind:" podinfo-rendered.yaml
grep -n "replicas:" podinfo-rendered.yaml
grep -n "helm.sh/hook" podinfo-rendered.yaml
  • helm template: fills the gaps and prints the manifest, touching nothing in the cluster. A task might word this as "render the chart into a file".
OUTPUT
kind: Service
kind: Deployment
kind: Pod
kind: Pod
kind: Pod
40:  replicas: 1
132:    "helm.sh/hook": test-success
...

Two lessons in that output. First, look closely at the command: replicanCount, a typo. Helm accepted it without a word, and the manifest says replicas: 1, the default. Charts generally ignore values they don't know, so after any --set, check the result. Second, the three Pods are the chart's tests (helm.sh/hook: test-success), which only run with helm test. Add --skip-tests to leave them out.

Remove it

OUTPUT
vagrant@cp1:~$ helm uninstall web -n helm-lab
release "web" uninstalled
vagrant@cp1:~$ k get all -n helm-lab
No resources found in helm-lab namespace.

Kustomize: patch plain YAML per environment

Kustomize solves the "different settings per environment" problem without templates. You write plain YAML once, the base, and small overlays that change it per environment. It's built into kubectl.

A base

BASH
mkdir -p ~/kust/base ~/kust/overlays/prod
cd ~/kust/base
k create deploy shop --image=nginx:alpine $do > deployment.yaml
k create service clusterip shop --tcp=80:80 $do > service.yaml
cat > kustomization.yaml <<'EOF'
resources:
- deployment.yaml
- service.yaml
EOF
k kustomize .
  • k create service clusterip shop --tcp=80:80: a Service from port 80 to target port 80, with the selector app=shop.
  • kustomization.yaml: Kustomize's one required file. Here it lists the files in the base.
  • k kustomize DIR: renders the result without applying it, like helm template.

A prod overlay

BASH
cd ~/kust/overlays/prod
cat > kustomization.yaml <<'EOF'
resources:
- ../../base
namespace: kust-prod
namePrefix: prod-
replicas:
- name: shop
  count: 3
images:
- name: nginx
  newTag: 1.27-alpine
EOF
k kustomize .
BaseProd overlay
Namesshopprod-shop
Namespacenonekust-prod
Replicas13
Imagenginx:alpinenginx:1.27-alpine
Labels and selectorapp: shopapp: shop, unchanged
  • The base files never changed. A dev overlay beside this one could use the same base with different settings.
  • Labels stay the same, so the renamed Service still finds the renamed pods. namePrefix changes names, not selectors.
  • replicas and images name the base's objects (shop, nginx), not the prefixed names.
OUTPUT
vagrant@cp1:~/kust/overlays/prod$ k create ns kust-prod
namespace/kust-prod created
vagrant@cp1:~/kust/overlays/prod$ k apply -k .
service/prod-shop created
deployment.apps/prod-shop created
vagrant@cp1:~/kust/overlays/prod$ k get all -n kust-prod
NAME                             READY   STATUS    RESTARTS   AGE
pod/prod-shop-55d488c58d-29xwp   1/1     Running   0          14s
pod/prod-shop-55d488c58d-nrqkm   1/1     Running   0          14s
pod/prod-shop-55d488c58d-tck9z   1/1     Running   0          14s

NAME                TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/prod-shop   ClusterIP   10.106.123.51   <none>        80/TCP    14s

NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/prod-shop   3/3     3            3           14s
  • k apply -k DIR: renders the kustomization in that folder and applies it, in one step.

Helm and Kustomize, side by side: Helm fills gaps in templates and keeps a release history. Kustomize patches plain YAML and has no history: k apply -k is a smarter k apply -f. Many teams use both, Helm for other people's software and Kustomize for their own.

CRDs: new kinds of objects

A CRD (Custom Resource Definition) teaches the API server a new kind of object. Your cluster already has some:

OUTPUT
vagrant@cp1:~$ k get crd | head -5
NAME                                                    SCOPE        VERSIONS            CREATED AT
bgpconfigurations.crd.projectcalico.org                 Cluster      v1(storage)         2026-11-24T03:58:20Z
bgpfilters.crd.projectcalico.org                        Cluster      v1(storage)         2026-11-24T03:58:20Z
bgppeers.crd.projectcalico.org                          Cluster      v1(storage)         2026-11-24T03:58:20Z
blockaffinities.crd.projectcalico.org                   Cluster      v1(storage)         2026-11-24T03:58:20Z
vagrant@cp1:~$ k get crd | wc -l
24
vagrant@cp1:~$ k api-resources | grep -i ippool
ippools                                          crd.projectcalico.org/v1            false        IPPool

24 lines is 23 CRDs plus the header: 22 of Calico's, and one more, clusternetworkpolicies.policy.networking.k8s.io, which k get crd | grep -v projectcalico shows. ippools sits in api-resources like any built-in type: group crd.projectcalico.org/v1, not namespaced (false), kind IPPool.

Make your own

BASH
cat > backup-crd.yaml <<'EOF'
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: backups.lab.example.com
spec:
  group: lab.example.com
  scope: Namespaced
  names:
    plural: backups
    singular: backup
    kind: Backup
    shortNames: [bk]
  versions:
  - name: v1
    served: true
    storage: true
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              schedule:
                type: string
              retentionDays:
                type: integer
EOF
k apply -f backup-crd.yaml
k api-resources | grep -i backup
  • metadata.name must be PLURAL.GROUP.
  • group: the API group, like apps for Deployments. Use a domain you control.
  • scope: Namespaced: each object lives in a namespace. Cluster would make it cluster-wide.
  • names: how you type it, including the short name bk.
  • schema: the allowed fields and types. k explain reads it, and the API server checks objects against it.
OUTPUT
customresourcedefinition.apiextensions.k8s.io/backups.lab.example.com created
backups                             bk           lab.example.com/v1                  true         Backup

Use it like any other object

BASH
cat > nightly.yaml <<'EOF'
apiVersion: lab.example.com/v1
kind: Backup
metadata:
  name: nightly
  namespace: default
spec:
  schedule: "0 2 * * *"
  retentionDays: 7
EOF
k apply -f nightly.yaml
k get bk
k explain backup.spec
OUTPUT
backup.lab.example.com/nightly created
NAME      AGE
nightly   0s
GROUP:      lab.example.com
KIND:       Backup
VERSION:    v1

FIELD: spec <Object>
...
FIELDS:
  retentionDays	<integer>
    <no description>

  schedule	<string>
    <no description>

<no description> is because the schema has none. Real CRDs include them, which is what makes k explain useful on them. Now the wrong type, on purpose:

OUTPUT
vagrant@cp1:~$ k patch backup nightly --type=merge -p '{"spec":{"retentionDays":"seven"}}'
The Backup "nightly" is invalid: spec.retentionDays: Invalid value: "string": spec.retentionDays in body must be of type integer: "string"

The API server validates custom objects against their schema, just as it validates a pod.

What a CRD doesn't do is anything. nightly is stored and listed, but nothing backs anything up at 2am. To make a custom object act, a controller, often called an operator, watches objects of that kind and does the work. That's how Calico works: its controllers watch its CRDs and configure the network.

Deleting a CRD deletes every object of its kind:

OUTPUT
vagrant@cp1:~$ k delete crd backups.lab.example.com
customresourcedefinition.apiextensions.k8s.io "backups.lab.example.com" deleted
vagrant@cp1:~$ k get bk
Error from server (NotFound): Unable to list "lab.example.com/v1, Resource=backups": the server could not find the requested resource (get backups.lab.example.com)

The interfaces Kubernetes plugs into

The curriculum also asks you to understand the three plugin interfaces. You've met all three:

InterfacePlugs inOn your clusterFind it with
CRI (Container Runtime Interface)The program that runs containerscontainerd 2.2.1k get nodes -o wide, CONTAINER-RUNTIME column
CNI (Container Network Interface)Pod networkingCalicok get pods -n kube-system, and /etc/cni/net.d/ on a node
CSI (Container Storage Interface)Storage drivers for volumesNone yet: Lesson 11k get csidrivers, k get storageclass

crictl, from Lesson 3, talks to the runtime through the CRI. Calico arrived through the CNI in Lesson 2.

How the drills work

Each drill is a task to do from a blank terminal. Try it first, without looking. Then open "Show the fast way" to compare your commands, and read the notes under them: they cover the part people usually get wrong. Repeat a drill a few days later until you can do it cold, because the exam leaves little time to look things up.

The drills

Install chart podinfo/podinfo as release web in a new namespace apps with 2 replicas, then upgrade it to show the message hello without losing the replica setting.

Show the fast way
BASH
helm repo add podinfo https://stefanprodan.github.io/podinfo   # if not added yet
k create ns apps
helm install web podinfo/podinfo -n apps --set replicaCount=2
helm upgrade web podinfo/podinfo -n apps --reuse-values --set ui.message=hello
helm get values web -n apps        # both values present
helm history web -n apps

Without --reuse-values, the upgrade drops replicaCount=2 and the release falls back to one pod. -n is the namespace; the release name is the argument. Check typos with helm get values: Helm ignores misspelled values silently.

Render chart podinfo/podinfo with 3 replicas into /tmp/podinfo.yaml, without its tests, and without installing anything.

Show the fast way
BASH
helm template web podinfo/podinfo --set replicaCount=3 --skip-tests > /tmp/podinfo.yaml
grep "^kind:" /tmp/podinfo.yaml
grep -n "replicas:" /tmp/podinfo.yaml

Check the file: a typo in --set gives the default with no warning. Without --skip-tests, the chart's test Pods are in the file too.

Preview what the kustomization in ~/kust/overlays/prod would create, then apply it.

Show the fast way
BASH
k kustomize ~/kust/overlays/prod
k apply -k ~/kust/overlays/prod
k get all -n kust-prod

-k takes a folder with a kustomization.yaml, not a file. k kustomize previews without applying. If the overlay sets a namespace, that namespace must exist first.

Find which custom resource types the cluster has, explain one, and create an object of that type.

Show the fast way
BASH
k get crd
k api-resources | grep -i NAME
k explain KIND.spec
k apply -f object.yaml             # apiVersion GROUP/VERSION, kind KIND
k get KIND

k api-resources gives the group, version, kind and whether it's namespaced, which is everything the object's YAML header needs. k explain shows the fields the schema allows. Deleting the CRD deletes every object of its kind.

Find out which container runtime and network plugin a cluster uses.

Show the fast way
BASH
k get nodes -o wide                # CONTAINER-RUNTIME column
k get pods -n kube-system          # calico-node, cilium, flannel...
ls /etc/cni/net.d/                 # on a node

The CONTAINER-RUNTIME column names the CRI runtime and its version. The network plugin shows up as DaemonSet pods in kube-system, and its config file in /etc/cni/net.d/ on each node.

On exam day

  • Use the exact release name, namespace and values the task gives. A release named podinfo in default isn't the release web in apps that the task asked for.
  • helm list -A finds a release when you don't know its namespace. helm repo list shows which repos are already added.
  • Upgrading? Keep the old values with --reuse-values, unless the task gives a full values file.
  • Verify values after every --set with helm get values or by grepping the rendered YAML.
  • Copy CRD and kustomization YAML from the docs rather than typing it.

Clean up

BASH
k delete ns kust-prod helm-lab
rm -rf ~/kust ~/podinfo-rendered.yaml ~/web-values.yaml
  • k delete ns removes the Kustomize app and the now-empty Helm namespace. The CRD and its object were deleted in the last step.
  • rm -rf removes the lab's files: -r for folders and what's in them, -f to skip prompts.

Keep Helm installed: you'll use it again.

In real life

  • Keep values files in git, and always upgrade with -f that file. Then nothing depends on remembering past --set flags.
  • GitOps tools like Argo CD and Flux render Helm charts and Kustomize overlays from git and apply them, so nobody runs helm upgrade by hand.
  • Pin chart versions with --version in production. "Latest" can change under you.
  • Operators run many databases and platforms: a PostgreSQL operator, for example, adds a Postgres kind and handles backups, failover and upgrades for each object you create.

Spot the problem

Work out what's wrong before you read the explanation.

"The upgrade halved our replicas." A release was installed with --set replicaCount=4. Someone runs helm upgrade web repo/chart --set image.tag=2.0, and the app drops to one pod. Why? helm upgrade starts from the chart's defaults plus what's passed now, so replicaCount=4 was forgotten. --reuse-values would have kept it.

"Helm ignored my setting." helm install web podinfo/podinfo --set replicaCont=3 installs fine, with one pod. No error appeared. What happened? A typo in the value's name. Charts ignore values they don't know, so nothing failed. helm get values shows what was really passed; compare it with helm show values.

"The Backup objects vanished." A teammate deletes a CRD to "reinstall it cleanly", then re-creates it. Every object of that kind is gone. Why? Deleting a CRD deletes all its objects. Update a CRD with k apply; never delete it to refresh it.

Keep this

ToUse
Add a chart repohelm repo add NAME URL, then helm repo update
See a chart's settingshelm show values REPO/CHART
Installhelm install RELEASE REPO/CHART -n NS --set KEY=VALUE
Upgrade, keeping old valueshelm upgrade RELEASE REPO/CHART -n NS --reuse-values --set ...
History and rollbackhelm history RELEASE -n NS, helm rollback RELEASE N -n NS
What values a release useshelm get values RELEASE -n NS (--revision N, --all)
Render to a filehelm template RELEASE REPO/CHART --skip-tests > FILE
Find releaseshelm list -A
Removehelm uninstall RELEASE -n NS
Preview a kustomizationk kustomize DIR
Apply a kustomizationk apply -k DIR
List custom typesk get crd, k api-resources
A custom type's fieldsk explain KIND.spec

Where you are now

You've installed, upgraded, rolled back, rendered and removed a Helm release, and seen the two ways Helm quietly loses a setting. You've built a prod environment from a Kustomize base without touching the base, and made your own kind of Kubernetes object, validated by the API server. With RBAC and the upgrade, that covers the Cluster Architecture domain. Lesson 8 moves to Services, DNS and NetworkPolicies, where Calico's enforcement finally matters.

Check yourself

  1. A release was installed with --set replicaCount=4. Someone runs helm upgrade web repo/chart --set image.tag=2.0. How many replicas does the release have now?

  2. helm history shows revisions 1 and 2. You run helm rollback web 1. What does history show next?

  3. You run helm template web podinfo/podinfo --set replicaCont=3 and the rendered file says replicas: 1. Why?

  4. A Kustomize overlay sets namePrefix: prod- on a base whose Service selects app: shop. After k apply -k, does the Service find the Deployment's pods?

  5. You create a CRD for kind Backup and an object of that kind. At the scheduled time, nothing happens. What's missing?

  6. Which command shows a custom type's group, version, kind and whether it's namespaced?

Key terms

  • Helm: a package manager for Kubernetes: packaging, templating and release history.
  • Chart: a Helm package of templates and default values.
  • Values: the settings that fill a chart's templates.
  • Release / revision: an installed copy of a chart, and each numbered version of it.
  • Rendering: filling a chart's templates to produce plain YAML, the manifest.
  • Kustomize: a tool built into kubectl that builds YAML from a base and overlays, without templates.
  • Base / overlay: the shared YAML, and the per-environment changes applied on top of it.
  • CRD (Custom Resource Definition): adds a new kind of object to the API server.
  • Custom resource: an object of a kind a CRD defined.
  • Controller / operator: a program that watches objects and acts on them.
  • CRI / CNI / CSI: the plugin interfaces for container runtimes, networking and storage.

Go deeper