Skip to main content
mastering ckad certified kubernetes application developer

Helm Solutions

5 min read Chapter 71 of 87
Summary

Step-by-step solution for Exercise 1: adding the Bitnami...

Step-by-step solution for Exercise 1: adding the Bitnami Helm repository, installing the nginx chart with custom replica count and service type, verifying the release, upgrading replicas, rolling back, and confirming rollback success.

Helm Solutions

Solution: Exercise 1 — Helm Chart Installation with Custom Values

This exercise requires adding a Helm repository, installing a chart with custom values, upgrading the release, and rolling it back. Every step mirrors common CKAD exam tasks.

Step 1: Add the Bitnami Repository

helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories

Update the repository cache to ensure you have the latest chart versions:

helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈

Verify the repository is registered:

helm repo list
NAME    URL
bitnami https://charts.bitnami.com/bitnami

Common error: If helm repo add fails with a network error, verify your internet connectivity and that the URL is correct. The Bitnami repository URL is https://charts.bitnami.com/bitnami — not https://charts.bitnami.com (without the trailing /bitnami).

Step 2: Create the Namespace

kubectl create namespace helm-exercise
namespace/helm-exercise created

Step 3: Install the Chart with Custom Values

Install bitnami/nginx as release my-web with 2 replicas and ClusterIP service:

helm install my-web bitnami/nginx \
  -n helm-exercise \
  --set replicaCount=2 \
  --set service.type=ClusterIP
NAME: my-web
LAST DEPLOYED: Sun Feb 15 10:30:00 2026
NAMESPACE: helm-exercise
STATUS: deployed
REVISION: 1
...

Alternatively, create a values file:

# custom-values.yaml
replicaCount: 2
service:
  type: ClusterIP
helm install my-web bitnami/nginx -n helm-exercise -f custom-values.yaml

Both approaches are correct. The --set flag is faster for two values; a values file is cleaner for more complex configurations.

Step 4: Verify the Release

Check the release is deployed:

helm list -n helm-exercise
NAME    NAMESPACE       REVISION  UPDATED                   STATUS    CHART          APP VERSION
my-web  helm-exercise   1         Sun Feb 15 10:30:00 2026  deployed  nginx-15.14.0  1.25.4

Confirm the REVISION is 1 and STATUS is deployed.

Check the applied values:

helm get values my-web -n helm-exercise
USER-SUPPLIED VALUES:
replicaCount: 2
service:
  type: ClusterIP

Verify the Pods are running:

kubectl get pods -n helm-exercise
NAME                            READY   STATUS    RESTARTS   AGE
my-web-nginx-6d4b8c7f5d-abc12  1/1     Running   0          30s
my-web-nginx-6d4b8c7f5d-def34  1/1     Running   0          30s

Two Pods are running, confirming the replicaCount=2 override took effect.

Verify the Service type:

kubectl get svc -n helm-exercise
NAME           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE
my-web-nginx   ClusterIP   10.96.45.123   <none>        80/TCP    45s

The Service type is ClusterIP, confirming the service.type=ClusterIP override.

Common error: If Pods are in Pending state, check node resources with kubectl describe pod <pod-name> -n helm-exercise. In a Kind cluster with limited resources, the Bitnami nginx chart’s default resource requests may exceed available capacity. Override with --set resources.requests.cpu=50m --set resources.requests.memory=64Mi.

Step 5: Upgrade to 3 Replicas

helm upgrade my-web bitnami/nginx \
  -n helm-exercise \
  --set replicaCount=3 \
  --set service.type=ClusterIP
Release "my-web" has been upgraded. Happy Helming!
NAME: my-web
LAST DEPLOYED: Sun Feb 15 10:35:00 2026
NAMESPACE: helm-exercise
STATUS: deployed
REVISION: 2

Notice the REVISION incremented to 2.

Critical detail: Both --set values are repeated in the upgrade command. Recall from Chapter 22 that helm upgrade does not inherit values from the previous revision. If you only passed --set replicaCount=3, the service type would revert to the chart default (which might be LoadBalancer).

To inherit previous values instead:

helm upgrade my-web bitnami/nginx \
  -n helm-exercise \
  --set replicaCount=3 \
  --reuse-values

Verify 3 Pods are running:

kubectl get pods -n helm-exercise
NAME                            READY   STATUS    RESTARTS   AGE
my-web-nginx-6d4b8c7f5d-abc12  1/1     Running   0          5m
my-web-nginx-6d4b8c7f5d-def34  1/1     Running   0          5m
my-web-nginx-6d4b8c7f5d-ghi56  1/1     Running   0          15s

Three Pods running. The original two Pods are retained, and a third was created.

Step 6: Roll Back to 2 Replicas

First, check the release history to identify the revision to roll back to:

helm history my-web -n helm-exercise
REVISION  UPDATED                   STATUS       CHART          APP VERSION  DESCRIPTION
1         Sun Feb 15 10:30:00 2026  superseded   nginx-15.14.0  1.25.4       Install complete
2         Sun Feb 15 10:35:00 2026  deployed     nginx-15.14.0  1.25.4       Upgrade complete

Revision 1 had 2 replicas. Roll back to it:

helm rollback my-web 1 -n helm-exercise
Rollback was a success! Happy Helming!

Step 7: Verify the Rollback

Check the history:

helm history my-web -n helm-exercise
REVISION  UPDATED                   STATUS       CHART          APP VERSION  DESCRIPTION
1         Sun Feb 15 10:30:00 2026  superseded   nginx-15.14.0  1.25.4       Install complete
2         Sun Feb 15 10:35:00 2026  superseded   nginx-15.14.0  1.25.4       Upgrade complete
3         Sun Feb 15 10:40:00 2026  deployed     nginx-15.14.0  1.25.4       Rollback to 1

Revision 3 is the current deployment with description “Rollback to 1”. The rollback created a new revision — it did not revert to revision 1.

Verify the values match revision 1:

helm get values my-web -n helm-exercise
USER-SUPPLIED VALUES:
replicaCount: 2
service:
  type: ClusterIP

Verify 2 Pods are running:

kubectl get pods -n helm-exercise
NAME                            READY   STATUS    RESTARTS   AGE
my-web-nginx-6d4b8c7f5d-abc12  1/1     Running   0          10m
my-web-nginx-6d4b8c7f5d-def34  1/1     Running   0          10m

Two Pods. The rollback successfully restored the 2-replica configuration.

Cleanup

helm uninstall my-web -n helm-exercise
kubectl delete namespace helm-exercise

Troubleshooting Reference

SymptomCauseFix
Error: INSTALLATION FAILED: cannot re-use a name that is still in useRelease name already existsUse helm upgrade --install or helm uninstall first
Pods in PendingInsufficient node resourcesLower resource requests with --set
Values reverted after upgradeMissing --reuse-valuesRe-run upgrade with all --set flags or add --reuse-values
Release not found in helm listWrong namespaceUse helm list -A to search all namespaces
Error: namespace "X" not foundNamespace doesn’t existAdd --create-namespace to the install command