Skip to content
Hands-on IT IT Drills

Day 9: Helm – Using Charts

Goal: Install a third-party chart from an OCI registry, customize it with your own values, upgrade it, roll it back and remove it again. · Duration: approx. 75 min · Prerequisite: Day 8

Briefing

  • A chart is a package of manifest templates (Go templates) and default values (values.yaml). Charts live in repositories or, as today, as an OCI artifact in a container registry.
  • helm install renders the templates with your values and creates a release. Every change creates a new revision; you can go back to any of them.
  • Helm 4 (since late 2025) works without a server component like Helm 3, but uses server-side apply by default, waits via kstatus (“watcher”) and has renamed some flags (--atomic is now called --rollback-on-failure).
  • Demo chart: podinfo 6.17.0, a small Go web server, in its own namespace podinfo.
 chart (oci://…/podinfo:6.17.0) ─┐
 values.yaml in the chart ───────┼─► helm template ─► manifests ─► API server
 -f podinfo-values.yaml, --set ──┘
 release podinfo: revision 1, 2, 3 … as Secret sh.helm.release.v1.podinfo.vN

Drill 1: Helm and a Chart from the Registry

source ~/k8s-lab/setup/env.sh
mkdir -p ~/k8s-lab/tag09 && cd ~/k8s-lab/tag09
cp -R "$LAB/code/notes/." . && cp -R "$LAB/code/tag08/notes/." .
cp "$LAB/code/tag09/podinfo-values.yaml" .
helm version
helm show chart oci://ghcr.io/stefanprodan/charts/podinfo --version 6.17.0

Expected (abridged):

version.BuildInfo{Version:"v4.3.1", GitCommit:"c0d08d0…", GitTreeState:"clean", …}
Pulled: ghcr.io/stefanprodan/charts/podinfo:6.17.0
Digest: sha256:258d0da5…
apiVersion: v1
appVersion: 6.17.0
description: Podinfo Helm chart for Kubernetes
home: https://github.com/stefanprodan/podinfo
kubeVersion: '>=1.23.0-0'
…
name: podinfo
…
version: 6.17.0
  • version is the version of the chart, appVersion that of the application in it. For podinfo both are the same; for most charts they aren’t.
  • OCI charts don’t need helm repo add; the address starts with oci://. --version pins – without it, Helm takes the newest version, and at some point your lab changes underneath you.

The state of Day 8 stays untouched: notes keeps running, and today you work next to it.

Save your progress? Sign up for free

Drill 2: Inspect and Render Values

C=oci://ghcr.io/stefanprodan/charts/podinfo
helm show values $C --version 6.17.0 2>/dev/null | wc -l
helm show values $C --version 6.17.0 2>/dev/null | grep -E -A3 '^(replicaCount|ui):'
cat podinfo-values.yaml

Expected:

327
replicaCount: 1
logLevel: info
host: #0.0.0.0
backend: #http://backend-podinfo:9898/echo
--
ui:
  color: "#34577c"
  message: ""
  logo: ""
# podinfo-values.yaml – eigene Werte für das Demo-Chart (Tag 9)
replicaCount: 2
ui:
  message: "Hallo aus dem Trainingslager"
  color: "#0f766e"
resources:
  requests:
    cpu: 20m
    memory: 32Mi
  limits:
    memory: 64Mi

The 327 lines are the chart’s interface. You only override what you need. helm template shows what comes out of it – without cluster access:

helm template podinfo $C --version 6.17.0 -n podinfo 2>/dev/null \
  | grep -E '^kind:|^  name:'
helm template podinfo $C --version 6.17.0 -n podinfo -f podinfo-values.yaml \
  --set ui.message="Hallo von --set" 2>/dev/null \
  | grep -E -A1 'replicas:|PODINFO_UI_(MESSAGE|COLOR)' | head -12

Expected (abridged, suffixes will differ on your machine):

kind: Service
  name: podinfo
kind: Deployment
  name: podinfo
kind: Pod
  name: podinfo-grpc-test-jkmji
kind: Pod
  name: podinfo-jwt-test-bczoc
kind: Pod
  name: podinfo-service-test-a3fjm
  replicas: 2
  strategy:
--
          - name: PODINFO_UI_MESSAGE
            value: "Hallo von --set"
          - name: PODINFO_UI_COLOR
            value: "#0f766e"
  • Order of the sources: values.yaml in the chart, then every -f file, then every --set. Whatever comes later wins.
  • The three Pods are tests (helm test), not workloads; Helm doesn’t create them on install. On Day 10 you write one yourself.

Save your progress? Sign up for free

Drill 3: Install

helm install podinfo $C --version 6.17.0 -n podinfo --create-namespace \
  -f podinfo-values.yaml --wait
helm list
helm list -n podinfo
kubectl -n podinfo get deploy,pods

Expected (abridged, names, IPs and times will differ on your machine):

Pulled: ghcr.io/stefanprodan/charts/podinfo:6.17.0
Digest: sha256:258d0da5…
NAME: podinfo
LAST DEPLOYED: Fri Oct 30 14:47:43 2026
NAMESPACE: podinfo
STATUS: deployed
REVISION: 1
DESCRIPTION: Install complete
NOTES:
1. Get the application URL by running these commands:
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl -n podinfo port-forward deploy/podinfo 8080:9898
NAME    NAMESPACE   REVISION    UPDATED STATUS  CHART   APP VERSION
NAME     NAMESPACE  REVISION  UPDATED          STATUS    CHART           APP VERSION
podinfo  podinfo    1         2026-10-30 …     deployed  podinfo-6.17.0  6.17.0
NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/podinfo   2/2     2            2           24s
NAME                           READY   STATUS    RESTARTS   AGE
pod/podinfo-6d9f6b786d-ngl55   1/1     Running   0          24s
pod/podinfo-6d9f6b786d-pss8p   1/1     Running   0          24s
  • Like kubectl, Helm takes the namespace of the context. That is set to notes – which is why the first helm list is empty. With Helm, -n belongs to every command.
  • --wait waits until all objects are ready (default timeout 5 min). Without it, install returns as soon as the objects have been created.
  • NOTES: is rendered by the chart from templates/NOTES.txt – the user manual.

The Service is ClusterIP. For a quick look, a port forward is enough:

kubectl -n podinfo port-forward svc/podinfo 9898:9898 >/dev/null &
sleep 2
curl -s localhost:9898 | jq -c '{hostname, message, color, version}'
kill %1

Expected (abridged):

{"hostname":"podinfo-6d9f6b786d-pss8p","message":"Hallo aus dem Trainingslager",
"color":"#0f766e","version":"6.17.0"}

port-forward to a Service picks one Pod and sticks with it – it is no good for load balancing, but fine for diagnosis.

Save your progress? Sign up for free

Drill 4: What Helm Remembers

helm get values podinfo -n podinfo
helm get values podinfo -n podinfo --all | wc -l
helm get manifest podinfo -n podinfo | grep -E '^(# Source|kind)'
kubectl -n podinfo get secret -l owner=helm --show-labels

Expected (abridged):

USER-SUPPLIED VALUES:
replicaCount: 2
resources:
  limits:
    memory: 64Mi
  requests:
    cpu: 20m
    memory: 32Mi
ui:
  color: '#0f766e'
  message: Hallo aus dem Trainingslager
187
# Source: podinfo/templates/service.yaml
kind: Service
# Source: podinfo/templates/deployment.yaml
kind: Deployment
NAME                            TYPE                 DATA   AGE   LABELS
sh.helm.release.v1.podinfo.v1   helm.sh/release.v1   1      34s   modifiedAt=…,
name=podinfo,owner=helm,status=deployed,version=1

Every revision is stored as a Secret in the release’s namespace: chart, values and rendered manifests, compressed. That is why Helm needs no server – and why the namespace is part of the release.

Save your progress? Sign up for free

Drill 5: Upgrade and the Values Trap

You only want to change the message:

helm upgrade podinfo $C --version 6.17.0 -n podinfo \
  --set ui.message="Version 2" --wait 2>/dev/null | grep -E '^(STATUS|REVISION)'
helm get values podinfo -n podinfo
kubectl -n podinfo get deploy podinfo

Expected (abridged):

STATUS: deployed
REVISION: 2
USER-SUPPLIED VALUES:
ui:
  message: Version 2
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   1/1     1            1           39s

One replica, no color, no resources: upgrade with --set or -f starts from the chart defaults. Your file from revision 1 is gone. Without any --set/-f, on the other hand, Helm takes over the old values. Rely on neither, and instead specify everything on every upgrade:

helm upgrade podinfo $C --version 6.17.0 -n podinfo -f podinfo-values.yaml \
  --set ui.message="Version 3" --wait 2>/dev/null | grep -E '^(STATUS|REVISION)'
kubectl -n podinfo get deploy podinfo
helm history podinfo -n podinfo

Expected (abridged):

STATUS: deployed
REVISION: 3
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   2/2     2            2           55s
REVISION UPDATED                  STATUS     CHART          APP VERSION DESCRIPTION
1        Fri Oct 30 14:47:43 2026 superseded podinfo-6.17.0 6.17.0      Install complete
2        Fri Oct 30 14:48:07 2026 superseded podinfo-6.17.0 6.17.0      Upgrade complete
3        Fri Oct 30 14:48:24 2026 deployed   podinfo-6.17.0 6.17.0      Upgrade complete

--reuse-values (old values plus new ones) and --reset-then-reuse-values exist too. Still, a values file in Git is the only source you can rely on.

Save your progress? Sign up for free

Drill 6: Rollback

helm get values podinfo -n podinfo --revision 1 | tail -2
helm rollback podinfo 1 -n podinfo --wait
helm history podinfo -n podinfo | tail -2
kubectl -n podinfo get rs

Expected (abridged):

  color: '#0f766e'
  message: Hallo aus dem Trainingslager
Rollback was a success! Happy Helming!
3        Fri Oct 30 14:48:24 2026 superseded podinfo-6.17.0 6.17.0      Upgrade complete
4        Fri Oct 30 14:48:40 2026 deployed   podinfo-6.17.0 6.17.0      Rollback to 1
NAME                 DESIRED   CURRENT   READY   AGE
podinfo-6d9f6b786d   2         2         2       71s
podinfo-86f77b6996   0         0         0       30s
podinfo-bfdb7fbb7    0         0         0       47s

A rollback writes revision 1 as the new revision 4 – history only moves forward. The Deployment is back on the Pod template of revision 1, so the old ReplicaSet 6d9f6b786d scales up again. helm rollback without a number goes back one revision. By default, Helm keeps ten revisions (--history-max).

Save your progress? Sign up for free

Drill 7: Automatic Rollback with --rollback-on-failure

An upgrade with an image tag that doesn’t exist:

helm upgrade podinfo $C --version 6.17.0 -n podinfo -f podinfo-values.yaml \
  --set image.tag=0.0.0 --rollback-on-failure --timeout 60s
echo "Exit: $?"
helm history podinfo -n podinfo | tail -3
kubectl -n podinfo get events --field-selector reason=Failed \
  -o custom-columns=MSG:.message | sort -u | head -3 | cut -c1-80

Expected (abridged):

Pulled: ghcr.io/stefanprodan/charts/podinfo:6.17.0
Digest: sha256:258d0da5…
level=WARN msg="upgrade failed" name=podinfo error="resource Deployment/podinfo/podinfo
not ready. status: InProgress, message: Pending termination: 1\ncontext deadline
exceeded"
Error: UPGRADE FAILED: release podinfo failed, and has been rolled back due to
rollback-on-failure being set: resource Deployment/podinfo/podinfo not ready. …
context deadline exceeded
Exit: 1
4        Fri Oct 30 14:48:40 2026 superseded podinfo-6.17.0 6.17.0      Rollback to 1
5        Fri Oct 30 14:49:03 2026 failed     podinfo-6.17.0 6.17.0      Upgrade "podi…
6        Fri Oct 30 14:50:05 2026 deployed   podinfo-6.17.0 6.17.0      Rollback to 4
Error: ErrImagePull
Error: ImagePullBackOff
Failed to pull image "ghcr.io/stefanprodan/podinfo:0.0.0": rpc error: code = NotFoun
  • --rollback-on-failure turns on --wait, waits until --timeout and, on an error, rolls back to the last successful revision. On install it uninstalls instead.
  • Without the flag, revision 5 would stay failed, and the Deployment would hang with one Pod in ImagePullBackOff – and the next upgrade would have to sort it out.
  • Helm 4 still knows --atomic, but reports Flag --atomic has been deprecated, use --rollback-on-failure instead (verified live).

In a pipeline, this is the standard combination: --rollback-on-failure --timeout with a value that matches the probes.

Save your progress? Sign up for free

Drill 8: Third-Party Charts and Pod Security

The namespace podinfo has no PSA label. kind sets no cluster default, so privileged applies there – everything is allowed. Would podinfo run under the rules of notes?

kubectl get ns podinfo --show-labels
kubectl label --dry-run=server --overwrite ns podinfo \
  pod-security.kubernetes.io/enforce=baseline
kubectl label --dry-run=server --overwrite ns podinfo \
  pod-security.kubernetes.io/enforce=restricted
kubectl -n podinfo exec deploy/podinfo -- id

Expected (abridged):

NAME      STATUS   AGE   LABELS
podinfo   Active   24s   kubernetes.io/metadata.name=podinfo,name=podinfo
namespace/podinfo labeled (server dry run)
namespace/podinfo labeled (server dry run)
Warning: existing pods in namespace "podinfo" violate the new PodSecurity enforce
level "restricted:latest"
Warning: podinfo-6d9f6b786d-24rcl (and 1 other pod): allowPrivilegeEscalation !=
false, unrestricted capabilities, runAsNonRoot != true, seccompProfile
uid=100(app) gid=101(app) groups=101(app)

baseline yes, restricted no – the same four points as notes before Day 8, even though podinfo doesn’t run as root at all. Many public charts are like this: they set no securityContext, but offer values for it (helm show values … | grep -i securitycontext). That is the challenge.

Save your progress? Sign up for free

Checkpoint

helm list -n podinfo

Expected: release podinfo, deployed, revision 6.

NAME      NAMESPACE   REVISION   UPDATED   STATUS     CHART            APP VERSION
podinfo   podinfo     6          2026-…    deployed   podinfo-6.17.0   6.17.0
helm history podinfo -n podinfo

Expected: six revisions, including the failed upgrade from Drill 7.

REVISION   UPDATED   STATUS       CHART            APP VERSION   DESCRIPTION
1          …         superseded   podinfo-6.17.0   6.17.0        Install complete
2          …         superseded   podinfo-6.17.0   6.17.0        Upgrade complete
3          …         superseded   podinfo-6.17.0   6.17.0        Upgrade complete
4          …         superseded   podinfo-6.17.0   6.17.0        Rollback to 1
5          …         failed       podinfo-6.17.0   6.17.0        Upgrade "podinfo" fa…
6          …         deployed     podinfo-6.17.0   6.17.0        Rollback to 4
helm get values podinfo -n podinfo

Expected: your values from podinfo-values.yaml, replicaCount: 2.

USER-SUPPLIED VALUES:
replicaCount: 2
resources:
  limits:
    memory: 64Mi
  requests:
    cpu: 20m
    memory: 32Mi
ui:
  color: '#0f766e'
  message: Hallo aus dem Trainingslager
kubectl -n podinfo get deploy podinfo

Expected: two podinfo Pods ready.

NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   2/2     2            2           113s
helm list -n notes

Expected: only the header line. notes keeps running without Helm.

NAME    NAMESPACE   REVISION    UPDATED STATUS  CHART   APP VERSION

Challenge

In the namespace podinfo, set enforce and warn to restricted and get podinfo running again only through an additional values file podinfo-restricted.yaml – without changing the chart. Tear everything down afterwards.

Hint: The chart has the values podSecurityContext and securityContext; remember the trap from Day 8 (Drill 4).

Solution

cat > podinfo-restricted.yaml <<'EOF'
# podinfo-restricted.yaml – Challenge Day 9
podSecurityContext:
  runAsNonRoot: true
  runAsUser: 100   # user app in the image – name instead of UID, see Day 8
  runAsGroup: 101
  seccompProfile:
    type: RuntimeDefault
securityContext:
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: true
  capabilities:
    drop: [ALL]
EOF
kubectl label ns podinfo pod-security.kubernetes.io/enforce=restricted \
  pod-security.kubernetes.io/warn=restricted
helm upgrade podinfo $C --version 6.17.0 -n podinfo -f podinfo-values.yaml \
  -f podinfo-restricted.yaml --wait 2>&1 | grep -E '^(STATUS|REVISION|Error)'
kubectl -n podinfo exec deploy/podinfo -- id
kubectl -n podinfo rollout restart deploy/podinfo

Expected (abridged):

Warning: existing pods in namespace "podinfo" violate the new PodSecurity enforce
level "restricted:latest"
Warning: podinfo-6d9f6b786d-24rcl (and 1 other pod): allowPrivilegeEscalation != …
namespace/podinfo labeled
STATUS: deployed
REVISION: 7
uid=100(app) gid=101(app) groups=101(app)
deployment.apps/podinfo restarted

The rollout restart without a Warning: proves it: new Pods satisfy restricted. Without runAsUser, the upgrade hangs until the timeout and the Pods show CreateContainerConfigError with image has non-numeric user (app) (verified live) – the release revision is then failed until a corrected upgrade follows.

To wrap up the day:

helm uninstall podinfo -n podinfo
kubectl delete ns podinfo
helm list -A

Expected:

release "podinfo" uninstalled
namespace "podinfo" deleted
NAME    NAMESPACE   REVISION    UPDATED STATUS  CHART   APP VERSION

helm uninstall deletes all objects of the release and its history, but never the namespace – not even if --create-namespace created it.

Save your progress? Sign up for free

Enterprise Note

  • Charts from the internet are third-party code with cluster permissions: pin the version, read helm template before first use, mirror charts into your own registry. Signatures and provenance are covered in “Secure supply chains hands-on”.
  • Values per environment as files in Git (values-prod.yaml), never just --set in a shell history. GitOps tools like Argo CD or Flux render charts declaratively and detect drift.
  • helm diff (plugin) shows what changes before every upgrade – mandatory in reviews.
  • Registry credentials (helm registry login) belong in the pipeline’s secret store, not in the admins’ home directories.
  • Release Secrets contain all values in plain text (only compressed). Anyone who may read Secrets can also read passwords from values – tailor RBAC accordingly.