Helm Hour 8 (optional): 50 Production Issues + 50 Interview Questions

Turn the first seven lessons into two skills: when you see a Helm error, know which command to run first; in an interview, explain in two minutes what Helm actually does
A: 50 production issuesB: 50 interview questionsHelm 4.3 · Kubernetes v1.37Verified 2026-11-15
Overall learning objectives
  • Given an exact error message, identify which layer it comes from among release status and upgrade flow, template rendering and Values, repository/OCI/cloud platform authentication, and Hooks/CRD/GitOps/migration layers, and name the first diagnostic command.
  • Understand the mechanisms behind each issue: release Secret sh.helm.release.v1.<name>.v<N> and the state machine (pending-* / deployed / failed / superseded), ownership labels and annotations, server-side apply field managers, kstatus waiting, Go template evaluation, values merge order, OCI references and digests, and hook phases and weights.
  • Be able to work on a kind lab cluster to reproduce, diagnose, fix and clean up 14 typical faults, no cloud account needed (for cloud-related issues, diagnostic commands and expected output are provided).
  • Be able to answer the 50 Helm interview questions using the structure “30-second answer → principle → code → production experience”, and handle common follow-ups.
  • Use mock interviews (timed, self-scored) to measure your mastery rate and find weak modules.

1-hour time allocation

#TimeModuleCore contentAnimation · interactionLab (kind cluster lab)
0Before classInstructions and fault lab environmentHelm 4.3 + kind cluster lab + myapp image; lab8 namespace and cleanup rulesEnvironment checkCreate ~/helmlab/lab8 the fault chart
100–08A · Install, upgrade and Release statusIssues 1–12: name in use, pending lock, no deployed releases, ownership conflicts, wait timeouts, field is immutable, cluster unreachable, release not found in namespace, auto-rollback wiping the evidence, history pruned, release over 1 MiB, SSA conflictsRelease state machine simulatorpending-upgrade recovery · ownership takeover · immutable fields · timeouts
208–16A · Templates and ValuesIssues 13–25: YAML parse error, nil pointer, required, schema validation, --set types, --reuse-values, list overrides, undefined function, range scope, config not rolling, subchart values, lookup/random values, kubeVersion“Rendering error” troubleshooting treeindentation · nil pointer · schema · reuse-values
316–24A · Repositories, OCI and cloud platformsIssues 26–38: invalid repository, version not found, CI missing repository, missing dependency, registry login, OCI 401, “+” turning into “_”, digest mismatch, ECR repository does not exist, AKS kubelogin, EKS exec apiVersion, LBC webhook, identity annotations“Pull/authentication failure” troubleshooting treelocal OCI registry · dependency build · install by digest
424–30A · Hooks, CRDs, GitOps and migrationIssues 39–50: hook failure/timeout, leftover hooks, hook order, CRD not upgraded, CRD not installed, uninstall deletes CRDs, Argo CD and helm list, random values causing OutOfSync, Flux retries exhausted, API removed, Helm 4 flags and wait semantics, post-renderer as pluginsHook execution timeline simulatorhook failure · before-hook-creation · CRD order
530–37B · Core concepts and architectureQuestions 1–13Mock interview2 scenario questions
637–44B · Chart development and templatesQuestions 14–25Mock interview2 scenario questions
744–52B · Distribution, security and CI/CDQuestions 26–38Mock interview3 scenario questions
852–60B · Production practice and scenario designQuestions 39–50Mock interview3 scenario questions
—After classCheat sheet · Comprehensive drill50 “error → first command → fix” entries; 50 flash cards; 8 mixed faults; full mock interviewFull mock interview12-question final quiz

Knowledge coverage matrix

Topicm1m2m3m4m5m6m7m8
Release storage / state machine / history●——●●——●
install / upgrade / rollback flow and waiting●——●●—●●
template syntax / scope / functions—●———●——
Values merging / schema / subcharts—●●—●●—●
repositories / OCI / dependencies / signing——●——●●—
SSA / ownership / immutable fields●——●●——●
Hooks / CRDs / testing———●—●—●
CI/CD / GitOps / Helmfile——●●——●●
AKS / EKS / cloud identity●—●———●●
Helm 3 → 4 migration●—●●●——●

Not covered in this course (where to learn it)

  • Helm basics (first chart, basic install/upgrade/rollback operations) → K8s course, Lesson 6, Module 1 and this course’s Lesson 1.
  • Full steps for writing a production-grade chart from scratch → Lesson 2; full deployment on AKS/ACR and EKS/ECR → Lesson 3 / Lesson 4.
  • Full configuration of Argo CD / Flux / Helmfile → Lesson 5; architecture design for hooks, secrets and CRDs → Lesson 6; troubleshooting methodology and Helm 4 migration → Lesson 7.
  • Kubernetes failures themselves (Pod CrashLoopBackOff, scheduling failures, network policies, etc.) → the 50 issues in Lesson 9 of the K8s course, which this course does not repeat; it only covers issues that surface through Helm.
  • Writing Helm plugins with the Go SDK / embedding the Helm library → refer to the official helm.sh documentation; not covered in this course.

How to use this course

When troubleshooting (Part A)
  • Open the matching module’s at-a-glance overview, then paste the most distinctive word from the error (such as in progress,nil pointer,immutable,401) into the filter box.
  • Click a table row to jump directly to issue details, and follow “diagnose → compare with output → fix”.
  • Not sure which layer it is in? Use the animation tab’s decision tree / simulator.
Before the interview (Part B)
  • First, look at the at-a-glance overview, and pick out the questions you are unsure of by difficulty.
  • Mock interview: random questions, a 2-minute countdown, answer first then check, self-rate as “answered / partial / missed”; scores are saved in this browser.
  • Answer structure: one-sentence conclusion → principle → code/commands → pitfalls you have hit.
After class
  • Cheat sheet Good to print and pin at your desk.
  • Comprehensive drill: 8 mixed faults + full mock interview (pick 10 of 50) + final quiz.
  • Each issue links back to the matching section in Lessons 1–7, so you can revisit it.

Entry structure for Parts A and B

Part A · 50 Production Issues

Symptom → root cause (at the mechanism level) → diagnostic command → example expected output → fix → prevention and best practices → see Lesson N. Titles use the exact error text Helm actually prints (checked against the error strings in the Helm 4.3.2 source); where Helm 3 and Helm 4 word things differently, both are listed. Text returned by the Kubernetes API server and cloud vendor CLIs varies by version, and this is noted in each entry.

Part B · 50 Interview Questions

Question → 30-second answer → in-depth answer (principle, code) → common follow-ups → bonus points → common wrong answers. Difficulty:BasicIntermediateAdvanced.

Relationship to the first seven lessons

LessonMost-referenced content in this course
Lesson 1 core basicsarchitecture, release Secret, install/upgrade mechanics, values precedence, rollback/history, OCI, template/get/diff
Lesson 2 Writing production-grade chartsGo templates and Sprig, _helpers.tpl and scope, values design, values.schema.json, dependencies and library charts, lint/test
Lesson 3 Azure · Lesson 4 AWSACR/ECR as OCI repositories, Workload Identity / Pod Identity, LBC, pipeline deployment
Lesson 5 CI/CD and GitOpsct, chart-releaser, signing, Argo CD, Flux HelmRelease, Helmfile, automatic rollback
Lesson 6 Hands-on chart architectureumbrella chart, layered values, secrets, hooks, post-renderer, CRDs, zero downtime
Lesson 7 Deep troubleshooting--debug, pending-upgrade, hook timeouts, SSA conflicts, template debugging, release size, Helm 3→4 migration
Version notes This course is based on Helm 4.3.x (latest 4.3.2, 2026-11-13); Helm 4.0 was released in 2025-11. Changes in Helm 4 relevant to this course compared with Helm 3: --atomic → --rollback-on-failure,--force → --force-replace (old flags still work but warn); new installs default to server-side apply (upgrades and rollbacks keep the release’s original method; can use --server-side to override); --wait can take watcher (kstatus) / hookOnly (default when omitted) / legacy; post-renderer must be a plugin; helm registry login accepts only domain names; OCI charts can be installed by digest. The last Helm 3 feature release is 3.22 (2026-09), with security fixes until 2027-02-10. Kubernetes v1.37 (kind v0.33.0, kindest/node:v1.37.0). All “expected output” shown is illustrative; names, times and digests will differ in your environment.

Module 0 · Instructions and fault lab environment

Before class · reuse the kind cluster lab and myapp image from the first seven lessons; create a new directory and namespace used only for “creating faults”
10 minutes before classNo cloud cost
Module objectives
  • Confirm Helm 4.3 and the kind cluster lab, kubectl is available, and the myapp:1.0/1.1 images are loaded onto the kind nodes.
  • Generate the fault chart shared by all reproduction labs in this course ~/helmlab/lab8/myapp, and start a local OCI registry.
  • Understand the lab safety rules: only inject faults in the lab8-* namespace, and clean up immediately when done.

Prerequisites

  • Complete Lesson 1 Module 0: you already have ~/helmlab/kind-lab.yaml, a cluster lab (1 control-plane + 2 worker, kindest/node:v1.37.0), and myapp:1.0,myapp:1.1 images.
  • Tools: Helm 4.3.x, kubectl 1.37, Docker, jq; optional yq,helm-diff plugins.

Step 1: Environment check

helm version --short
kubectl config current-context
kubectl get nodes
docker exec lab-worker crictl images | grep myapp
v4.3.2+g…
kind-lab
NAME                STATUS   ROLES           AGE   VERSION
lab-control-plane   Ready    control-plane   3d    v1.37.0
lab-worker          Ready    <none>          3d    v1.37.0
lab-worker2         Ready    <none>          3d    v1.37.0
docker.io/library/myapp   1.0   …
docker.io/library/myapp   1.1   …

Cluster deleted? Rebuild it per Lesson 1, Module 0, steps 2–3, and kind load docker-image myapp:1.0 myapp:1.1 --name lab.

Step 2: Generate the fault chart

A minimal chart with a “production shape”: Deployment + Service + ConfigMap + an optional pre-upgrade migration Job. Each module’s reproduction lab deliberately breaks something in its copy.

mkdir -p ~/helmlab/lab8 && cd ~/helmlab/lab8
helm create myapp >/dev/null && rm -rf myapp/templates/tests myapp/templates/hpa.yaml myapp/templates/ingress.yaml myapp/templates/httproute.yaml
cat > myapp/values.yaml <<'EOF'
replicaCount: 1
image:
  repository: myapp
  tag: "1.0"
  pullPolicy: IfNotPresent
service:
  type: ClusterIP
  port: 80
containerPort: 5000
config:
  greeting: hello
migration:
  enabled: false
  command: ["sh", "-c", "echo migrate ok"]
serviceAccount:
  create: true
  annotations: {}
  name: ""
  automount: false
podAnnotations: {}
podLabels: {}
podSecurityContext: {}
securityContext: {}
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
ingress:
  enabled: false
httpRoute:
  enabled: false
autoscaling:
  enabled: false
livenessProbe:
  httpGet: {path: /healthz, port: http}
readinessProbe:
  httpGet: {path: /healthz, port: http}
volumes: []
volumeMounts: []
EOF
sed -i 's/containerPort: {{ .Values.service.port }}/containerPort: {{ .Values.containerPort }}/' myapp/templates/deployment.yaml
cat > myapp/templates/configmap.yaml <<'EOF'
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "myapp.fullname" . }}
  labels:
    {{- include "myapp.labels" . | nindent 4 }}
data:
  GREETING: {{ .Values.config.greeting | quote }}
EOF
cat > myapp/templates/migrate-job.yaml <<'EOF'
{{- if .Values.migration.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
  name: {{ include "myapp.fullname" . }}-migrate
  annotations:
    "helm.sh/hook": pre-install,pre-upgrade
    "helm.sh/hook-weight": "0"
    "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
  backoffLimit: 0
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: migrate
          image: busybox:1.37
          command: {{ toJson .Values.migration.command }}
{{- end }}
EOF
helm lint myapp && helm template t myapp | grep -c '^kind:'
==> Linting myapp
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, 0 chart(s) failed
4

helm create The generated templates vary slightly by Helm version (for example, whether httproute.yaml is included); the command above rm -rf does not fail on missing files. If sed no port line matches, manually change the Deployment’s containerPort to {{ .Values.containerPort }}.

Step 3: local OCI registry (used in Module 3)

docker run -d --name lab8-registry -p 5001:5000 registry:3
helm package myapp -d /tmp/lab8 && helm push /tmp/lab8/myapp-0.1.0.tgz oci://localhost:5001/charts --plain-http
Successfully packaged chart and saved it to: /tmp/lab8/myapp-0.1.0.tgz
Pushed: localhost:5001/charts/myapp:0.1.0
Digest: sha256:4c1e…

Link to the previous lesson

  • All the troubleshooting tools from Lesson 7 are reused here: helm status/history/get all,--debug,kubectl get secret -l owner=helm,helm template --debug,kubectl get … --show-managed-fields.
  • This lesson adds a shared namespace prefix: lab8-, with release names using myapp or m1a and similar lab numbers.

Lab safety rules

Only inject faults in the lab cluster Labs in this course deliberately delete or rewrite release Secrets, force conflicts, and make hooks fail. Always first kubectl config current-context confirm you are on kind-lab; in production, back up before any operation that modifies a release Secret (kubectl get secret … -o yaml > backup.yaml).
for ns in $(kubectl get ns -o name | grep 'namespace/lab8-' | cut -d/ -f2); do kubectl delete ns "$ns" --wait=false; done
docker rm -f lab8-registry; rm -rf /tmp/lab8

Self-check checklist

Module 1 · Part A: Install, upgrade and Release status (issues 1–12)

00:00 – 08:00 · release Secret, state machine, ownership, waiting, immutable fields, SSA conflicts
8 minsh.helm.release.v1.<name>.v<N>12 issues
Learning objectives
  • Explain one helm upgrade --install sequence: check the latest revision (refuse if pending) → render → write pending-upgrade the new revision → ownership check → call the API (SSA or three-way merge) → wait → mark the new revision as deployed, and mark the old one as superseded.
  • Be able to use the helm history status column to tell whether the next command will succeed, and recover safely from pending/failed states.
  • Distinguish “Helm’s own checks” (name, pending, ownership) from “API server rejections” (immutable, 1 MiB, SSA conflict).

Enter a keyword from the error (such as in progress,reuse,ownership,immutable) to filter; click a row to jump to the matching entry in “Issue details”.

#1 Error: INSTALLATION FAILED: cannot reuse a name that is still in use
$ helm install myapp ./myapp -n lab8-m1
Error: INSTALLATION FAILED: cannot reuse a name that is still in use

In the Helm 4.3 source, the string is cannot reuse a name that is still in use; earlier Helm 3 versions write it as cannot re-use a name that is still in use, so try both when searching.

Symptom: CI’s first deploy succeeds, but every later run of helm install fails, or a retry after a failed install also fails.

Root cause:helm install It first calls availableName(): it looks up the same-named release’s history in that namespace’s storage driver, and refuses unless the last revision is “uninstalled / failed with --replace”, so it refuses. Release names are unique within a namespace; helm uninstall --keep-history leftover uninstalled records and failed records from a failed first install both make a same-named install fail.

Diagnostic command
helm list -n lab8-m1 -a            # -a shows all statuses (including failed, pending, uninstalled)
helm history myapp -n lab8-m1
kubectl get secret -n lab8-m1 -l owner=helm,name=myapp
NAME   NAMESPACE  REVISION  UPDATED   STATUS    CHART        APP VERSION
myapp  lab8-m1    1         …         deployed  myapp-0.1.0  1.16.0
REVISION  UPDATED   STATUS    CHART        APP VERSION  DESCRIPTION
1         …         deployed  myapp-0.1.0  1.16.0       Install complete
Fix
# Use the idempotent upgrade --install in deploy scripts (installs if missing, upgrades if present)
helm upgrade --install myapp ./myapp -n lab8-m1 --create-namespace --wait --timeout 5m
# The last attempt was a failed first install and you have decided to discard it:
helm uninstall myapp -n lab8-m1      # then install; or install --replace (only for failed/uninstalled; official docs say it is unsafe for production)
Prevention and best practices
  • Pipelines use only helm upgrade --install, not separate install/upgrade branch logic.
  • release names ≤ 53 characters, lowercase DNS format (invalid release name, must match regex … and the length must not be longer than 53).

See Lesson 1 Module 3 install / upgrade.

#2 Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress
$ helm upgrade myapp ./myapp -n lab8-m1
Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress

Symptom: After a previous deployment is interrupted by Ctrl+C, a CI cancellation, a reclaimed runner, or a dropped kubectl context, every later upgrade/rollback reports this message. helm list This release is not visible by default (the default list only shows deployed/failed).

Root cause: Helm has no server-side lock; it treats “the status of the last revision being pending-install / pending-upgrade / pending-rollback” as a pessimistic lock (source comment: “This should act as a pessimistic lock”). When a run finishes normally, Helm changes it to deployed or failed; if the process dies midway, it stays at pending forever. Another pipeline may really be running— in that case, forcing recovery would let two processes modify the same set of objects at the same time.

Diagnostic command
helm history myapp -n lab8-m1 --max 5
helm list -n lab8-m1 --pending
kubectl get secret -n lab8-m1 -l owner=helm,name=myapp -L status,version
REVISION  STATUS           CHART        DESCRIPTION
3         superseded       myapp-0.1.0  Upgrade complete
4         deployed         myapp-0.1.0  Upgrade complete
5         pending-upgrade  myapp-0.1.0  Preparing upgrade
NAME                           TYPE                 DATA   AGE   STATUS            VERSION
sh.helm.release.v1.myapp.v4    helm.sh/release.v1   1      2h    deployed          4
sh.helm.release.v1.myapp.v5    helm.sh/release.v1   1      9m    pending-upgrade   5
Fix
# 1) First confirm no pipeline or terminal is still operating on this release (check CI, check the Secret’s AGE)
# 2) Preferred: roll back to the last deployed revision; this creates a new revision 6 and clears pending
helm rollback myapp 4 -n lab8-m1 --wait
# 3) If rollback also fails (for example pending-install, with no version to roll back to), back up and then delete the stuck release Secret
kubectl get secret sh.helm.release.v1.myapp.v5 -n lab8-m1 -o yaml > rev5-backup.yaml
kubectl delete secret sh.helm.release.v1.myapp.v5 -n lab8-m1
helm upgrade --install myapp ./myapp -n lab8-m1 --wait
Prevention and best practices
  • Run CI serially for the same release (GitHub Actions concurrency + cancel-in-progress: false; Azure Pipelines uses an exclusive lock check).
  • The job timeout must be greater than --timeout, otherwise the runner is killed first and Helm has no time to write failed.
  • Before the deploy step, add a check that alerts and stops when it finds pending, rather than automatically deleting the Secret.

See Lesson 7 Module 2 Stuck releases: pending-upgrade and other states.

#3 Error: UPGRADE FAILED: "myapp" has no deployed releases
$ helm upgrade myapp ./myapp -n lab8-m1
Error: UPGRADE FAILED: "myapp" has no deployed releases

Symptom: For a name that has never been installed successfully, running an upgrade without --install the helm upgrade; or once the release has already been uninstall --keep-history.

Root cause: upgrade first looks for the “last undeleted revision”; if none is found, it returns ErrNoDeployedReleases (the source keeps this error deliberately for compatibility). In early Helm 3 versions, “a first install that failed (only one failed revision)” also triggered it; current versions continue the upgrade from failed, but when history has no deployed version it still cannot rollback reach a successful state.

Diagnostic command
helm history myapp -n lab8-m1
helm list -n lab8-m1 -a --filter '^myapp$'
Error: release: not found
(or)
REVISION  STATUS       DESCRIPTION
1         uninstalled  Uninstallation complete
Fix
helm upgrade --install myapp ./myapp -n lab8-m1 --wait
# History only has uninstalled entries and you no longer need them:
helm uninstall myapp -n lab8-m1     # clear the records kept by keep-history, then install again
Prevention and best practices
  • Always use --install; use -n an explicit namespace (see #8).
  • Use only when you really need an audit trail --keep-history, and document in the runbook how to reinstall.

See Lesson 1 Module 5 Rollback, history and uninstall.

#4 unable to continue with install: Deployment "myapp" in namespace "lab8-m1" exists and cannot be imported into the current release: invalid ownership metadata
Error: INSTALLATION FAILED: unable to continue with install: Deployment "myapp" in namespace "lab8-m1" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "myapp"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "lab8-m1"

The similar Helm 3 error starts with rendered manifests contain a resource that already exists. Unable to continue with install: … ; on upgrade it is unable to continue with update.

Symptom: Switching an app that was managed with kubectl apply/Kustomize to Helm; or two releases rendering same-named objects (for example, two charts both creating redis Service).

Root cause: Before creating an object, Helm runs an ownership check on a “same-named object already in the cluster” (checkOwnership): it must have both the label app.kubernetes.io/managed-by=Helm and the annotation meta.helm.sh/release-name,meta.helm.sh/release-namespace, with values matching the current release. If missing, the import is refused so that Helm does not silently take over or overwrite someone else’s object.

Diagnostic command
kubectl get deploy myapp -n lab8-m1 -o jsonpath='{.metadata.labels}{"\n"}{.metadata.annotations}{"\n"}' | jq -c .
kubectl get deploy myapp -n lab8-m1 --show-managed-fields -o jsonpath='{range .metadata.managedFields[*]}{.manager}{"\n"}{end}'
{"app":"myapp"}
{"kubectl.kubernetes.io/last-applied-configuration":"{…}"}
kubectl-client-side-apply
Fix
# Option A: explicitly annotate the objects so Helm can take them over (only if they belong to this release)
kubectl label deploy myapp -n lab8-m1 app.kubernetes.io/managed-by=Helm --overwrite
kubectl annotate deploy myapp -n lab8-m1 meta.helm.sh/release-name=myapp meta.helm.sh/release-namespace=lab8-m1 --overwrite
helm upgrade --install myapp ./myapp -n lab8-m1
# Option B: Helm 3.17+ / 4 provides --take-ownership, which skips the check and takes over directly (it rewrites the annotations)
helm upgrade --install myapp ./myapp -n lab8-m1 --take-ownership
Prevention and best practices
  • Before taking over, first helm template + kubectl diff confirm the rendered output is equivalent to the existing objects, so the takeover does not change the selector (which would trigger #6).
  • Always prefix object names with the release name ({{ include "myapp.fullname" . }}), so two releases will not collide.
  • --take-ownership Use only during a migration window; do not put it in the regular pipeline — it can also “steal” another release’s objects.

See Lesson 7 Module 4 SSA and field ownership,Lesson 1 Module 3.

#5 resource Deployment/lab8-m1/myapp not ready. status: InProgress … context deadline exceeded (Helm 3: timed out waiting for the condition)
Error: UPGRADE FAILED: resource Deployment/lab8-m1/myapp not ready. status: InProgress, message: Available: 0/1
context deadline exceeded

Helm 4 waiting is based on kstatus, with errors listed per resource not ready. status: …, message: …, ending with context deadline exceeded; the message text is generated by kstatus and may vary between versions.

Symptom: Adding --wait (or --rollback-on-failure, which sets the wait strategy default to watcher), deployments that fail after --timeout (default 5m), the revision is marked failed.

Root cause: Helm only waits; the real cause is in Kubernetes: image cannot be pulled, probes fail, resources are insufficient to schedule, PVC not bound, LoadBalancer not getting an address, and so on. Helm 4’s watcher waits for every resource’s kstatus to reach Current; when omitted --wait it defaults to hookOnly, which only waits for hooks.

Diagnostic command
helm status myapp -n lab8-m1 --show-resources
kubectl get deploy,rs,pod -n lab8-m1 -l app.kubernetes.io/instance=myapp
kubectl describe pod -n lab8-m1 -l app.kubernetes.io/instance=myapp | sed -n '/Events/,$p'
kubectl get events -n lab8-m1 --sort-by=.lastTimestamp | tail -15
NAME                         READY   STATUS             RESTARTS   AGE
pod/myapp-7c9d8b6f4d-2xk8q   0/1     ImagePullBackOff   0          5m
  Warning  Failed  kubelet  Failed to pull image "myapp:1.2": … not found
Fix
  • After fixing the root cause (image tag, probes, resource requests), run helm upgrade; or helm rollback myapp <previous deployed>.
  • If more time is really needed (large images, database initialization): --timeout 15m, and confirm the CI job timeout is longer.
Prevention and best practices
  • Explicitly set --wait --timeout in production deployments rather than relying on defaults; when waiting for a Job, add --wait-for-jobs.
  • On deploy failure, have the pipeline automatically print helm status --show-resources and events.

See Lesson 7 Module 1 troubleshooting methodology,Lesson 5 Module 7 upgrade strategies and automated rollback.

#6 Deployment.apps "myapp" is invalid: spec.selector: Invalid value: …: field is immutable
Error: UPGRADE FAILED: cannot patch "myapp" with kind Deployment: Deployment.apps "myapp" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"myapp", "app.kubernetes.io/name":"myapp", "tier":"web"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

With server-side apply the outer prefix differs (for example failed to apply …), but the core field is immutable message still comes from the API server. For a Job’s spec.template, StatefulSet’s volumeClaimTemplates, Service’s clusterIP work the same way.

Symptom: A label was added to or changed in the chart’s selectorLabels, or the chart name/nameOverride, and the upgrade is rejected.

Root cause: Kubernetes requires a Deployment’s spec.selector is immutable after creation; Helm simply hands the new manifest to the API server. Many charts put app.kubernetes.io/version or the chart version mistakenly into the selector, which triggers the failure on every version bump.

Diagnostic command
helm get manifest myapp -n lab8-m1 | yq 'select(.kind=="Deployment").spec.selector'
helm template myapp ./myapp -n lab8-m1 | yq 'select(.kind=="Deployment").spec.selector'
helm diff upgrade myapp ./myapp -n lab8-m1     # if the helm-diff plugin is installed
Fix
# Preferred: restore the selector to its original value (the selector should only contain name + instance)
# If the change is truly needed: plan downtime, delete the object and let Helm recreate it
kubectl delete deploy myapp -n lab8-m1 --cascade=orphan   # keeps Pods to reduce disruption; once the new RS is up, old Pods must be cleaned up manually
helm upgrade myapp ./myapp -n lab8-m1 --wait
# or --force-replace (--force in Helm 3): delete and recreate the object; this causes disruption
Prevention and best practices
  • selectorLabels Include only app.kubernetes.io/name and app.kubernetes.io/instance; put version labels in labels.
  • Run an “upgrade test” on the chart in CI (ct install --upgrade), which catches immutable-field changes before merge.

See Lesson 2 Module 8 Chart readiness review and common mistakes,Lesson 6 Module 7 zero downtime and compatibility.

#7 Error: kubernetes cluster unreachable: Get "https://127.0.0.1:6443/version": dial tcp …: connect: connection refused
Error: kubernetes cluster unreachable: Get "https://127.0.0.1:41235/version": dial tcp 127.0.0.1:41235: connect: connection refused

Symptom: The local kind cluster was deleted or restarted, CI has no kubeconfig, or the kubeconfig points to another machine’s address.

Root cause: Helm uses the same kubeconfig resolution rules as kubectl (--kubeconfig > KUBECONFIG > ~/.kube/config, the context is determined by --kube-context/HELM_KUBECONTEXT ), and before running it first requests /version to check connectivity. sudo helm Running it under sudo reads root’s kubeconfig, which is also a common cause.

Diagnostic command
helm env | grep -E 'KUBE|NAMESPACE'
kubectl config current-context && kubectl cluster-info
echo "$KUBECONFIG"; kind get clusters
Fix
kind export kubeconfig --name lab        # rewrite the kind-lab context
helm list -A --kube-context kind-lab
# CI: first run the cloud vendor’s credential step (az aks get-credentials / aws eks update-kubeconfig), then run helm
Prevention and best practices
  • In scripts, explicitly pass --kube-context, to avoid implicit “deploy to current context” behavior hitting the wrong cluster.
  • Do not use sudo helm; in CI, generate kubeconfig as a short-lived credential and do not commit it to the repository.

See Lesson 1 Module 0 environment setup; for cloud authentication issues see #35, #36.

#8 Error: release: not found (the release clearly exists, but helm list cannot see it either)
$ helm status myapp
Error: release: not found
$ helm list
NAME	NAMESPACE	REVISION	UPDATED	STATUS	CHART	APP VERSION

Symptom: The Pod is running, but Helm says there is no such release; a colleague can see it.

Root cause: Release records are stored in the namespace where the release lives Secrets, and by default Helm only looks in the current context’s namespace (usually default). Three other possibilities: ① the app is actually deployed by Argo CD using helm template rendered output, so there is no Helm release at all (see #45); ② a different storage driver is used (HELM_DRIVER=configmap or sql); ③ the release is in pending/uninstalled,helm list which is not shown by default.

Diagnostic command
helm list -A -a | grep myapp
kubectl get secret,configmap -A -l owner=helm,name=myapp
kubectl get deploy myapp -n lab8-m1 -o jsonpath='{.metadata.annotations.meta\.helm\.sh/release-name}{" "}{.metadata.labels}{"\n"}'
myapp   lab8-m1   3   …   deployed   myapp-0.1.0   1.16.0
NAMESPACE  NAME                          TYPE                 DATA  AGE
lab8-m1    sh.helm.release.v1.myapp.v3   helm.sh/release.v1   1     1h
Fix

Add -n lab8-m1 (or helm --namespace) to all Helm commands; standardize the storage driver across the team; for apps managed by Argo CD, use argocd app get instead of Helm commands.

Prevention and best practices
  • Every Helm command in pipelines and runbooks should explicitly specify the namespace.
  • Do not use kubectl config set-context --current --namespace to “save effort”; in a shared terminal it causes this kind of problem.

See Lesson 1 Module 2 Chart, Release and Repository.

#9 release myapp failed, and has been uninstalled due to rollback-on-failure being set (the evidence was cleaned up automatically)
Error: INSTALLATION FAILED: release myapp failed, and has been uninstalled due to rollback-on-failure being set: resource Deployment/lab8-m1/myapp not ready. status: InProgress, message: …
context deadline exceeded

Symptom: After a first install fails, nothing is left — no Pods and no events to inspect; a failed upgrade is rolled back automatically, so developers only see “rollback succeeded” and do not know why the new version failed.

Root cause:--rollback-on-failure (the original --atomic) on install failure runs uninstall, and on upgrade failure it rolls back to the previous successful version. This is correct production protection, but it deletes the failed Pods, so the diagnostic information disappears with them. It also implicitly waits (watcher), and the timeout is what counts as failure.

Diagnostic command
helm history myapp -n lab8-m1          # upgrade case: shows the failed revision and its description
helm get values myapp -n lab8-m1 --revision 7
kubectl get events -n lab8-m1 --sort-by=.lastTimestamp | tail -30   # events are kept for about 1 hour by default
Fix
# When reproducing, remove automatic rollback to keep the evidence:
helm upgrade --install myapp ./myapp -n lab8-m1-debug --create-namespace --wait --timeout 3m
kubectl describe pod -n lab8-m1-debug -l app.kubernetes.io/instance=myapp
Prevention and best practices
  • On a Helm failure, the pipeline first collects evidence (events,kubectl logs --previous,describe), then lets the rollback happen; or, in --rollback-on-failure addition to using --cleanup-on-fail a flag that only cleans up newly created objects.
  • For a failed first install, do not enable automatic uninstall in dev/staging environments, so that troubleshooting is easier.

See Lesson 5 Module 7 upgrade strategies and automated rollback.

#10 Error: release has no 3 version (the version you wanted to roll back to was pruned by --history-max)
$ helm rollback myapp 3 -n lab8-m1
Error: release has no 3 version

Symptom: You want to go back to “the version from last month”, but history only keeps the latest 10 entries.

Root cause:helm upgrade ’s default --history-max is 10: after each upgrade, the oldest revision Secret is deleted (deployed is kept). If the rollback target is not in storage, this message appears; revision numbers themselves are never reused.

Diagnostic command
helm history myapp -n lab8-m1 -o json | jq -r '.[]|"\(.revision) \(.status) \(.chart) \(.app_version)"'
14 superseded myapp-0.4.2 1.4.2
…
23 deployed myapp-0.5.1 1.5.1
Fix
# Rollback = redeploy with the “chart version and values from that time”. When the old chart version is still in the repository:
helm upgrade myapp oci://localhost:5001/charts/myapp --version 0.3.0 -f values-2026-10.yaml -n lab8-m1 --wait
Prevention and best practices
  • Chart versions are immutable and stored in the repository; values are stored in Git (GitOps), so “rollback” can replay from Git history without depending on the release Secret.
  • Adjust as needed --history-max (for example 20), but do not set it to 0 (unlimited), or the namespace’s Secrets grow without bound.

See Lesson 1 Module 5,Lesson 7 Module 6 Release storage and cleanup.

#11 Secret "sh.helm.release.v1.myapp.v8" is invalid: data: Too long: must have at most 1048576 bytes
Error: UPGRADE FAILED: create: failed to create: Secret "sh.helm.release.v1.myapp.v8" is invalid: data: Too long: must have at most 1048576 bytes

Symptom: A large umbrella chart, or large files (dashboard JSON, certificate bundles, CRDs) placed in templates or .Files in the chart, makes the upgrade fail at the “write release record” step.

Root cause: Helm serializes the whole release (rendered manifests + chart templates and files + values) into JSON → gzip → base64 and stores it in a single Secret; Kubernetes limits data in a single Secret/ConfigMap to 1 MiB. The chart’s files files also get stored in it.

Diagnostic command
kubectl get secret -n lab8-m1 -l owner=helm,name=myapp -o json | jq -r '.items[]|"\(.metadata.name) \(.data.release|length)"'
helm get manifest myapp -n lab8-m1 | wc -c
helm show chart ./myapp; du -sh myapp/files myapp/charts 2>/dev/null
Fix
  • Move the large files out of the chart (manage the ConfigMap directly via another release or GitOps; load dashboards from the repository with a sidecar).
  • Split the umbrella chart into multiple releases; use .helmignore to exclude test data, docs and examples.
  • At very large scale you can optionally use the SQL storage driver (HELM_DRIVER=sql, requires PostgreSQL), but evaluate the operational cost.
Prevention and best practices

Add a gate in CI: helm template | gzip | wc -c alert if the size exceeds 700 KB.

See Lesson 7 Module 6 Release storage, size limits and cleanup.

#12 Apply failed with 1 conflict: conflict with “kubectl-edit” using apps/v1: .spec.replicas (server-side apply field conflict)
Error: UPGRADE FAILED: … Apply failed with 1 conflict: conflict with "kubectl-edit" using apps/v1: .spec.replicas

Symptom: A release newly installed with Helm 4 (SSA by default) fails after someone kubectl edit/kubectl scale, or after an HPA or another controller changes the same field, the upgrade fails. Releases upgraded from Helm 3 to Helm 4 still use client-side three-way merge, so they do not report this; instead the field is silently overwritten or kept.

Root cause: In SSA, every field has a “manager” (managedFields). Helm submits the manifest under its own field manager; if a field is set to a different value by another manager, the API server rejects it and reports a conflict, unless force is used.

Diagnostic command
kubectl get deploy myapp -n lab8-m1 --show-managed-fields -o yaml | yq '.metadata.managedFields[]|{"manager":.manager,"op":.operation}'
helm get metadata myapp -n lab8-m1
{"manager": "helm", "op": "Apply"}
{"manager": "kubectl-edit", "op": "Update"}
Fix
# Confirm that the value in Git is authoritative, then force-reclaim the field
helm upgrade myapp ./myapp -n lab8-m1 --force-conflicts
# If the field should be managed by another controller (HPA manages replicas), remove that field from the template
#   {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }}
Prevention and best practices
  • In production, manual kubectl edit changes are forbidden (RBAC + GitOps); drift is corrected through PRs.
  • When HPA is enabled, do not render replicas.
  • When batch-switching old releases to SSA (--server-side=true), run a pass in a pre-production environment first to find conflicts.

See Lesson 7 Module 4 Server-side apply (SSA) and field ownership conflicts,Module 7 Helm 3 to Helm 4 migration.

The steps of helm upgrade --install, and the typical error at each step ① Connect to the clusterkubeconfig · /version ② Read the last revisionName · pending check ③ Render + write vNstatus=pending-upgrade ④ Ownership checkmanaged-by · annotations ⑤ Call the APISSA / three-way merge ⑥ Wait + finalizedeployed / failed #7 cluster unreachable#8 Wrong namespace#35 #36 Cloud authentication #1 name still in use#2 in progress#3 no deployed#10 no N version m2: template/values errors#11 Secret > 1 MiB #4 exists and cannotbe imported #6 field is immutable#12 SSA conflict#43 no matches for kind #5 not ready / timeout#9 Auto-rollback wipes evidence#39 hook failureProcess killed → #2 Status is all on the release Secret’s labels: kubectl get secret -l owner=helm,name=<release> -L status,versionpre- / post- hooks run before ⑤ and after ⑥ respectively (Module 4); if Helm is killed after ③ → permanently pending
Figure 1-1: first see which step failed, then see the cause
Release state machine (one Secret per revision) pending-install pending-upgrade deployed failed superseded uninstalled Success Failure/timeout New revision succeeds uninstall --keep-history Process killed → stays pending (#2)failed does not block the next upgradeOld records beyond history-max are deleted (#10)
Figure 1-2: only pending-* blocks the next operation; only one deployed exists at a time

Release state machine simulator

Click the operations in order and watch how each revision Secret’s status changes, and what the next command returns. The simulation logic matches the Helm 4 source: pending is a pessimistic lock, a failed upgrade writes failed, and rollback creates a new revision.

Starting from helm install this state.
$ kubectl get secret -l owner=helm,name=myapp -L status No resources found in lab8-m1 namespace.
Environment the kind cluster from Module 0 lab and ~/helmlab/lab8/myapp. Each lab uses its own namespace and is cleaned up right after.

Lab 1-A: create and recover a pending-upgrade (#2)

cd ~/helmlab/lab8
helm upgrade --install myapp ./myapp -n lab8-m1 --create-namespace --wait
helm upgrade myapp ./myapp -n lab8-m1 --set image.tag=does-not-exist --wait --timeout 2m &
sleep 8; kill -9 $!          # simulate a CI runner being reclaimed
helm history myapp -n lab8-m1
REVISION  STATUS           DESCRIPTION
1         deployed         Install complete
2         pending-upgrade  Preparing upgrade
helm upgrade myapp ./myapp -n lab8-m1 --wait
Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress
After confirming no other process is running, roll back to clear it:
pgrep -fa 'helm upgrade' || echo "no running helm"
helm rollback myapp 1 -n lab8-m1 --wait && helm history myapp -n lab8-m1 --max 3
Rollback was a success! Happy Helming!
2   failed     … (or superseded, depending on version)
3   deployed   Rollback to 1
Cleanup: helm uninstall myapp -n lab8-m1; kubectl delete ns lab8-m1

Lab 1-B: ownership conflict and takeover (#4)

kubectl create ns lab8-m1b
helm template myapp ./myapp -n lab8-m1b | kubectl apply -n lab8-m1b -f -     # simulate “previously managed with kubectl”
helm install myapp ./myapp -n lab8-m1b
Error: INSTALLATION FAILED: unable to continue with install: ServiceAccount "myapp" in namespace "lab8-m1b" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "myapp"; …

helm template the output already has the managed-by: Helm label, so only the missing annotation is reported; the first object type checked may differ.

helm install myapp ./myapp -n lab8-m1b --take-ownership
kubectl get deploy myapp -n lab8-m1b -o jsonpath='{.metadata.annotations.meta\.helm\.sh/release-name}{"\n"}'
myapp
Cleanup: helm uninstall myapp -n lab8-m1b; kubectl delete ns lab8-m1b

Lab 1-C: immutable selector (#6)

cp -r myapp myapp-m1c
helm upgrade --install m1c ./myapp-m1c -n lab8-m1c --create-namespace --wait
# add a new label to selectorLabels
sed -i '/define "myapp.selectorLabels"/a tier: web' myapp-m1c/templates/_helpers.tpl
helm upgrade m1c ./myapp-m1c -n lab8-m1c
Error: UPGRADE FAILED: … Deployment.apps "m1c-myapp" is invalid: spec.selector: Invalid value: …: field is immutable
After restoring the selector, the upgrade succeeds:
sed -i '/^tier: web$/d' myapp-m1c/templates/_helpers.tpl
helm upgrade m1c ./myapp-m1c -n lab8-m1c --wait && helm history m1c -n lab8-m1c --max 3
Cleanup: helm uninstall m1c -n lab8-m1c; kubectl delete ns lab8-m1c; rm -rf myapp-m1c

Lab 1-D: SSA field conflict (#12)

helm upgrade --install m1d ./myapp -n lab8-m1d --create-namespace --wait
helm get metadata m1d -n lab8-m1d | grep -i apply      # Helm 4 fresh install: server-side
kubectl scale deploy m1d-myapp -n lab8-m1d --replicas=3   # another field manager changed replicas
helm upgrade m1d ./myapp -n lab8-m1d --set config.greeting=hi
Error: UPGRADE FAILED: … Apply failed with 1 conflict: conflict with "kubectl" using apps/v1: .spec.replicas

kubectl scale Updated via the scale subresource; the manager name may appear as kubectl or kubectl-scale; if your environment produces no conflict (for example, because the release uses client-side merge), observe --show-managed-fields is enough.

helm upgrade m1d ./myapp -n lab8-m1d --set config.greeting=hi --force-conflicts --wait
kubectl get deploy m1d-myapp -n lab8-m1d -o jsonpath='{.spec.replicas}{"\n"}'
1
Cleanup: helm uninstall m1d -n lab8-m1d; kubectl delete ns lab8-m1d

Instructional videos (titles and channels verified via YouTube oEmbed)

▶
Helm Charts Kubernetes Release Lifecycle: Upgrade, Rollback & Dependencies | Part 6 — SP Nexa DevOps
English · release lifecycle, upgrade and rollback (corresponding to #2, #3, #10) · duration/date not verified via oEmbed
▶
Helm Upgrade Command | How to use Helm Upgrade Command - Part 12 — Rahul Wagh
English · review of basic helm upgrade usage; the video is based on Helm 3, so flag names follow this course’s Helm 4 notes

No verified video specifically covering Helm release status and pending-upgrade troubleshooting was found. Below is a 3-minute storyboard you can record yourself:

Shot 1 (0:00) Split terminal: on the left helm upgrade --wait is running, on the right kubectl get secret -l owner=helm -L status -w live shows v2 = pending-upgrade.
Shot 2 (0:40) kill -9 the left-side process, then upgrade again reports “another operation … is in progress”; highlight the source comment “pessimistic lock”.
Shot 3 (1:30) helm rollback v3=deployed is created and pending clears; compare with the risk of the “delete Secret” approach.
Shot 4 (2:20) kubectl scale After that, upgrade reports an SSA conflict; show managedFields, then use --force-conflicts. Recap: the lock, ownership, and field managers.

Official docs

or score ≥ 70% in the “Quiz”

Module 2 · Part A: Templates and Values (issues 13–25)

08:00 – 16:00 · YAML indentation, nil pointer, required, schema, --set types, values merging, scope, config rolling, subchart, lookup
8 minGo template · Sprig · JSON Schema13 issues
Learning objectives
  • Know which of the three stages a template error occurs in: parsing (parse error: undefined function, unmatched brackets) → execution (execution error: nil pointer, required, fail) → YAML conversion (YAML parse error: indentation, unquoted values).
  • Explain the values merge order: the chart’s values.yaml → parent chart overrides for subcharts → -f files (left to right) → --set*; maps are deep-merged,lists are replaced as a whole; schema validation then runs.
  • Be fluent with helm template --debug,--show-only,helm get values --all to locate problems.

Enter a keyword (such as nil pointer,YAML,schema,reuse) to filter; click a row to jump to details.

#13 Error: INSTALLATION FAILED: YAML parse error on myapp/templates/deployment.yaml: error converting YAML to JSON: yaml: line 24: did not find expected key
Error: INSTALLATION FAILED: YAML parse error on myapp/templates/deployment.yaml: error converting YAML to JSON: yaml: line 24: did not find expected key

Symptom: Template rendering succeeds, but the rendered output is not valid YAML. Common variants: mapping values are not allowed in this context,could not find expected ':',found character that cannot start any token.

Root cause: Helm first runs the Go template to get plain text, then splits it by --- and parses each piece as YAML. The most common cause is toYaml a wrong indentation after (using indent instead of nindent, or the wrong number of indent spaces),{{- eats the newline, or a value containing a colon or asterisk is not quote. The line number in the error refers to the rendered file, not the template source file.

Diagnostic command
helm template myapp ./myapp --debug --show-only templates/deployment.yaml 2>&1 | cat -n | sed -n '15,30p'
# --debug still prints the rendered output when YAML parsing fails, so you can compare line numbers
    22	        resources:
    23	          limits:
    24	        cpu: 500m        ← toYaml output is not indented under limits
Fix
        resources:
          {{- toYaml .Values.resources | nindent 10 }}
        # always quote string values:
        - name: GREETING
          value: {{ .Values.config.greeting | quote }}
Prevention and best practices
  • Remember the pattern {{- toYaml X | nindent N }}: {{- trim the preceding newline,nindent add a newline before indenting.
  • Run in CI helm lint --strict and helm template | kubeconform -strict.

See Lesson 2 Module 2 Template syntax,Lesson 7 Module 5 Template debugging.

#14 executing "myapp/templates/service.yaml" at <.Values.service.port>: nil pointer evaluating interface {}.port
Error: INSTALLATION FAILED: template: myapp/templates/service.yaml:12:21: executing "myapp/templates/service.yaml" at <.Values.service.port>: nil pointer evaluating interface {}.port

Symptom: The user’s values file does not set service: (or sets it as Service:,svc:), or uses --reset-values/new chart removed a parent key.

Root cause: Go templates access .Values.service.port when .Values.service is nil, then access .port is a field access on nil. Only the last level missing (.port does not error; it just renders empty. Only a missing middle level causes a nil pointer.

Diagnostic command
helm template myapp ./myapp -f values-prod.yaml --debug 2>&1 | head -5
yq '.service' values-prod.yaml; helm show values ./myapp | yq '.service'
helm get values myapp -n lab8-m2 --all | yq '.service'      # the “merged” values of the installed release
Fix
# Template-side defense: check each level, or use dig to read nested keys that may be missing
port: {{ (.Values.service | default dict).port | default 80 }}
port: {{ dig "service" "port" 80 .Values.AsMap }}
# or wrap the whole block in with
{{- with .Values.service }}
  port: {{ .port }}
{{- end }}
Prevention and best practices
  • Give every parent key a default in the chart’s values.yaml (even if it is {}), and use values.schema.json’s required constraint to require parent keys (#16).
  • Misspelled keys are caught in the schema with additionalProperties: false to catch them.

See Lesson 2 Module 4 conditionals, loops and values design.

#15 Error: execution error at (myapp/templates/secret.yaml:9:21): redis.password is required
Error: INSTALLATION FAILED: execution error at (myapp/templates/secret.yaml:9:21): redis.password is required

Symptom: The chart author uses required or fail to force a user to supply a value, and the user does not; in CI this often happens when a secret comes from a pipeline variable whose name is misspelled.

Root cause: This is an intentional failure: {{ required "redis.password is required" .Values.redis.password }} returns an error when the value is empty. Note that helm lint lint downgrades it to a warning by default (source comment “Don’t fail on missing required values when linting”), so passing lint does not mean the install will succeed.

Diagnostic command
grep -rn 'required\|fail ' myapp/templates/ | head
helm template myapp ./myapp -f values-prod.yaml --set redis.password=dummy >/dev/null && echo render-ok
Fix
# Do not put secrets in values files: read them from CI secrets / Key Vault and pass them via --set-file or a temporary -f file
helm upgrade --install myapp ./myapp -n lab8-m2 --set-string redis.password="$REDIS_PASSWORD"
# Better: the chart supports existingSecret, with External Secrets creating the Secret
Prevention and best practices
  • Write error messages as “key name + purpose + how to supply it”, for example redis.password is required (or set redis.existingSecret).
  • Do not required render secrets directly into a ConfigMap in --set values are stored in the release Secret (helm get values readable).

See Lesson 2 Module 4,Lesson 6 Module 3 secret management.

#16 values don't meet the specifications of the schema(s) in the following chart(s): myapp: - at '/replicaCount': got string, want integer
Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
myapp:
- at '/replicaCount': got string, want integer

Symptom: Passing --set-string replicaCount=3, or writing in the values file replicaCount: "3"; or missing required keys in the schema; or adding additionalProperties: false keys that are forbidden.

Root cause: After merging values and before rendering, Helm uses the chart’s (and each subchart’s) values.schema.json schema to validate the final values. install, upgrade, lint and template all run this validation.

Diagnostic command
jq '.properties.replicaCount' myapp/values.schema.json
helm template myapp ./myapp -f values-prod.yaml >/dev/null
helm get values myapp -n lab8-m2 -o json | jq '.replicaCount|type'
Fix
helm upgrade myapp ./myapp -n lab8-m2 --set replicaCount=3        # --set parses 3 as an integer
# Emergency only (not recommended): --skip-schema-validation skips validation
Prevention and best practices
  • The schema is the chart’s “interface contract”: give key fields a type, enum, minimum value and required, and run it against each environment’s values file in CI helm lint -f.
  • Use $schema to explicitly declare the draft version (for example https://json-schema.org/draft/2020-12/schema), so different tools do not interpret it under different drafts.

See Lesson 2 Module 5 values.schema.json validation.

#17 --set image.tag=1.10 deployed 1.1; json: cannot unmarshal number into Go struct field … of type string
Error: UPGRADE FAILED: failed to create resource: Deployment in version "v1" cannot be handled as a Deployment: json: cannot unmarshal number into Go struct field EnvVar.spec.template.spec.containers.env.value of type string

Symptom: Two forms: ① no error, but the wrong version is deployed —--set image.tag=1.10 is parsed as the float 1.1; ② an environment variable value --set env.PORT=8080 renders as a number, and the API server rejects it (EnvVar.value must be a string).

Root cause:--set infers types (number, boolean, null); unquoted 1.10,on/yes values such as these are also parsed as numbers or booleans. In templates without quote the quote function, numbers are output unchanged.

Diagnostic command
helm get values myapp -n lab8-m2 -o json | jq '.image.tag, (.image.tag|type)'
helm get manifest myapp -n lab8-m2 | grep -n 'image:'
1.1
"number"
      image: "myapp:1.1"
Fix
helm upgrade myapp ./myapp -n lab8-m2 --set-string image.tag=1.10
# In templates, consistently quote / toString string fields:
#   image: "{{ .Values.image.repository }}:{{ .Values.image.tag | toString }}"
#   value: {{ .value | quote }}
Prevention and best practices
  • Treat version numbers and port numbers as strings when used as environment variables; in the schema, set image.tag defined as "type": "string", so the #16 validation catches it earlier.
  • In CI, prefer passing values -f values-ci.yaml (explicit quotes) or --set-string; even better, deploy images by digest (image.digest).

See Lesson 1 Module 4 Values: overrides and precedence.

#18 nil pointer after upgrading chart: --reuse-values did not carry over the defaults newly added in the new chart
$ helm upgrade myapp ./myapp-0.2.0 -n lab8-m2 --reuse-values
Error: UPGRADE FAILED: template: myapp/templates/deployment.yaml:48:28: executing "myapp/templates/deployment.yaml" at <.Values.metrics.enabled>: nil pointer evaluating interface {}.enabled

Symptom: The new chart version added a metrics: block, and using --reuse-values upgrade reports a nil pointer, while a fresh install works.

Root cause:--reuse-values means “use the last release’s final merged values, then merge command-line overrides”, and ignore the new chart’s values.yaml defaults. A newly added key does not exist in the previous release → nil. Conversely,--reset-values will drop the values previously passed via --set flags.

Diagnostic command
helm get values myapp -n lab8-m2            # user-supplied values (previous revision)
helm show values ./myapp-0.2.0 | yq '.metrics'
diff <(helm show values ./myapp-0.1.0) <(helm show values ./myapp-0.2.0)
Fix
helm upgrade myapp ./myapp-0.2.0 -n lab8-m2 --reset-then-reuse-values   # new chart defaults + last user values + this run’s overrides
# Best: all values come from the values file in Git and are passed in full every time
helm upgrade myapp ./myapp-0.2.0 -n lab8-m2 -f values/common.yaml -f values/prod.yaml
Prevention and best practices
  • Pipelines should not rely on “last values”; the values file in GitOps is the only source of truth.
  • Chart authors use dig/default dict for compatibility (#14).

See Lesson 1 Module 4,Lesson 6 Module 2 layered values and multiple environments.

#19 After environment values override, list items in base values (env, tolerations, volumes) disappeared
$ helm get manifest myapp -n lab8-m2 | yq 'select(.kind=="Deployment").spec.template.spec.containers[0].env'
- name: LOG_LEVEL
  value: debug
(REDIS_HOST and APP_VERSION in common.yaml are both gone)

Symptom: common.yaml defines 5 environment variables and prod.yaml only wants to “add one”, but only the one in prod.yaml is left, and the app cannot connect to Redis.

Root cause: Helm’s values merge deep-merges maps, and replaces lists as a whole (the latter overrides the former). --set env[0].name=… also replaces the whole list.

Diagnostic command
helm template myapp ./myapp -f values/common.yaml -f values/prod.yaml | yq 'select(.kind=="Deployment").spec.template.spec.containers[0].env'
helm get values myapp -n lab8-m2 --all | yq '.env'
Fix
# Design lists that must be merged as maps, and have the template convert them to lists
env:
  REDIS_HOST: myapp-redis
  APP_VERSION: "1.1"
# prod.yaml contains only differences
env:
  LOG_LEVEL: info
# template
        env:
          {{- range $k, $v := .Values.env }}
          - name: {{ $k }}
            value: {{ $v | quote }}
          {{- end }}
Prevention and best practices
  • Values design principle: use maps for collections overridden at multiple layers; use lists only for ordered lists that truly need them (args), and document “whole-list replacement”.
  • Provide extraEnv a list as an append point.

See Lesson 2 Module 4 values design,Lesson 6 Module 2.

#20 Error: parse error at (myapp/templates/configmap.yaml:9): function "toYml" not defined
Error: INSTALLATION FAILED: parse error at (myapp/templates/configmap.yaml:9): function "toYml" not defined

Symptom: Misspelled function names (toYml,nindnet), or using a function that exists only in newer Helm (for example, newer Sprig functions or custom template functions from Helm 4 plugins), which fails on older Helm versions or on machines without the plugin installed. Similar cases: unexpected "}" in operand,unexpected EOF (missing {{ end }}).

Root cause: Templates are parsed before execution; function names must exist in the function table (Go built-ins + Sprig + Helm custom functions such as include/tpl/required/lookup/toYaml). Parse errors have nothing to do with values; they fail for any value.

Diagnostic command
helm lint myapp
helm version --short; grep -n 'helm.sh/\|kubeVersion' myapp/Chart.yaml
Fix

Correct the spelling; if the chart depends on a function that exists only in a certain Helm version, pin the Helm version in the README and CI, and avoid plugin-provided functions in templates (plugins are not necessarily present on every deploy side, such as Argo CD).

Prevention and best practices

Before committing helm lint; use the Helm language server (helm-ls) in your editor for function completion.

See Lesson 2 Module 2 Go templates and Sprig.

#21 executing … at <.Values.image.repository>: can't evaluate field Values in type interface {} (scope inside range/with)
Error: INSTALLATION FAILED: template: myapp/templates/deployment.yaml:31:25: executing "myapp/templates/deployment.yaml" at <.Values.image.repository>: can't evaluate field Values in type interface {}

Symptom: Inside range .Values.sidecars or with .Values.service block, accessing .Values,.Release.Name or calling include "myapp.fullname" . fails.

Root cause:range range and with with change . the dot (the current context) to the current element. Inside the block, .Values .Values is actually “element.Values”. The root context is stored in $ .

Diagnostic command
helm template myapp ./myapp --debug 2>&1 | grep -m1 'executing'
sed -n '25,35p' myapp/templates/deployment.yaml
Fix
{{- range .Values.sidecars }}
- name: {{ .name }}
  image: "{{ $.Values.image.repository }}:{{ .tag }}"
  {{- include "myapp.labels" $ | nindent 2 }}
{{- end }}
Prevention and best practices

Always use $ to access globals; when you need both the root context and a local value, use dict "root" $ "item" . to pass them to a named template.

See Lesson 2 Module 3 named templates and scope.

#22 helm upgrade succeeds but Pods do not restart: ConfigMap/Secret changes do not trigger a rollout
$ helm upgrade myapp ./myapp -n lab8-m2 --set config.greeting=hi
Release "myapp" has been upgraded. Happy Helming!
$ kubectl get pod -n lab8-m2      # AGE is still 2 days ago; the app still reads the old config

Symptom: Only a value in the ConfigMap was changed and the release revision increased, but Pods were not recreated; config injected as environment variables is not hot-reloaded.

Root cause: A Deployment rolls out only when spec.template changes. A ConfigMap content change does not alter the Pod template. Helm does not restart workloads automatically.

Diagnostic command
helm diff upgrade myapp ./myapp -n lab8-m2 --set config.greeting=hi    # only the ConfigMap differs
kubectl rollout history deploy/myapp -n lab8-m2
Fix
# Put a checksum of the config content in a Pod template annotation
  template:
    metadata:
      annotations:
        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
Prevention and best practices
  • Do not use rollme: {{ randAlphaNum 5 }} annotations that change on every run — they restart Pods on every upgrade and leave GitOps permanently OutOfSync (#46).
  • Secrets managed by External Secrets are not in the chart; use a controller such as Reloader to trigger rollouts.

See Lesson 2 Module 8,Lesson 6 Module 7 zero-downtime upgrades.

#23 Subchart values are not taking effect (redis still uses the default password and resources)
$ helm get values myapp -n lab8-m2
auth:
  password: s3cret       ← written at the top level
$ kubectl get sts myapp-redis -n lab8-m2 -o yaml | grep -A2 resources
        resources: {}

Symptom: The umbrella chart depends on the redis subchart; users put the subchart’s values at the top level, or used the wrong key name (the dependency set alias).

Root cause: The parent chart only passes Keyed by the subchart name (or alias) , the block of values is passed to the subchart; global values under it are also passed to all subcharts. A subchart cannot read other values from the parent chart. condition: redis.enabled A typo here means the subchart may not even be rendered.

Diagnostic command
yq '.dependencies' myapp/Chart.yaml
helm template myapp ./myapp | grep -c 'kind: StatefulSet'
helm show values myapp/charts/redis-*.tgz | head -30
Fix
# Chart.yaml
dependencies:
  - name: redis
    version: "0.x.x"
    repository: oci://registry-1.docker.io/cloudpirates
    alias: cache
    condition: cache.enabled
# values.yaml — use the alias as the key
cache:
  enabled: true
  auth:
    password: ""          # provided by existingSecret
global:
  imageRegistry: myacr.azurecr.io
Prevention and best practices

In the parent chart's values.yaml, document the most commonly used keys for each subchart; to export values from a subchart to the parent, use import-values.

See Lesson 2 Module 6 Dependencies, subcharts and library charts.

#24 Each helm upgrade generates a different random password; lookup returns empty under helm template
$ helm upgrade myapp ./myapp -n lab8-m2
$ kubectl logs deploy/myapp -n lab8-m2 | tail -1
redis.exceptions.AuthenticationError: invalid username-password pair or user is disabled.

Symptom: The chart uses randAlphaNum 16 to generate the password, so the Secret is rewritten on every upgrade, but Redis's data directory still uses the old password; or uses lookup to reuse an existing Secret, and in helm template,--dry-run=client, Argo CD, lookup always returns an empty map, so a new password is generated again.

Root cause: The template is re-executed on every render randAlphaNum. lookup Only when Helm runs against a cluster (install/upgrade,--dry-run=server) does lookup query the API; offline rendering returns empty.

Diagnostic command
helm history myapp -n lab8-m2 --max 3
kubectl get secret myapp-redis -n lab8-m2 -o jsonpath='{.metadata.resourceVersion}'   # changes on every upgrade
helm template myapp ./myapp | grep -A3 'kind: Secret'
Fix
{{- $existing := lookup "v1" "Secret" .Release.Namespace (printf "%s-redis" (include "myapp.fullname" .)) }}
{{- $pw := "" }}
{{- if $existing }}{{- $pw = index $existing.data "password" | b64dec }}{{- else }}{{- $pw = randAlphaNum 24 }}{{- end }}
# and add “helm.sh/resource-policy”: keep to the Secret so it is not deleted on uninstall
Prevention and best practices
  • Better approach: the chart does not generate secrets; it provides existingSecret, with the Secret supplied by External Secrets / Key Vault / Secrets Manager (Lessons 3, 4, 6).
  • Do not rely on lookup under GitOps.

See Lesson 6 Module 3 Secrets: helm-secrets, SOPS and External Secrets.

#25 Error: chart requires kubeVersion: >=1.38.0-0 which is incompatible with Kubernetes v1.37.0
Error: INSTALLATION FAILED: chart requires kubeVersion: >=1.38.0-0 which is incompatible with Kubernetes v1.37.0

Symptom: The chart's Chart.yaml declares kubeVersion constraint that the target cluster does not satisfy; or helm template when rendering offline, the built-in default Kubernetes version is used, so the output differs from the real cluster (.Capabilities.APIVersions.Has returns false, so objects such as Ingress/PDB are skipped).

Root cause: Before rendering, Helm uses discovery to get the cluster version and API list, and fills them into .Capabilities; offline rendering uses defaults. Cloud vendor version numbers often carry a suffix (v1.37.1-eks-…), and a constraint that omits -0 the pre-release suffix causes a mismatch.

Diagnostic command
kubectl version -o json | jq -r .serverVersion.gitVersion
yq '.kubeVersion' myapp/Chart.yaml
helm template myapp ./myapp --kube-version 1.37.0 --api-versions monitoring.coreos.com/v1 | grep -c ServiceMonitor
Fix
  • Write the constraint as ">=1.30.0-0" (with -0 to accept the cloud vendor's pre-release suffix).
  • In CI, explicitly pass --kube-version and --api-versions, or use --dry-run=server to render against the real cluster.
Prevention and best practices

Use .Capabilities when checking, also provide a values switch (such as serviceMonitor.enabled), so GitOps tools (offline rendering) also get a deterministic result.

See Lesson 2 Module 1 Chart.yaml,Lesson 1 Module 7 helm template.

From values to Kubernetes objects: five stages and the matching issue numbers ① Merge valueschart → parent → -f → --setmap deep merge · list replace ② Schema validationeach chart'svalues.schema.json ③ Parse templatesfunction table · syntaxparse error ④ Execute templates.Values · $ · lookupexecution error ⑤ YAML → objectssplit on --- · sortAPI server decoding #18 --reuse-values#19 list replaced#23 subchart key names #16 got string,want integer #20 function"toYml" not defined #14 nil pointer#15 required#21 scope · #24 lookup#25 Capabilities #13 YAML parse error#17 type mismatch#22 no rollout triggered Debugging tools: helm template --debug --show-only · helm get values --all · helm lint --strict · helm template | kubeconformLine numbers in errors: parse/execution errors point to the template source file; YAML parse errors point to the rendered file
Figure 2-1: first identify which stage the error comes from, then decide whether to check values or the template
values merge example (#19): maps merge, lists are replaced common.yamlresources: {limits: {cpu: 1}}env: [REDIS_HOST, APP_VERSION]labels: {team: web} prod.yamlresources: {limits: {memory: 1Gi}}env: [LOG_LEVEL]labels: {tier: prod} Final valueslimits: {cpu: 1, memory: 1Gi} ✓ mergedenv: [LOG_LEVEL] ✗ replaced as a wholelabels: {team, tier} ✓ mergedsetting a key to null deletes the default key
Figure 2-2: collections that need layering should be designed as maps

“Rendering error” troubleshooting decision tree

Pick the symptom you see to step through the diagnostic commands and conclusions; each conclusion can jump to the matching issue details.

Environment Only Helm is needed (most steps are offline rendering); the last lab needs a kind cluster lab. Work in ~/helmlab/lab8 .

Lab 2-A: indentation causes a YAML parse error (#13)

cd ~/helmlab/lab8 && cp -r myapp m2a
sed -i 's/toYaml .Values.resources | nindent 12/toYaml .Values.resources | indent 6/' m2a/templates/deployment.yaml
helm template t ./m2a --set resources.limits.cpu=500m
Error: YAML parse error on m2a/templates/deployment.yaml: error converting YAML to JSON: yaml: line 4x: did not find expected key

If your helm create version's resources line is not indented by 12, first grep -n 'toYaml .Values.resources' m2a/templates/deployment.yaml check it, then replace.

helm template t ./m2a --set resources.limits.cpu=500m --debug --show-only templates/deployment.yaml 2>/dev/null | grep -n -B2 -A2 'cpu'
Change it back to nindent 12 and rendering succeeds. Cleanup: rm -rf m2a

Lab 2-B: nil pointer and dig (#14, #18)

cp -r myapp m2b
printf 'service: null\n' > null-svc.yaml
helm template t ./m2b -f null-svc.yaml 2>&1 | head -2
Error: template: m2b/templates/service.yaml:8:18: executing "m2b/templates/service.yaml" at <.Values.service.type>: nil pointer evaluating interface {}.type

Setting a key to null removes it from the merged result; it is often used to “remove a default”, and is also a common source of nil pointers.

Defensive pattern:
sed -i 's/{{ .Values.service.type }}/{{ dig "service" "type" "ClusterIP" .Values.AsMap }}/' m2b/templates/service.yaml
helm template t ./m2b -f null-svc.yaml 2>&1 | head -2

If other lines still reference .Values.service.port, the next nil pointer will be reported elsewhere. This shows that “defending every site” is worse than “default values for parent keys in values.yaml + a schema constraint”.

Cleanup: rm -rf m2b null-svc.yaml

Lab 2-C: schema catches type errors (#16, #17)

cp -r myapp m2c
cat > m2c/values.schema.json <<'EOF'
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["image", "replicaCount"],
  "properties": {
    "replicaCount": { "type": "integer", "minimum": 1 },
    "image": { "type": "object", "required": ["repository", "tag"],
      "properties": { "tag": { "type": "string" } } }
  }
}
EOF
helm template t ./m2c --set-string replicaCount=2 >/dev/null
helm template t ./m2c --set image.tag=1.10 >/dev/null
Error: values don't meet the specifications of the schema(s) in the following chart(s):
m2c:
- at '/replicaCount': got string, want integer
Error: values don't meet the specifications of the schema(s) in the following chart(s):
m2c:
- at '/image/tag': got number, want string
helm template t ./m2c --set replicaCount=2 --set-string image.tag=1.10 | grep 'image:'
          image: "myapp:1.10"
Cleanup: rm -rf m2c

Lab 2-D: --reuse-values and new defaults (#18)

helm upgrade --install m2d ./myapp -n lab8-m2 --create-namespace --set config.greeting=hey --wait
cp -r myapp m2d-v2 && sed -i 's/^version: .*/version: 0.2.0/' m2d-v2/Chart.yaml
printf 'metrics:\n  enabled: false\n' >> m2d-v2/values.yaml
sed -i '0,/annotations:/s//annotations:\n        metrics-enabled: {{ .Values.metrics.enabled | quote }}/' m2d-v2/templates/deployment.yaml
helm upgrade m2d ./m2d-v2 -n lab8-m2 --reuse-values 2>&1 | tail -1
Error: UPGRADE FAILED: template: … at <.Values.metrics.enabled>: nil pointer evaluating interface {}.enabled

The sed insertion point depends on helm create the generated deployment.yaml; if the insertion point is not under the Pod template metadata, add it manually under template.metadata.annotations instead.

helm upgrade m2d ./m2d-v2 -n lab8-m2 --reset-then-reuse-values --wait
helm get values m2d -n lab8-m2 --all | grep -E 'greeting|enabled'
  greeting: hey
  enabled: false
Cleanup: helm uninstall m2d -n lab8-m2; kubectl delete ns lab8-m2; rm -rf m2d-v2

Instructional videos (titles and channels verified via YouTube oEmbed)

▶
How to use helm lint, helm –debug –dry run, and helm template | How to Troubleshoot Errors in Helm — DevOps Hint
English · matches this module's debugging tools (#13–#21) · based on Helm 3
▶
How to Create Helm Charts - The Ultimate Guide — DevOps Journey
English · review of templates, values and _helpers.tpl
Storyboard (2 minutes, self-recorded) Using one chart, trigger a parse error, a nil pointer and a YAML parse error in turn, showing where the line number points in each of the three errors, then use --debug --show-only to locate them.

Official docs

or score ≥ 70% in the “Quiz”

Module 3 · Part A: Repositories, OCI and cloud platforms (issues 26–38)

16:00 – 24:00 · HTTP repository index, dependency builds, OCI references and digests, ACR/ECR authentication, AKS/EKS credential plugins, cloud controller charts
8 minoci:// · ACR · ECR13 issues
Learning objectives
  • Distinguish the failure surfaces of the two distribution methods: HTTP repositories (index.yaml ) + local cache, which requires helm repo add/update) and OCI (no index; pulled by oci://host/path/chart:version or @sha256: directly, with credentials in registry/config.json).
  • Be able to tell from CI logs whether a problem is in the Helm layer (repositories, dependencies), the registry layer (401/403/404, tag rules), or the kubeconfig credential plugin layer (kubelogin, aws eks get-token).
  • Know the common reasons cloud platform charts (LBC, Workload Identity) install but do not work.

Enter a keyword (such as index,401,digest,kubelogin) to filter; click a row to jump to details.

#26 Error: looks like "https://charts.example.com" is not a valid chart repository or cannot be reached: failed to fetch https://charts.example.com/index.yaml : 404 Not Found
Error: looks like "https://charts.example.com" is not a valid chart repository or cannot be reached: failed to fetch https://charts.example.com/index.yaml : 404 Not Found

Symptom:helm repo add fails. Common causes: the URL is missing its path (the GitHub Pages /charts), adding an OCI address as an HTTP repository (OCI registries have no index.yaml), private repositories needing authentication, corporate proxy/certificate interception (in which case the cause is x509: certificate signed by unknown authority).

Root cause: An HTTP repository is simply a static site that serves index.yaml ; repo add immediately downloads the index to verify it. An OCI registry cannot be helm repo add, so use oci:// directly as the reference.

Diagnostic command
curl -sSI https://charts.example.com/index.yaml | head -1
curl -s https://stefanprodan.github.io/podinfo/index.yaml | head -3
helm env | grep -E 'REPOSITORY_(CONFIG|CACHE)'
Fix
helm repo add podinfo https://stefanprodan.github.io/podinfo          # correct HTTP repository
helm show chart oci://ghcr.io/stefanprodan/charts/podinfo --version 6.17.0   # OCI: no repo add needed
helm repo add private https://charts.corp.example --username "$U" --password-stdin <<< "$P"
helm repo add corp https://charts.corp.example --ca-file /etc/ssl/corp-ca.pem
Prevention and best practices

For new projects, prefer OCI (same registry, permissions and scanning as images); if an HTTP repository must be kept, host it with chart-releaser or object storage, and monitor index.yaml availability.

See Lesson 1 Module 2, Module 6 OCI repositories and chart distribution.

#27 Error: chart "myapp" matching 1.4.0 not found in corp index. (try 'helm repo update'): no chart version found
Error: chart "myapp" matching 1.4.0 not found in corp index. (try 'helm repo update'): no chart version found

Symptom: Chart 1.4.0 was just published, and installation fails on the deploy machine/CI; or a pre-release version is specified 1.4.0-rc.1 but the constraint does not allow it.

Root cause: Lookup in an HTTP repository is based entirely on the locally cached index ($HELM_CACHE_HOME/repository/corp-index.yaml) is not refreshed automatically. A version constraint (such as ~1.4) does not match pre-release versions by default; you need --devel or write -0 in the constraint.

Diagnostic command
helm search repo corp/myapp --versions --devel | head
yq '.entries.myapp[].version' "$(helm env HELM_REPOSITORY_CACHE)/corp-index.yaml" | head
Fix
helm repo update corp
helm upgrade --install myapp corp/myapp --version 1.4.0 -n prod
helm upgrade --install myapp corp/myapp --version 1.4.0-rc.1 --devel -n staging
Prevention and best practices

In CI, always run helm repo update before installing; or switch to OCI (resolved directly by tag, with no local index cache problem). In the release process, account for CDN caching between “push chart” and “deploy” (GitHub Pages may lag by a few minutes).

See Lesson 5 Module 2 Publishing charts: chart-releaser and OCI.

#28 Error: no repository definition for https://charts.example.com. Please add the missing repos via 'helm repo add'
$ helm dependency build ./myapp
Error: no repository definition for https://stefanprodan.github.io/podinfo. Please add the missing repos via 'helm repo add'

Similar cases: the lock file (Chart.lock) is out of sync with the dependencies file (Chart.yaml). Please update the dependencies with 'helm dependency update'.

Symptom: Works fine on a developer machine with helm dependency build ; fails on a clean CI runner, or the dependency version in Chart.yaml was changed but Chart.lock was not updated.

Root cause: For HTTP repository dependencies,dependency build/update the machine's repositories.yaml must already contain a repository with the matching URL (the name does not matter, but the URL must match). OCI dependencies (repository: oci://…) do not need repo add, only registry credentials. build Dependencies are pulled strictly from Chart.lock; if the lock and Chart.yaml disagree, the build is refused.

Diagnostic command
yq '.dependencies[]|[.name,.version,.repository]' myapp/Chart.yaml
helm repo list
cat myapp/Chart.lock
Fix
helm repo add podinfo https://stefanprodan.github.io/podinfo
helm dependency build ./myapp          # pull exactly as pinned in Chart.lock (use this in CI)
helm dependency update ./myapp         # re-resolve versions and update Chart.lock (for developers; commit the result to Git)
Prevention and best practices
  • Commit Chart.lock to Git; CI uses build rather than update, to ensure reproducibility.
  • Prefer OCI addresses for dependencies; CI only needs helm registry login.

See Lesson 2 Module 6 Dependencies and subcharts.

#29 Error: An error occurred while checking for chart dependencies … found in Chart.yaml, but missing in charts/ directory: redis
Error: INSTALLATION FAILED: an error occurred while checking for chart dependencies. You may need to run 'helm dependency build' to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory: redis

Symptom: Installing a local-directory chart directly from Git; charts/ is ignored by .gitignore (which is correct), but the dependencies were not built before deployment. It also appears in homemade deploy scripts other than Argo CD.

Root cause: When installing a local chart, Helm checks dependencies whether each dependency (whose condition is met) listed in charts/ exists. Packaging (helm package) produces a .tgz that already contains the dependencies, so this problem does not occur.

Diagnostic command
ls myapp/charts/; helm dependency list ./myapp
NAME    VERSION  REPOSITORY                                  STATUS
redis   0.x.x    oci://registry-1.docker.io/cloudpirates      missing
Fix
helm dependency build ./myapp && helm upgrade --install myapp ./myapp -n prod
# or in one step:
helm upgrade --install myapp ./myapp -n prod --dependency-update
Prevention and best practices

In the pipeline, separate “publish” from “deploy”: CI packages the chart (with dependencies) and pushes it to OCI, and CD only deploys immutable chart versions.

See Lesson 2 Module 6,Lesson 5 Module 1 Chart CI.

#30 In Helm 4, helm registry login oci://myacr.azurecr.io/charts fails: registry login only accepts a domain name
$ helm registry login oci://myacr.azurecr.io/helm --username 00000000-0000-0000-0000-000000000000 --password-stdin
Error: … (login fails, or the credentials are saved under the wrong key, and later pushes still return 401)

Symptom: Scripts from the Helm 3 era used oci:// prefix or an address with a path; after upgrading to Helm 4, the login step fails, or login “succeeds” but push/pull is still unauthorized.

Root cause: The Helm 4 change overview states clearly: helm registry login accepts only domain names (host[:port]), not full URLs. Credentials are stored by host in $HELM_REGISTRY_CONFIG (by default ~/.config/helm/registry/config.json), compatible with Docker's config.json format.

Diagnostic command
helm env HELM_REGISTRY_CONFIG
jq '.auths|keys' "$(helm env HELM_REGISTRY_CONFIG)"
[
  "myacr.azurecr.io"
]
Fix
helm registry login myacr.azurecr.io --username 00000000-0000-0000-0000-000000000000 \
  --password-stdin <<< "$(az acr login -n myacr --expose-token --query accessToken -o tsv)"
helm push myapp-0.1.0.tgz oci://myacr.azurecr.io/helm
Prevention and best practices

When migrating to Helm 4, grep all scripts for registry login oci://; put login and push in the same job, so the credential file path is not lost between jobs.

See Lesson 3 Module 2 ACR as an OCI chart repository,Lesson 7 Module 7 Helm 3 to Helm 4 migration.

#31 OCI push/pull 401 Unauthorized / 403 Forbidden (expired ACR token, insufficient permissions)
Error: failed to perform "Push" on destination: PUT "https://myacr.azurecr.io/v2/helm/myapp/manifests/0.1.0": response status code 401: unauthorized: authentication required

Symptom: In CI, the first few jobs push successfully, and jobs a few hours later get 401; or pull succeeds and push returns 403.

Root cause:① az acr login --expose-token The ACR refresh token obtained lasts about 3 hours (per Microsoft Learn); after it expires, the credentials in config.json become invalid; ② the identity only has AcrPull but not AcrPush (or the Repository-level role in ABAC mode); ③ the ECR get-login-password token is valid for 12 hours; ④ pushes went to a namespace on Docker Hub that belongs to someone else.

Diagnostic command
az acr check-health -n myacr --yes 2>&1 | tail -3
az role assignment list --assignee "$CLIENT_ID" --scope "$(az acr show -n myacr --query id -o tsv)" -o table
aws ecr describe-repositories --repository-names charts/myapp --region ca-central-1
Fix
# log in again before each job's push (OIDC federated identity → short-lived token)
az acr login -n myacr --expose-token --query accessToken -o tsv | helm registry login myacr.azurecr.io --username 00000000-0000-0000-0000-000000000000 --password-stdin
aws ecr get-login-password --region ca-central-1 | helm registry login --username AWS --password-stdin 123456789012.dkr.ecr.ca-central-1.amazonaws.com
Prevention and best practices

CI gets cloud identity via OIDC and stores no long-term passwords; separate the push identity from the cluster pull identity (push: AcrPush; cluster/Argo CD: AcrPull).

See Lesson 3 Module 2,Lesson 4 Module 2 ECR as an OCI chart repository.

#32 Chart version 1.2.0+build.7 cannot be found after push: the “+” in the OCI tag is replaced with “_”
$ helm push myapp-1.2.0+build.7.tgz oci://localhost:5001/charts --plain-http
Pushed: localhost:5001/charts/myapp:1.2.0_build.7
$ crane ls localhost:5001/charts/myapp      # external tools see 1.2.0_build.7

Symptom: SemVer build metadata (+ ) suffix appears in OCI as _; other tools (Argo CD version constraints, image scanning policies, cleanup scripts) look up + fail, or treat 1.2.0_build.7 as non-SemVer and ignore it.

Root cause: OCI tags do not allow + characters. When pushing, Helm replaces + with _, and converts it back to + (source code reference.go and client.go). In addition, SemVer specifies that build metadata does not take part in version precedence comparison, so 1.2.0+build.7 and 1.2.0+build.8 are treated as the same version.

Diagnostic command
helm show chart oci://localhost:5001/charts/myapp --version 1.2.0+build.7 --plain-http | grep ^version
Fix

Do not use build metadata to distinguish different content in chart versions; increment the version number whenever the content changes (1.2.1), or use a pre-release version 1.2.1-rc.7. In Helm commands you can still write +, but convert it in other tools.

Prevention and best practices

Chart versions are immutable: never push different content under the same version (enable tag immutability/locking on the registry side, for example ACR's --write-enabled false, and ECR's tag immutability).

See Lesson 1 Module 6,Lesson 5 Module 2.

#33 Error: chart reference digest mismatch: sha256:9b1f… is not sha256:4c1e…
Error: INSTALLATION FAILED: chart reference digest mismatch: sha256:9b1f… is not sha256:4c1e…

Symptom: Installing by digest with Helm 4 (oci://…/myapp:0.1.0@sha256:…), but someone re-pushed different content under the same tag; or the digest was copied incorrectly. Similar cases: chart reference and version mismatch: 0.2.0 is not 0.1.0 (the tag in the reference and --version do not match).

Root cause: Helm 4 supports installing by manifest digest and verifies the actual digest after resolution; on a mismatch it refuses to install. This is exactly the point of digest pinning: preventing supply-chain problems caused by overwritten tags.

Diagnostic command
helm pull oci://localhost:5001/charts/myapp --version 0.1.0 --plain-http -d /tmp/lab8/pull 2>&1 | grep Digest
crane digest localhost:5001/charts/myapp:0.1.0 --insecure
Fix

First find out why the content under the same tag changed (who pushed it, whether CI published twice); once the new content is trusted, update the digest in the deployment reference; if it is not trusted, roll back to the artifact matching the original digest.

Prevention and best practices
  • Production deployment references version + digest; enable tag immutability on the registry.
  • Combine with signature verification (cosign or Helm provenance; see interview Q28).

See Lesson 5 Module 3 Documentation and signing.

#34 ECR push: name unknown: The repository with name 'charts/myapp' does not exist in the registry
Error: … response status code 404: name unknown: The repository with name 'charts/myapp' does not exist in the registry with id '123456789012'

Symptom: On ACR you can push directly to any path; after switching to ECR, helm push the push fails.

Root cause: ECR does not create repositories automatically (unless a repository creation template is configured). helm push myapp-0.1.0.tgz oci://<acct>.dkr.ecr.<region>.amazonaws.com/charts pushes into the repository charts/myapp——the chart name is appended to the end of the path, so what needs to be created in advance is charts/myapp, not charts.

Diagnostic command
aws ecr describe-repositories --region ca-central-1 --query 'repositories[].repositoryName'
Fix
aws ecr create-repository --repository-name charts/myapp --region ca-central-1 \
  --image-tag-mutability IMMUTABLE --image-scanning-configuration scanOnPush=true
helm push myapp-0.1.0.tgz oci://123456789012.dkr.ecr.ca-central-1.amazonaws.com/charts
Prevention and best practices

Manage ECR repositories with Terraform (name = chart path + chart name), and configure lifecycle policies to clean up old versions.

See Lesson 4 Module 2 ECR as an OCI chart repository.

#35 AKS: getting credentials: exec: executable kubelogin not found
Error: kubernetes cluster unreachable: Get "https://myaks-dns-xxxx.hcp.canadacentral.azmk8s.io:443/version": getting credentials: exec: executable kubelogin not found

It looks like you are trying to use a client-go credential plugin that is not installed.

Symptom: After AKS enables Microsoft Entra ID integration, on the CI runner az aks get-credentials the generated kubeconfig uses the exec plugin kubelogin, but the runner does not have it installed or has not converted the login mode.

Root cause: Helm reads kubeconfig with client-go; an exec-type user needs a local executable. In non-interactive environments, kubelogin must also be set to azurecli,workloadidentity or spn mode; otherwise it tries device-code login and hangs.

Diagnostic command
kubectl config view --minify -o jsonpath='{.users[0].user.exec.command} {.users[0].user.exec.args}{"\n"}'
which kubelogin || echo missing
Fix
az aks install-cli                       # install kubectl and kubelogin
az aks get-credentials -g rg-helm-lab -n aks-helm-lab --overwrite-existing
kubelogin convert-kubeconfig -l azurecli  # use when az login (OIDC) has already been done in CI
helm list -A
Prevention and best practices

Use the official Azure task/Action in pipelines (it handles kubelogin), get identity through workload identity federation, and give the deploy identity the minimal AKS RBAC role (namespace-scoped).

See Lesson 3 Module 6 Pipeline deployment to AKS,Module 7 Cloud troubleshooting in practice.

#36 EKS: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1" / the server has asked for the client to provide credentials
Error: kubernetes cluster unreachable: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
---
Error: kubernetes cluster unreachable: the server has asked for the client to provide credentials

Symptom: Case 1: a kubeconfig generated by a very old AWS CLI; the newer client-go (built into Helm 4) no longer supports v1alpha1. Case 2: the token is valid, but this IAM identity has no access entry in EKS / aws-auth mapping.

Root cause: EKS kubeconfig uses aws eks get-token to generate short-lived tokens; on the cluster side, access entries map IAM principals to Kubernetes identities and access policies. The role CI assumes via OIDC differs from the developer's role, and it is often left out of the configuration.

Diagnostic command
aws --version; aws sts get-caller-identity
kubectl config view --minify -o jsonpath='{.users[0].user.exec.apiVersion}{"\n"}'
aws eks list-access-entries --cluster-name eks-helm-lab --region ca-central-1
Fix
aws eks update-kubeconfig --name eks-helm-lab --region ca-central-1     # newer CLI generates v1beta1
aws eks create-access-entry --cluster-name eks-helm-lab --principal-arn arn:aws:iam::123456789012:role/gha-deploy --region ca-central-1
aws eks associate-access-policy --cluster-name eks-helm-lab --principal-arn arn:aws:iam::123456789012:role/gha-deploy \
  --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy --access-scope type=namespace,namespaces=myapp --region ca-central-1
Prevention and best practices

Manage access entries with Terraform; grant the deploy role only namespace-scoped policies.

See Lesson 4 Module 6 Pipeline deployment to EKS,Module 7 Cloud troubleshooting in practice.

#37 failed calling webhook "mservice.elbv2.k8s.aws": … no endpoints available for service "aws-load-balancer-webhook-service"
Error: INSTALLATION FAILED: 1 error occurred:
	* Internal error occurred: failed calling webhook "mservice.elbv2.k8s.aws": failed to call webhook: Post "https://aws-load-balancer-webhook-service.kube-system.svc:443/mutate-v1-service?timeout=10s": no endpoints available for service "aws-load-balancer-webhook-service"

Symptom: In the same pipeline, the AWS Load Balancer Controller chart is installed first and the application chart right after; creating the Service/Ingress in the app fails. Or the LBC Pods never become ready because of IAM permission or image pull failures.

Root cause: LBC registers mutating/validating webhooks that intercept creation of Service and Ingress. When the webhook backend (controller Pods) is unavailable, the API server rejects requests according to failurePolicy. Installing LBC with Helm without --wait means that the chart reports “success” while the webhook is still not ready.

Diagnostic command
kubectl -n kube-system get deploy aws-load-balancer-controller
kubectl -n kube-system get endpoints aws-load-balancer-webhook-service
kubectl get mutatingwebhookconfigurations | grep elbv2
kubectl -n kube-system logs deploy/aws-load-balancer-controller | tail -20
Fix
helm upgrade --install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system \
  --set clusterName=eks-helm-lab --set serviceAccount.name=aws-load-balancer-controller --wait --timeout 5m
# deploy the application chart only after the controller is ready
Prevention and best practices

Deploy platform components (controllers, CRDs, webhooks) and applications in layers: the platform release carries --wait, and the application pipeline depends on the platform layer's health checks; uninstall in reverse order (apps first, then controllers), otherwise the Service finalizer will get stuck.

See Lesson 4 Module 4 AWS Load Balancer Controller chart.

#38 AADSTS700213: No matching federated identity record found for presented assertion subject 'system:serviceaccount:myapp:myapp-prod'
AADSTS700213: No matching federated identity record found for presented assertion subject 'system:serviceaccount:myapp:myapp-prod'. Check your federated identity credential Subject, Audience and Issuer against the presented assertion.

Symptom: The chart installs successfully and the Pod is Running, but the app fails to access Key Vault. The cause is that the release was renamed (myapp → myapp-prod) or fullnameOverride changes, so the ServiceAccount name changes with it, while the federated credential's subject still has the old name. The AWS equivalent is an SA name mismatch in a Pod Identity association or IRSA trust policy (AccessDenied … AssumeRoleWithWebIdentity).

Root cause: The Workload Identity trust chain is an exact match on “OIDC issuer + subject (system:serviceaccount:<ns>:<sa>)” exact match. By default the chart uses myapp.serviceAccountName a template to generate the SA name (including the release name), whereas the federated credential is static in Terraform/the portal.

Diagnostic command
kubectl get sa -n myapp -o custom-columns=NAME:.metadata.name,CLIENT:.metadata.annotations.azure\.workload\.identity/client-id
kubectl get pod -n myapp -l app.kubernetes.io/instance=myapp-prod -o jsonpath='{.items[0].spec.serviceAccountName}{" "}{.items[0].metadata.labels.azure\.workload\.identity/use}{"\n"}'
az identity federated-credential list -g rg-helm-lab --identity-name id-myapp --query '[].subject'
Fix
# values-prod.yaml: pin the SA name, and include the identity annotation and Pod label
serviceAccount:
  create: true
  name: myapp
  annotations:
    azure.workload.identity/client-id: "11111111-2222-3333-4444-555555555555"
podLabels:
  azure.workload.identity/use: "true"
Prevention and best practices

Explicitly pin the SA name bound to a cloud identity in values, and review it in the same PR as the Terraform federated credential / Pod Identity association.

See Lesson 3 Module 3 Chart design for Workload Identity and Key Vault,Lesson 4 Module 3 Pod Identity / IRSA.

Two chart sources + one cluster credential chain: which segment the problem is in HTTP repositoryrepo add → download index.yamlrepo update → refresh cache#26 #27 #28 OCI registryregistry login (domain only)tag / @sha256 resolved directly#30 #31 #32 #33 #34 Helm clientdependency buildcharts/ check #29render → call API kubeconfig execkubelogin #35aws eks get-token #36 API serverRBAC / access entryadmission webhook #37 RuntimePod → cloud identitySA name = subject #38 Registry credentials (pulling charts), cluster credentials (calling the API) and workload credentials (Pods accessing the cloud) are three separate identities; troubleshoot each one separately
Figure 3-1: first decide whether it is “cannot get the chart”, “cannot get into the cluster”, or “installed but the Pod has no permissions”

“Pull / authentication failure” troubleshooting decision tree

Start from the command where the error appeared.

Environment The local registry from Module 0 (localhost:5001,registry:3, no authentication, HTTP) and the kind cluster lab. Cloud platform issues (#31, #34–#38) are not reproduced locally; practise them with the diagnostic commands in the details, in the Lesson 3 and 4 environments.

Lab 3-A: missing dependencies and builds (#28, #29)

cd ~/helmlab/lab8 && cp -r myapp m3a
cat >> m3a/Chart.yaml <<'EOF'
dependencies:
  - name: podinfo
    version: "6.17.0"
    repository: https://stefanprodan.github.io/podinfo
    condition: podinfo.enabled
EOF
printf 'podinfo:\n  enabled: true\n' >> m3a/values.yaml
helm template t ./m3a >/dev/null
Error: an error occurred while checking for chart dependencies. You may need to run 'helm dependency build' to fetch missing dependencies: found in Chart.yaml, but missing in charts/ directory: podinfo
Simulate a CI runner with a “clean Helm configuration”:
HELM_REPOSITORY_CONFIG=/tmp/lab8/empty-repos.yaml helm dependency build ./m3a
Error: no repository definition for https://stefanprodan.github.io/podinfo. Please add the missing repos via 'helm repo add'
helm dependency update ./m3a && cat m3a/Chart.lock && ls m3a/charts/
helm template t ./m3a | grep -c 'podinfo'
Cleanup: rm -rf m3a /tmp/lab8/empty-repos.yaml

Lab 3-B: “+” becomes “_”, and installing by digest (#32, #33)

cp -r myapp m3b && sed -i 's/^version: .*/version: 0.3.0+build.7/' m3b/Chart.yaml
helm package m3b -d /tmp/lab8 && helm push /tmp/lab8/m3b-0.3.0+build.7.tgz oci://localhost:5001/charts --plain-http
curl -s localhost:5001/v2/charts/m3b/tags/list
Pushed: localhost:5001/charts/m3b:0.3.0_build.7
Digest: sha256:7d0e…
{"name":"charts/m3b","tags":["0.3.0_build.7"]}
Install by digest, then deliberately use a wrong digest:
D=$(helm push /tmp/lab8/m3b-0.3.0+build.7.tgz oci://localhost:5001/charts --plain-http 2>&1 | awk '/Digest/{print $2}')
helm install m3b oci://localhost:5001/charts/m3b@$D -n lab8-m3 --create-namespace --plain-http
helm install m3b-bad "oci://localhost:5001/charts/myapp:0.1.0@$D" -n lab8-m3 --plain-http    # install myapp:0.1.0 using m3b's digest
NAME: m3b … STATUS: deployed
Error: INSTALLATION FAILED: chart reference digest mismatch: sha256:4c1e… is not sha256:7d0e…

When both a tag and a digest are given, Helm resolves the tag and then checks the digest; when only a non-existent digest is given, you may get the registry's not found directly. Both cases refuse the installation.

Cleanup: helm uninstall m3b -n lab8-m3; kubectl delete ns lab8-m3; rm -rf m3b

Lab 3-C: stale cached index (#27)

helm repo add podinfo https://stefanprodan.github.io/podinfo 2>/dev/null; helm repo update podinfo
helm show chart podinfo/podinfo --version 99.0.0 2>&1 | tail -1
Error: chart "podinfo" matching 99.0.0 not found in podinfo index. (try 'helm repo update'): no chart version found
helm search repo podinfo/podinfo --versions | head -3
or score ≥ 70% in the “Quiz”

Module 4 · Part A: Hooks, CRDs, GitOps and migration (issues 39–50)

24:00 – 30:00 · hook stages and weights, deletion policies, crds/ directory, Argo CD/Flux, removed APIs, Helm 3 → 4
6 minhelm.sh/hook · crds/ · HelmRelease12 issues
Learning objectives
  • Explain the hook execution model: hooks in the same stage are sorted by weight (then by kind and name),created one by one and waited on until complete; if any one fails, the whole operation fails; hook resources are not part of the release manifest, and the deletion policy decides whether they stay.
  • Know the crds/ directory's three rules: created only on first install, not updated on upgrade, not deleted on uninstall; and the risks of putting CRDs in templates/.
  • Understand how GitOps tools use Helm (Argo CD: renders and applies on its own; Flux: calls the Helm SDK to manage the real release), and the places where the Helm 3 → 4 migration silently changes behaviour.

Enter a keyword (such as hook,CRD,Argo,atomic) to filter; click a row to jump to details.

#39 Error: INSTALLATION FAILED: failed pre-install: … job myapp-migrate failed: BackoffLimitExceeded (Helm 3: failed pre-install: timed out waiting for the condition)
Error: INSTALLATION FAILED: failed pre-install: 1 error occurred:
	* job myapp-migrate failed: BackoffLimitExceeded
---
Error: UPGRADE FAILED: pre-upgrade hooks failed: … context deadline exceeded
---
(Helm 3) Error: INSTALLATION FAILED: failed pre-install: timed out waiting for the condition

Symptom: The database migration Job (pre-install/pre-upgrade hook) fails or times out; the release is marked failed, and the application's Deployment is never updated (when the pre stage fails, the main resources have not been committed yet).

Root cause: In the pre stage, Helm creates hook resources one by one and waits: a Job must reach Complete/Failed, a Pod must reach Succeeded/Failed, and other kinds count as done once created. The wait limit is --timeout (applies to each hook). A migration Job that cannot reach the database (NetworkPolicy, secret not ready), image pull failures,backoffLimit exhausted, all make the hook fail.

Diagnostic command
kubectl get job,pod -n lab8-m4 -l job-name=myapp-migrate
kubectl logs -n lab8-m4 job/myapp-migrate --tail=50
helm status myapp -n lab8-m4 -o json | jq '.hooks[]|{name,events,last_run}'
NAME                      STATUS   COMPLETIONS   DURATION
job.batch/myapp-migrate   Failed   0/1           31s
{"name":"myapp-migrate","events":["pre-install","pre-upgrade"],"last_run":{"started_at":"…","completed_at":"…","phase":"Failed"}}
Fix
  • After fixing the root cause, rerun the upgrade; if the deletion policy is hook-succeeded, so the failed Job remains for log inspection; the next run's before-hook-creation cleanup (#40).
  • For long migrations, increase --timeout, and set the Job's activeDeadlineSeconds to avoid indefinite waits.
Prevention and best practices
  • Add the annotation helm.sh/hook-output-log-policy: hook-failed, so that on failure Helm copies the hook Pod's logs to client output (annotation from the Helm 4 source; the cause shows up directly in CI logs).
  • Migration scripts must be idempotent and backward compatible (expand the schema first, then release the code, and contract last).

See Lesson 6 Module 4 Hooks and Jobs,Lesson 7 Module 3 Hook failures and timeouts.

#40 warning: Hook pre-upgrade myapp/templates/migrate-job.yaml failed: jobs.batch "myapp-migrate" already exists
Error: UPGRADE FAILED: pre-upgrade hooks failed: warning: Hook pre-upgrade myapp/templates/migrate-job.yaml failed: jobs.batch "myapp-migrate" already exists

Symptom: The first upgrade works; the hook fails to create on the second upgrade.

Root cause: Hook resources are not part of the release manifest. The official docs state: If no deletion policy is given, the default is treated as before-hook-creation ; but once a policy is set explicitly (for example, only hook-succeeded) the default no longer applies. A Job left over from the last failed hook is still there, so creating one with the same name next time conflicts. A Job's Pod template is also immutable and cannot be updated in place.

Diagnostic command
kubectl get job myapp-migrate -n lab8-m4 -o jsonpath='{.metadata.annotations}' | jq .
helm get hooks myapp -n lab8-m4 | grep -A3 'helm.sh/hook'
Fix
kubectl delete job myapp-migrate -n lab8-m4
# add to the template:
#   "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
Prevention and best practices
  • Add to every Job-type hook before-hook-creation (delete the old one before creating a new hook); when you need to keep the failure state, do not add hook-failed.
  • Do not use ttlSecondsAfterFinished instead of the deletion policy: TTL deletion can race with Helm's wait.

See Lesson 6 Module 4.

#41 Migration Job (pre-install hook) cannot find ConfigMap/Secret: the hook runs before regular resources
Warning  Failed  kubelet  Error: configmap "myapp" not found
Error: INSTALLATION FAILED: failed pre-install: … job myapp-migrate failed: …

Symptom: On first install, the migration Job stays CreateContainerConfigError, but it works during upgrades.

Root cause: The pre-install hook runs before any regular resources are created. The ConfigMap/Secret/ServiceAccount the Job references are regular resources that do not exist yet on first install; on upgrade they come from the previous version, so they “happen” to work (but use the old configuration).

Diagnostic command
kubectl describe pod -n lab8-m4 -l job-name=myapp-migrate | sed -n '/Events/,$p'
helm template myapp ./myapp --set migration.enabled=true | grep -B2 -A3 'helm.sh/hook'
Fix
# make the objects the Job depends on into earlier-running hooks (lower weight), and keep or delete them after the task finishes
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "myapp.fullname" . }}-migrate-config
  annotations:
    "helm.sh/hook": pre-install,pre-upgrade
    "helm.sh/hook-weight": "-5"
    "helm.sh/hook-delete-policy": before-hook-creation
Prevention and best practices
  • Make the configuration needed for migration into separate hook resources, or have External Secrets create it in advance (not part of the chart).
  • Alternatively, use an init container or run migration at application startup (with a distributed lock) to avoid the lifecycle complexity of hooks (interview Q40).

See Lesson 6 Module 4.

#42 After helm upgrade the CRD is not updated: new fields are dropped by the API server (unknown field)
$ helm upgrade cert-manager ./cert-manager -n cert-manager
W1115 … unknown field "spec.newFeature"
$ kubectl get crd certificates.cert-manager.io -o jsonpath='{.metadata.annotations}'   # version is still the old one

Symptom: The new operator version needs new CRD fields; after the chart upgrade the CRD is still the old version, and the controller reports errors or the new fields are pruned.

Root cause: Helm's policy for the crds/ directory in the chart is: created only on install (skipped if it already exists), not updated on upgrade, and not deleted on uninstall, and it is not templated. This is by design: CRDs are cluster-scoped data structures that affect all namespaces.

Diagnostic command
helm show crds ./cert-manager | yq '.metadata.name'
kubectl get crd -l app.kubernetes.io/instance=cert-manager
kubectl get crd certificates.cert-manager.io -o yaml | yq '.spec.versions[].name'
Fix
# Option A: apply the CRD separately before the upgrade (SSA recommended)
helm show crds ./cert-manager | kubectl apply --server-side -f -
helm upgrade cert-manager ./cert-manager -n cert-manager
# Option B: use the switch provided by the upstream chart (for example crds.enabled / installCRDs) to put the CRD in templates/ for Helm to manage; note the risk in #44
Prevention and best practices

Manage CRDs through a separate platform pipeline or a separate chart, upgrading them before the operator; in GitOps, use sync waves to guarantee ordering.

See Lesson 6 Module 6 Chart management for CRDs and operators.

#43 resource mapping not found … no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1" ensure CRDs are installed first
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: resource mapping not found for name: "myapp" namespace: "lab8-m4" from "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
ensure CRDs are installed first

Symptom: The chart enables serviceMonitor.enabled, but the cluster has no Prometheus Operator installed; or both the CRD and its CR are defined in templates/ of the same umbrella chart.

Root cause: Before submitting, Helm must map each object to an API resource (discovery). If the CRD does not exist → it cannot be mapped → the whole release fails. crds/ CRDs in the crds/ directory are installed before rendering; CRDs in templates/ are in the same batch as their CRs, and do not yet exist when mapping happens.

Diagnostic command
kubectl api-resources --api-group=monitoring.coreos.com
kubectl get crd | grep monitoring.coreos.com
helm template myapp ./myapp | grep -n 'kind: ServiceMonitor'
Fix
{{- if and .Values.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
...
{{- end }}
Prevention and best practices

Keep optional integrations disabled by default; install the CRD/operator before the application; Capabilities are unreliable during offline rendering (GitOps), so rely on values switches (#25).

See Lesson 6 Module 6,Lesson 2 Module 4.

#44 helm uninstall of an operator deletes the custom resources (and their data) in all namespaces
$ helm uninstall my-operator -n operators
release "my-operator" uninstalled
$ kubectl get postgresclusters -A
No resources found        ← CRD deleted; all CRs are cascade-deleted with it

Symptom: To “reinstall” the operator, uninstall was run, and as a result all teams' database CRs (along with the StatefulSets/PVCs the operator created) were cleaned up.

Root cause: The chart puts the CRD in templates/ (as a regular release resource), so uninstall deletes it; Kubernetes deletes all CRs of that type when the CRD is deleted. A CRD placed in crds/ directory is not deleted by Helm.

Diagnostic command
helm get manifest my-operator -n operators | yq 'select(.kind=="CustomResourceDefinition").metadata.name'
kubectl get crd postgresclusters.example.com -o jsonpath='{.metadata.annotations.helm\.sh/resource-policy}{"\n"}'
Fix

If already deleted: restore the CRDs and CRs from backups (Velero, the CR manifests in the GitOps repository, database backups). As a preventive measure, add this annotation to the CRD:

metadata:
  annotations:
    "helm.sh/resource-policy": keep     # keep the object on uninstall and when it is removed from the chart
Prevention and best practices
  • Production operator CRDs should use keep or be handed to a separate CRD release; use RBAC to restrict who can delete CRDs.
  • List “uninstall operator” as a high-risk operation in the runbook, requiring change review.

See Lesson 6 Module 6,Lesson 1 Module 5 Uninstall.

#45 Argo CD-managed apps: helm list is empty, helm rollback has no effect, hooks behave differently
$ helm list -n myapp
NAME	NAMESPACE	REVISION	UPDATED	STATUS	CHART	APP VERSION
$ kubectl get deploy myapp -n myapp -o jsonpath='{.metadata.labels.app\.kubernetes\.io/managed-by}'
Helm        ← the label says Helm, but it was actually deployed by Argo CD

Symptom: The on-call engineer follows the Helm runbook, running helm rollback reports release: not found, or manually helm upgrade after which Argo CD immediately reverts it.

Root cause: Argo CD uses helm template after rendering the manifest with , then it applies itself, without creating a release Secret; so there is no Helm history, and rollback should be done in Argo CD (or Git). Helm hooks are mapped to Argo CD sync hooks (for example pre-install/pre-upgrade → PreSync),lookup and other functions that need a cluster return empty (#24).

Diagnostic command
kubectl get deploy myapp -n myapp -o jsonpath='{.metadata.annotations}' | jq 'with_entries(select(.key|test("argocd")))'
kubectl get application -A | grep myapp
argocd app history myapp
Fix
argocd app rollback myapp <HISTORY_ID>     # or git revert, then let Argo CD sync
# do not run helm install/upgrade on Argo CD-managed apps: the two controllers will overwrite each other
Prevention and best practices

Write runbooks separately for each deployment method; label Argo CD apps clearly (such as argocd.argoproj.io/instance); keep charts free of dependence on lookup and Helm-specific hook semantics.

See Lesson 5 Module 4 GitOps: Argo CD managing Helm.

#46 Argo CD is permanently OutOfSync: each render generates new random values / certificates
Secret/myapp-redis   OutOfSync
-  password: aGVsbG8xMjM0NTY3OA==
+  password: Zm9vYmFyNzc4ODk5MDA=
Deployment/myapp     OutOfSync
-  rollme: "x8Fq2"
+  rollme: "K1pZa"

Symptom: With auto-sync on, it syncs every few minutes, Pods keep restarting, and the Redis password keeps changing.

Root cause: Argo CD re-renders the chart on every comparison; randAlphaNum,genCA/genSelfSignedCert,now,uuidv4 the results differ each time, and lookup returns empty in Argo CD, so existing values cannot be reused.

Diagnostic command
argocd app diff myapp | head -40
grep -rnE 'randAlpha|randAlphaNum|genCA|genSelfSigned|uuidv4|now' charts/myapp/templates/
Fix
  • Have secrets supplied by External Secrets / Sealed Secrets / SOPS (the chart supports existingSecret); hand certificates to cert-manager.
  • Temporary: have Argo CD ignoreDifferences ignore this field (this only masks the problem; not recommended for long-term use).
Prevention and best practices

Add an item to the chart review checklist: “rendering must be deterministic”: render twice with the same input,diff must be empty (this can be checked automatically in CI).

See Lesson 5 Module 4,Lesson 6 Module 3.

#47 Flux HelmRelease: install retries exhausted / upgrade retries exhausted (Ready=False)
$ flux get helmreleases -n myapp
NAME   REVISION  SUSPENDED  READY  MESSAGE
myapp  0.4.0     False      False  Helm upgrade failed for release myapp/myapp with chart myapp@0.4.0: … context deadline exceeded
$ kubectl describe helmrelease myapp -n myapp | grep -i retries
  Message: upgrade retries exhausted

Symptom: Values were changed in Git; HelmRelease tries a few times and then stops retrying; it still does not move after Git is fixed.

Root cause: Flux helm-controller uses the Helm SDK to manage the real Helm release (visible in helm list), and retries based on spec.install.remediation / spec.upgrade.remediation 's retries retries; once exhausted it stays in a failed state, to avoid endless retries/rollbacks. The underlying failure causes are the same as #5 and #39 in this lesson.

Diagnostic command
kubectl describe helmrelease myapp -n myapp | sed -n '/Conditions/,$p'
helm history myapp -n myapp --max 5
kubectl logs -n flux-system deploy/helm-controller | grep myapp | tail -20
Fix
# after fixing the root cause in Git, trigger reconciliation again (resets the failure count)
flux suspend helmrelease myapp -n myapp && flux resume helmrelease myapp -n myapp
# newer flux CLI versions also provide reconcile --force / reset-type operations; follow the Flux docs
Prevention and best practices
spec:
  upgrade:
    remediation:
      retries: 3
      strategy: rollback     # roll back to the last successful version after a failure
  timeout: 10m

See Lesson 5 Module 5 GitOps: Flux HelmRelease.

#48 current release manifest contains removed kubernetes api(s) for this kubernetes version … no matches for kind "Ingress" in version "extensions/v1beta1"
Error: UPGRADE FAILED: current release manifest contains removed kubernetes api(s) for this kubernetes version and it is therefore unable to build the kubernetes objects for performing the diff. error from kubernetes: unable to recognize "": no matches for kind "Ingress" in version "extensions/v1beta1"

Symptom: After a cluster upgrade, a release that has not been deployed for a long time can no longer be upgraded, even though the new chart already uses networking.k8s.io/v1.

Root cause: An upgrade must first build the manifest stored in the previous revision into objects for comparison; the API version in the old manifest has been removed from the new cluster, so the build fails. The objects in the cluster were already stored by the API server in the new version; only the release record is still the old one.

Diagnostic command
helm get manifest legacy-app -n legacy | grep -n '^apiVersion' | sort | uniq -c
kubectl get ingress -n legacy -o jsonpath='{.items[*].apiVersion}'
Fix
# the officially recommended helm-mapkubeapis plugin: rewrites deprecated/removed API versions in release records
helm plugin install https://github.com/helm/helm-mapkubeapis
helm mapkubeapis legacy-app -n legacy --dry-run
helm mapkubeapis legacy-app -n legacy
helm upgrade legacy-app ./legacy-app -n legacy

For the plugin's compatibility with Helm 4, follow the plugin repository's notes; if the plugin cannot be used, you can manually decode, modify and write back the release Secret (back it up first) per the Helm docs section “Updating API versions of a release manifest”.

Prevention and best practices

Before a cluster upgrade, scan with tools such as pluto and kubent release records and deprecated APIs in charts; also periodically run a “no-op upgrade” to refresh the records of releases that are not deployed for a long time.

See Lesson 7 Module 6 Release storage,Lesson 6 Module 7 Compatibility design.

#49 Flag --atomic has been deprecated, use --rollback-on-failure instead (parameter and wait semantics changes after migrating to Helm 4)
Flag --atomic has been deprecated, use --rollback-on-failure instead
Flag --force has been deprecated, use --force-replace instead

Symptom: After upgrading to Helm 4 the pipeline still runs but shows warnings; the more subtle problem is behaviour changes: ① without --wait the default is hookOnly (waits only for hooks); ② --wait uses kstatus (watcher), which waits for resource states that Helm 3 did not check, so some deployments change from “succeeding quickly” to “timing out”; ③ new installs default to SSA, with different conflict handling (#12); ④ error strings that scripts parse have changed (for example timed out waiting for the condition → context deadline exceeded).

Root cause: Helm 4 is a major release with breaking changes to the CLI and SDK; the old flags are kept as aliases only as a transition.

Diagnostic command
grep -rnE -- '--atomic|--force( |$)|timed out waiting|registry login oci://|--post-renderer [./]' .github/ pipelines/ scripts/
helm version --short
Fix
helm upgrade --install myapp ./myapp -n prod --rollback-on-failure --wait=watcher --timeout 10m
# temporarily need Helm 3's wait behaviour: --wait=legacy (for transition)
Prevention and best practices
  • Pin the Helm version in the CI image; first run Helm 3 and Helm 4 side by side in a non-production pipeline and compare results.
  • Do not use string matching to determine failure causes; use the exit code plus helm status -o json.

See Lesson 7 Module 7 Helm 3 to Helm 4 migration.

#50 Error: plugin: {Name:./kustomize-wrapper.sh Type:postrenderer/v1} not found (in Helm 4 the post-renderer must be a plugin)
Error: plugin: {Name:./kustomize-wrapper.sh Type:postrenderer/v1} not found

Symptom: In Helm 3, --post-renderer ./kustomize-wrapper.sh points to an executable script; in Helm 4 the same command fails.

Root cause: In Helm 4, the --post-renderer argument now means “a postrenderer-type plugin name”, and no longer accepts an executable file path; the script must be wrapped as a plugin (plugin.yaml declares type postrenderer) and installed into $HELM_PLUGINS.

Diagnostic command
helm plugin list
helm env HELM_PLUGINS
Fix

Create the postrenderer plugin following the Helm 4 plugin docs (the apiVersion, type and runtime fields in plugin.yaml follow the helm.sh plugin docs ), then install it and run it helm plugin install ./kustomize-postrenderer :

helm upgrade --install myapp ./myapp -n prod --post-renderer kustomize-postrenderer --post-renderer-args overlays/prod
Prevention and best practices

A post-renderer is a “last-resort patch”; prefer supporting the required customization through chart values. GitOps tools support post-renderers differently (Flux has postRenderers field, while Argo CD can use Kustomize's helmCharts), so evaluate them consistently before migrating.

See Lesson 6 Module 5 post-renderer and Kustomize (Helm 4 plugins),Lesson 7 Module 7.

Order of CRDs, hooks and regular resources in helm install crds/ directorycreated on first install only#42 #44 render + mapdiscovery#43 #48 pre-install hookscreated one by one by weight and waited on#39 #40 #41 Regular resourcessubmitted sorted by kind+ --wait post-install hooksfailure → release failed Writedeployed hook deletion policiesbefore-hook-creation: delete the old hook before creating a new one (the default when no policy is written)hook-succeeded: delete after successhook-failed: delete after failure (loses the failure state)hook-output-log-policy: hook-failed → on failure, logs are sent back to the client The same chart under GitOpsArgo CD: helm template → applies itself; no release Secret (#45)hooks → PreSync/PostSync; lookup is empty (#46)Flux: Helm SDK manages the real release; remediation.retries (#47)Both require deterministic rendering
Figure 4-1: when the pre stage fails, regular resources have not been committed yet; when the post stage fails, the new version is already running

Note: the Helm docs state that when no deletion policy is specified, the default behaviour is equivalent to before-hook-creation; writing it out explicitly is clearer and easier to review.

Hook execution timeline simulator

Choose a scenario and run it to see what Helm does in order during install/upgrade, which step fails, and what is left in the cluster after the failure.

$ waiting to run…
Environment kind cluster lab,~/helmlab/lab8/myapp (already includes the optional migration Job hook).

Lab 4-A: hook failure and log passthrough (#39)

cd ~/helmlab/lab8 && cp -r myapp m4a
sed -i 's/"helm.sh\/hook-weight": "0"/"helm.sh\/hook-weight": "0"\n    "helm.sh\/hook-output-log-policy": hook-failed/' m4a/templates/migrate-job.yaml
helm install m4a ./m4a -n lab8-m4 --create-namespace --set migration.enabled=true \
  --set-json 'migration.command=["sh","-c","echo connecting db...; echo FATAL: password authentication failed; exit 1"]' --timeout 2m
… FATAL: password authentication failed        ← hook Pod logs are passed back
Error: INSTALLATION FAILED: failed pre-install: … job m4a-myapp-migrate failed …
kubectl get deploy -n lab8-m4                  # no Deployment: the pre stage failed
kubectl get job -n lab8-m4                     # the failed Job is kept (the only policy is hook-succeeded)
helm history m4a -n lab8-m4
Upgrade after the fix (before-hook-creation deletes the old Job first):
helm upgrade m4a ./m4a -n lab8-m4 --set migration.enabled=true --wait
kubectl get job,deploy -n lab8-m4
No resources found for the Job (hook-succeeded has deleted it)
deployment.apps/m4a-myapp   1/1   1   1   20s
Cleanup: helm uninstall m4a -n lab8-m4; rm -rf m4a

Lab 4-B: “already exists” when only hook-succeeded is set (#40)

cp -r myapp m4b && sed -i 's/before-hook-creation,hook-succeeded/hook-succeeded/' m4b/templates/migrate-job.yaml
helm install m4b ./m4b -n lab8-m4 --create-namespace --wait
helm upgrade m4b ./m4b -n lab8-m4 --set migration.enabled=true --set-json 'migration.command=["sh","-c","exit 1"]' --timeout 1m
kubectl get job -n lab8-m4          # the failed Job is left behind
helm upgrade m4b ./m4b -n lab8-m4 --set migration.enabled=true --wait
Error: UPGRADE FAILED: pre-upgrade hooks failed: … job m4b-myapp-migrate failed …
NAME                COMPLETIONS
m4b-myapp-migrate   0/1
Error: UPGRADE FAILED: pre-upgrade hooks failed: warning: Hook pre-upgrade m4b/templates/migrate-job.yaml failed: jobs.batch "m4b-myapp-migrate" already exists

When Helm 4 creates the hook with SSA, the second run may also show up as a Job spec.template: … field is immutable; both are caused by an old Job with the same name. Restore the policy to before-hook-creation,hook-succeeded then upgrade again and it succeeds.

Cleanup: helm uninstall m4b -n lab8-m4; kubectl delete job -n lab8-m4 --all; rm -rf m4b

Lab 4-C: missing CRD and Capabilities guards (#43)

cp -r myapp m4c
cat > m4c/templates/servicemonitor.yaml <<'EOF'
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: {{ include "myapp.fullname" . }}
spec:
  selector:
    matchLabels:
      {{- include "myapp.selectorLabels" . | nindent 6 }}
  endpoints:
    - port: http
EOF
helm install m4c ./m4c -n lab8-m4
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: resource mapping not found for name: "m4c-myapp" namespace: "" from "": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1"
ensure CRDs are installed first
sed -i '1i {{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor" }}' m4c/templates/servicemonitor.yaml
echo '{{- end }}' >> m4c/templates/servicemonitor.yaml
helm install m4c ./m4c -n lab8-m4 --wait && helm get manifest m4c -n lab8-m4 | grep -c ServiceMonitor
0
Cleanup: helm uninstall m4c -n lab8-m4; kubectl delete ns lab8-m4; rm -rf m4c

Instructional videos (titles and channels verified via YouTube oEmbed)

▶
ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes — TechWorld with Nana
English · how Argo CD works (matches #45, #46)

No verified video specifically covering Helm hooks troubleshooting or Helm 3→4 migration was found. Storyboard (3 minutes):

Shot 1 (0:00) Timeline animation: crds/ → render → pre hooks (by weight) → resources → post hooks; highlight “no Deployment exists when pre fails”.
Shot 2 (1:00) Lab 4-A: failure logs are passed back via hook-output-log-policy; compare the deletion policies.
Shot 3 (2:00) Run on an Argo CD app helm list is empty; explain the difference between the “renderer” and the “release manager”.

Official docs

or score ≥ 70% in the “Quiz”

Module 5 · Part B: Core concepts and architecture (interview questions 1–13)

30:00 – 37:00 · what Helm is, release storage, upgrade flow, values precedence, rollback, Helm 4 changes, waiting and SSA, state machine
7 minclient · release Secret · SSA13 questions
Learning objectives
  • Use three keywords, “package management + templates + release records”, to explain what Helm is and why it is not “just a template engine”.
  • Be able to draw on a whiteboard the helm upgrade --install complete flow, and point out which step writes the release Secret and how its state changes.
  • Be able to answer advanced Helm 4 follow-ups: the difference between SSA and three-way merge, kstatus waiting, and why upgrades keep the old apply method.

Scan the questions and what they test, mark the ones you are unsure of; click a row to jump to the details.

Q1. What is Helm? What problems does it solve that kubectl apply cannot?Basic
30-second answer

Helm is the package manager for Kubernetes: it packages a set of manifest templates + default configuration into a chart, which is rendered with different values and installed as a versioned release. Compared with kubectl apply, it provides parameterization (one template set, many environments), distribution (repositories/OCI), dependency management, and a lifecycle that treats a group of objects as one unit: history, upgrade, rollback, uninstall.

In-depth answer
  • kubectl apply does not know that “these 12 objects belong to version 7 of the same application”; Helm uses release records (Secrets) to store the manifest and values of each deployment, so it can diff, roll back, and delete the whole set (including objects removed from the chart).
  • Distribution and reuse: community charts (ingress-nginx, cert-manager) expose their configuration through values, so users do not have to maintain thousands of lines of YAML.
  • Lifecycle extensions: hooks (migration, backup), tests, and dependent subcharts.
helm upgrade --install myapp oci://myacr.azurecr.io/helm/myapp --version 1.4.0 -f values/prod.yaml -n myapp --wait
helm history myapp -n myapp
helm rollback myapp 6 -n myapp
Common follow-ups
  • Helm or Kustomize: how to choose? See Q42 in Lesson 9 of the K8s course; this lesson adds that the two can be combined (post-renderer, #50).
  • Does Helm need components installed in the cluster? No (Q3).
Bonus points

Point out that Helm's “release” concept is the core value; templates are just a means—without release records, rollback and cleanup would have to be implemented yourself.

Common wrong answers

“Helm is just a YAML templating tool”—ignores packaging, distribution and the release lifecycle.

See Lesson 1 Module 1.

Q2. Explain the four concepts: Chart, Release, Revision, Repository.Basic
30-second answer

Chart: a packaging unit (Chart.yaml + templates + values.yaml + dependencies), with its own SemVer version. Release: an instance of a chart installed under a given name in a given namespace; the same chart can be installed multiple times. Revision: every install/upgrade/rollback of a release creates a versioned record with an incrementing number. Repository: where charts are stored and distributed: a traditional HTTP repository (index.yaml) or an OCI registry.

In-depth answer
ConceptIdentifierWhere it is stored
Chartname + version (appVersion is informational only)directory / .tgz / repository
Releasenamespace + name (≤53 characters)Secret in the cluster
Revision1, 2, 3… (rollback also +1)sh.helm.release.v1.<name>.v<N>
RepositoryURL / oci://host/pathstatic site / registry
Common follow-ups
  • What is the difference between version and appVersion? See Q35.
  • Can the same release name be installed once in each of two namespaces? Yes; release names are unique within a namespace.
Bonus points

Mention that rollback also creates a new revision (rather than “going back” to an old number), and that --history-max trims old revisions (#10).

Common wrong answers

Confusing chart version with release revision.

See Lesson 1 Module 2.

Q3. What is the architecture of Helm 3/4? Why was Tiller removed from Helm 2?Basic
30-second answer

From Helm 3 on, it is a pure client: the CLI (and the embeddable Go SDK) reads kubeconfig and talks directly to the API server, and release records are stored as Secrets in the release's namespace. Tiller was Helm 2's server-side component running in the cluster, usually with cluster-admin, so anyone who could reach Tiller could deploy beyond their own permissions. This is the main reason it was removed.

In-depth answer
  • Permission model: Helm's permissions are now the executor's Kubernetes RBAC permissions, which can be granted with least privilege per namespace (Q30).
  • Storage: the secret driver by default; optional configmap, memory, sql (HELM_DRIVER).
  • Other Helm 3 improvements: three-way merge patches, namespaced release names, JSON Schema validation, library charts, OCI support; Helm 4 adds SSA, kstatus waiting and a reworked plugin system (Q10).
Common follow-ups
  • With no server, how do you stop two people upgrading at the same time? Use the pending-* state as a pessimistic lock (#2); it is not a strongly consistent lock.
Bonus points

Mention that the Helm 2 → 3 migration uses the helm-2to3 plugin, and that Helm 2 releases were stored in ConfigMaps in kube-system.

Common wrong answers

“Helm 3 still needs helm init”—that is Helm 2.

See Lesson 1 Module 1 Architecture and how it works.

Q4. Describe in detail every step of helm upgrade --install from start to finish.Intermediate
30-second answer

Load the chart (including dependencies) → merge values and run schema validation → connect to the cluster to get the version and API list → look up the last revision (if none exists, take the install path; if pending, refuse) → render templates and sort by kind → write the new revision Secret (pending-upgrade) → run pre-upgrade hooks → compare with the previous revision and submit changes (new Helm 4 releases use SSA; older releases keep three-way merge) → delete objects that no longer exist in the new manifest → wait for readiness per the strategy → post-upgrade hooks → mark the new revision deployed, the old one superseded, and trim history.

In-depth answer
upgrade --install
 ├─ Releases.Last(name)          not found → install branch; pending → errPending (#2)
 ├─ render + validate                   #13–#25
 ├─ create vN (pending-upgrade)     process killed → stuck pending forever
 ├─ pre-upgrade hooks            create one by one + wait (#39)
 ├─ ownership check (newly added objects)        #4
 ├─ Update: create / patch(SSA) / delete   #6 #12
 ├─ wait (watcher/hookOnly/legacy)  #5
 ├─ post-upgrade hooks
 └─ vN=deployed, vN-1=superseded, trim history-max
Common follow-ups
  • What happens on failure? vN is marked failed; changes already committed to the cluster are not automatically reverted unless --rollback-on-failure; --cleanup-on-fail only deletes the objects newly created in this run.
  • Why do the ownership checks differ between install and upgrade? upgrade only checks objects that are newly added in this run.
Bonus points

State the naming format and labels of the release Secret (owner=helm, name, status, version), and be able to use kubectl get secret -l owner=helm -L status to diagnose it on the spot.

Common wrong answers

“Helm deletes old resources first, then creates new ones”—it does patch/apply; only with --force-replace does it delete and recreate.

See Lesson 1 Module 3,Lesson 7 Module 2.

Q5. Where does Helm store release information? What is the format? What are the limits?Intermediate
30-second answer

By default it is stored in a Secret in the release's namespace, named sh.helm.release.v1.<release>.v<revision>, with type helm.sh/release.v1. The data is the JSON of the release object (chart metadata and templates, values, the rendered manifest, hooks, status), gzipped and then base64-encoded. A single Secret is subject to the Kubernetes 1 MiB limit (#11).

In-depth answer
kubectl get secret sh.helm.release.v1.myapp.v3 -n myapp -o jsonpath='{.data.release}' \
  | base64 -d | base64 -d | gzip -d | jq '{name, version, status: .info.status, chart: .chart.metadata.version}'

Two base64 decodes are needed: the Secret's data is itself base64, and what Helm writes is base64-encoded once more.

  • Drivers: secret (default), configmap (secrets would be visible in plain text), memory (testing), sql (PostgreSQL, suitable for very large scale).
  • Security: anyone who can read these Secrets can see all values (including --set passwords passed in).
Common follow-ups
  • Does deleting the release Secret delete the application? No, Helm just “forgets” it; a later install may then hit ownership conflicts (in fact the annotations still match, so they can be taken over again) or create orphaned resources.
Bonus points

Mention that secrets in values should be switched to the existingSecret approach, so the release record contains no plain text.

Common wrong answers

“Stored locally on the Helm client”—that is the repository cache; release state lives in the cluster.

See Lesson 7 Module 6.

Q6. What are the sources of values? What are the precedence and merge rules?Basic
30-second answer

From lowest to highest: the chart's values.yaml → overrides from the parent chart for the subchart → -f/--values files (when there are several, later ones override earlier ones) → --set,--set-string,--set-file,--set-json,--set-literal. Maps are deep-merged, lists are replaced as a whole, and setting a key to null deletes the default key.

In-depth answer
helm upgrade --install myapp ./myapp -f values/common.yaml -f values/prod.yaml --set image.tag=1.4.0
helm get values myapp            # only user-supplied values
helm get values myapp --all      # final merged values
  • On upgrade, by default it uses the new chart's default values + the values passed in this run; --reuse-values,--reset-values,--reset-then-reuse-values change this behaviour (#18).
  • Helm 4 supports multi-document values files (listed in the change overview).
Common follow-ups
  • Why did the version change after --set? Type inference (#17).
  • How do I pass values only to a subchart? Key them by the subchart name or alias, or use global (#23).
Bonus points

Point out that values is the chart’s API and should come with a schema, documentation and a compatibility promise.

Common wrong answers

“The first file wins when -f is given several times”—the opposite is true; the later file overrides the earlier one.

See Lesson 1 Module 4.

Q7. How does helm rollback work? What can it not roll back?Intermediate
30-second answer

rollback reads the manifest (and hooks) stored in the target revision, applies it to the cluster as the new desired state, and creates a new revision described as “Rollback to N”. It does not roll back the CRDs in crds/, the data in PVCs, database schema migrations or external systems (DNS, cloud resources), and it does not undo what hooks have already done.

In-depth answer
  • The rollback target must still be in history (#10); the default target is the previous revision (helm rollback myapp equivalent to 0).
  • rollback also runs pre/post-rollback hooks, and can run into immutable-field and SSA conflicts.
  • Rollback uses the values from that time, so if those values reference a rotated secret, the rollback fails as well.
Common follow-ups
  • When should you roll forward instead of rolling back? After an irreversible data migration, or when rolling back would land on a version with known vulnerabilities (Q42).
  • How do you roll back under GitOps? git revert, then let the controller sync.
Bonus points

Stress that the “expand → migrate → contract” migration strategy is what makes rollback possible.

Common wrong answers

“rollback restores the database”—Helm only manages Kubernetes objects.

See Lesson 1 Module 5,Lesson 5 Module 7.

Q8. What is the difference between helm template, install --dry-run=client, --dry-run=server and helm lint?Intermediate
30-second answer

helm template: fully offline rendering (Capabilities use defaults, lookup returns empty), with no API validation. --dry-run=client: also does not contact the cluster; it simulates the output of an install. --dry-run=server: connects to the cluster, so lookup works, and the API server runs a server-side dry-run validation without persisting anything. helm lint: checks the chart structure, Chart.yaml, whether templates render and whether the YAML is valid,required and failures are only reported as warnings.

In-depth answer
Cluster accesslookupAPI validationPurpose
templateNoEmptyNo (--validate optional)CI rendering, GitOps
--dry-run=clientNoEmptyNoPreview
--dry-run=serverYesAvailableYesFinal check before go-live
lintNoEmptyNoChart quality gate

--hide-secret Use only together with dry-run, to avoid printing Secrets in the output.

Common follow-ups
  • How do you do schema-level validation in CI?helm template | kubeconform -strict -kubernetes-version 1.37.0.
Bonus points

Mention helm diff upgrade (plugin) and kubectl diff for reviewing changes relative to production.

Common wrong answers

“If lint passes, the install will succeed”—lint does not contact the cluster and does not enforce required values.

See Lesson 1 Module 7 helm template, get and diff.

Q9. What is the difference between Helm and an Operator? When should you use which?Intermediate
30-second answer

Helm is a “deploy-time” tool: it renders manifests, submits them, records the version, and exits once the deployment is done. An Operator is a “run-time” controller: it keeps watching custom resources and encodes domain knowledge (backup, failover, scaling, upgrade orchestration). For stateless apps, Helm is enough; for stateful systems that need day-to-day operational logic (databases, message queues), use an Operator, and the Operator itself is usually installed with Helm.

In-depth answer
  • Helm has no reconciliation loop: if someone edits an object by hand, Helm will not notice (GitOps closes that gap).
  • The cost of an Operator: developing and maintaining the controller, and evolving CRD versions (#42, #44).
  • A compromise: a Helm chart + GitOps reconciliation + a few Job/CronJob operational tasks.
Common follow-ups
  • What is a Helm-based Operator? The Operator SDK can generate an operator from a Helm chart: the CR’s spec is used as values, and the controller reconciles it continuously.
Bonus points

Give a decision criterion: whether there are operational actions that must “respond automatically to runtime events”.

Common wrong answers

“An Operator is an upgraded Helm”—they solve problems at different layers and are often used together.

See Lesson 6 Module 6.

Q10. What are the major changes in Helm 4 compared with Helm 3?Intermediate
30-second answer

Helm 4 (released 2025-11, currently 4.3.x): new installs default to server-side apply; kstatus-based waiting (--wait=watcher|hookOnly|legacy); --atomic renamed --rollback-on-failure,--force renamed --force-replace; plugin system reworked (optional WebAssembly runtime; CLI, getter and postrenderer plugin types; post-renderer must be a plugin); OCI support for installing by digest,registry login accepts only domain names; stable SDK API, experimental Chart API v3. Helm 3’s v2 charts work without changes.

In-depth answer
  • Upgrade and rollback keep the release’s original apply method, so releases installed with Helm 3 still use client-side merge after upgrading; --server-side it can be switched explicitly.
  • The last Helm 3 feature release is 3.22 (2026-09), with security fixes until 2027-02-10.
  • Migration risks: old flags and error strings in scripts (#49), post-renderers (#50), registry login (#30), and timeouts caused by changed wait semantics.
Common follow-ups
  • Why doesn’t an upgrade switch to SSA automatically? Field ownership would move away from the client-side merge manager, which can cause sudden conflicts (#12); the default is conservative.
Bonus points

Give a phased migration plan (Q48).

Common wrong answers

“Helm 4 requires rewriting all charts”—apiVersion v2 charts keep working as they are.

See Lesson 7 Module 7.

Q11. What does --wait wait for in Helm? How do watcher, hookOnly and legacy differ in Helm 4?Advanced
30-second answer

--wait After submitting, Helm waits for resources to become “ready”; if this takes longer than --timeout it fails. Helm 4: watcher watcher uses kstatus to watch each resource until it reaches Current (Deployment replicas available, Job complete, and so on); hookOnly (default when --wait is omitted) waits only for hooks; legacy is Helm 3’s polling implementation. Writing --wait alone is equivalent to watcher; --rollback-on-failure sets the wait strategy default to watcher.

In-depth answer
  • kstatus is the generic status-computation library from the Kubernetes SIG CLI. It determines InProgress/Current/Failed from observedGeneration, conditions and so on, and it also works for CRDs based on standard conditions.
  • Failures are listed per resource (resource Deployment/ns/name not ready. status: InProgress …), which is easier to troubleshoot than Helm 3’s “timed out waiting for the condition” (#5).
  • --wait-for-jobs makes regular Jobs count toward waiting; a paused Deployment is skipped.
Common follow-ups
  • Does Helm delete resources after a timeout? No, it only marks the release as failed, unless automatic rollback is enabled.
Bonus points

Point out that “ready” does not mean “business-healthy”: readinessProbe must be well designed, or add smoke tests in the pipeline or helm test.

Common wrong answers

“--wait waits until the Pod logs show started”—Helm only looks at Kubernetes status.

See Lesson 5 Module 7,Lesson 7 Module 1.

Q12. What is the difference between Helm 3’s three-way merge patch and Helm 4’s server-side apply?Advanced
30-second answer

Three-way merge is computed on the client: it compares the manifest of the previous revision, the new manifest and the current object in the cluster, and generates a patch. This preserves other people’s changes to fields it does not manage, and removes fields it set before but no longer declares. SSA hands the computation to the API server: Helm submits its full intent under its own field manager, the server merges based on managedFields, and conflicts are rejected (unless forced). A field is deleted if it was “managed by me last time but not submitted this time.”

In-depth answer
Three-way merge (Helm 3)SSA (default for new releases in Helm 4)
Where it is computedClientAPI server
Conflicts with others’ changesSilently overwritten / keptreports a conflict (#12),--force-conflicts
Field ownershipNoneRecorded precisely in managedFields
Merging for CRDsJSON merge patch (lists replaced as a whole)Based on the schema’s list-type / map-keys
Common follow-ups
  • What if an HPA manages replicas? Do not render replicas in the template, to avoid fighting the HPA over the field.
  • How do you switch existing releases?helm upgrade --server-side=true, and first verify conflicts in a pre-production environment.
Bonus points

Be able to explain the difference between Apply and Update operations in managedFields.

Common wrong answers

“SSA is just another way of writing kubectl apply, with no behaviour difference.”

See Lesson 7 Module 4.

Q13. What states can a release have? How does each state affect the next operation?Intermediate
30-second answer

deployed (currently active, only one at a time), superseded (replaced by a later successful revision), failed (the operation failed), pending-install / pending-upgrade / pending-rollback (operation in progress), uninstalling, uninstalled (kept with --keep-history), and unknown. Only pending-* blocks a new upgrade or rollback (#2); failed can be overwritten by the next upgrade; uninstalled makes a same-named install fail (#1), unless --replace.

In-depth answer
helm list -n myapp -a                 # all statuses
helm list -n myapp --pending --failed
kubectl get secret -n myapp -l owner=helm -L name,status,version
Common follow-ups
  • How do you recover from pending safely? Confirm nothing is running → roll back to the last deployed revision; if that does not work, back up and then delete the pending Secret.
Bonus points

Point out that pending is a “pessimistic lock”: CI must serialize deployments of the same release, and the job timeout must be greater than the Helm timeout.

Common wrong answers

“A failed release must be uninstalled before it can be deployed again.”

See Lesson 7 Module 2.

Whiteboard diagram: Helm architecture (Q3, Q4, Q5) ChartDirectory / .tgz / OCItemplates + values values-f / --set Helm CLI / SDK (client) Merge values · schema validationGo template + Sprig renderingHook ordering and executionSSA / three-way mergekstatus waitingWrite release record API serverRBAC = executor’s permissions release Secret (in the namespace)sh.helm.release.v1.myapp.v7 · gzip+base64Labels owner=helm, status, version WorkloadsDeployment… No server-side component (Helm 2’s Tiller has been removed); the “lock” is the pending state of the last revision
Figure 5-1, explained while drawing: chart + values → client-side rendering → API server → release record

Scenario 5-1: the team still uses kubectl apply + sed to replace image tags

A team uses sed to write the image tag into YAML and then kubectl apply, across dev/staging/prod environments. The manager asks: what are the benefits, risks and migration steps of introducing Helm?

Key points of the reference answer
  • Benefits: one set of templates + three values files; versioned releases that can be rolled back and removed as a whole; chart versions traceable to Git commits; reuse of community charts.
  • Risks: template complexity, poor values design (#19), taking over existing objects (#4, #6), and team skills.
  • Steps: ① Use helm create to bootstrap, moving the existing YAML into templates,helm template | kubectl diff confirming zero diff; ② in dev, use --take-ownership or annotate to take over; ③ add lint/kubeconform/ct to CI; ④ push the chart to OCI; ⑤ switch environment by environment, and introduce GitOps last.

Scenario 5-2: a deployment fails overnight, the release gets stuck, and the on-call engineer deletes all release Secrets

After seeing “another operation is in progress”, the on-call engineer ran kubectl delete secret -l owner=helm,name=myapp. What problems arise now? How do you recover? How do you prevent this in future?

Key points of the reference answer
  • Consequences: Helm has forgotten the release and its history, so rollback is impossible; the objects keep running and still carry Helm annotations.
  • Recovery: use the same name helm upgrade --install to redeploy (the annotations match, so Helm can take over the objects and the install becomes the new v1); compare helm template with the live objects to confirm there are no unexpected changes.
  • Prevention: the runbook says to delete only the one pending revision, and to back up first (#2); restrict deletion of Helm Secrets with RBAC; serialize CI.

Instructional videos (titles and channels verified via YouTube oEmbed)

▶
What is Helm in Kubernetes? Helm and Helm Charts explained | Kubernetes Tutorial 23 — TechWorld with Nana
English · quick review before the interview of the history of charts, releases and Tiller (matches Q1–Q3)
▶
What is Helm? — IBM Technology
English · whiteboard explanation of Helm’s value
▶
What is Helm? | Helm Concepts Explained | KodeKloud — KodeKloud
English · concept review

All the videos above are based on Helm 3; for the Helm 4 changes (Q10–Q12), refer to this lesson and helm.sh. No verified video specifically covering Helm interview questions was found, so it is recommended to use “Mock interview” and replay your own recording.

or score ≥ 70% in the “Quiz”

Module 6 · Part B: Chart development and templates (questions 14–25)

37:00 – 44:00 · chart structure, template functions, named templates and scope, schema, dependencies, library charts, hooks, tests, lookup, config rollouts, chart testing
7 minGo template · Sprig · JSON Schema12 questions
Learning objectives
  • Be able to write on the spot _helpers.tpl in a typical fullname/labels/selectorLabels implementation, and explain each design point.
  • Be able to compare the trade-offs between include and template, required and schema, hooks and init containers, and subcharts and library charts.
  • Be able to describe a complete chart testing strategy (lint, unit tests, schema, install tests, upgrade tests).

Scan the questions and what they test first; click a row to jump to the details.

Q14. Describe a chart’s directory structure and the key fields of Chart.yaml.Basic
30-second answer

Chart.yaml (metadata),values.yaml (default values),values.schema.json (optional validation),templates/ (templates,_ files starting with _ are not rendered; NOTES.txt holds the install notes),charts/ (dependencies),crds/ (CRDs, not templated),Chart.lock,.helmignore,README.md. Key Chart.yaml fields: apiVersion: v2,name,version (SemVer, required),appVersion,type (application/library),kubeVersion,dependencies,deprecated,annotations.

In-depth answer
apiVersion: v2
name: myapp
description: Flask + Redis demo
type: application
version: 1.4.0          # the chart’s own version, incremented on every chart change
appVersion: "1.1"       # application version, informational only (default image tags often reference it)
kubeVersion: ">=1.30.0-0"
dependencies:
  - name: redis
    version: "0.x.x"
    repository: oci://registry-1.docker.io/cloudpirates
    condition: redis.enabled
Common follow-ups
  • apiVersion v1 vs v2? v1 is the Helm 2 format (requirements.yaml); v2 merges dependencies into Chart.yaml and supports type; Helm 4 also has an experimental Chart API v3 (enabled via an environment variable).
Bonus points

Mention .helmignore which can significantly reduce the package and release record size (#11).

Common wrong answers

“It doesn’t matter if I change the templates but not the version”—different content under the same version breaks traceability (#32, #33).

See Lesson 2 Module 1.

Q15. Which template functions are commonly used? What do toYaml, nindent, default, required, quote and tpl each do?Basic
30-second answer

Helm templates = Go text/template + the Sprig function library + Helm’s custom functions. toYaml converts a structure to YAML text, used together with nindent N (newline first, then indent) to embed it; default provides a fallback for empty values; required fails when a value is missing; quote adds quotes to avoid type inference; tpl renders a string from values as a template; include calls a named template and returns a string.

In-depth answer
metadata:
  labels:
    {{- include "myapp.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount | default 1 }}
  template:
    spec:
      containers:
        - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
          env:
            - name: REDIS_HOST
              value: {{ tpl .Values.redisHost . | quote }}     # values can contain "{{ .Release.Name }}-redis"
          resources:
            {{- toYaml .Values.resources | nindent 12 }}

Other common ones: dig,hasKey,ternary,b64enc,sha256sum,toJson,fromYaml,lookup,fail,semverCompare.

Common follow-ups
  • What are the pitfalls of default? A value of false/0/ an empty string is also replaced by the default (Sprig treats it as “empty”); do not use default true for boolean switches.
Bonus points

Mention that Helm 4 plugins can register custom template functions, but this reduces the chart’s portability to other environments (such as Argo CD).

Common wrong answers

Using indent instead of nindent and handling newlines by hand (the source of #13).

See Lesson 2 Module 2.

Q16. How do you write a named template? What is the difference between include and template? Why should names carry a chart prefix?Intermediate
30-second answer

Write named templates in _helpers.tpl using {{ define "myapp.labels" }}…{{ end }} define. template is a native Go action that outputs directly and cannot be piped; include is a Helm function that returns a string, which can be piped into | nindent, so include is almost always used. Named templates are global—the parent chart and all subcharts share one namespace, so without a prefix they overwrite each other.

In-depth answer
{{- define "myapp.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}{{- end -}}
{{- end -}}
{{- end }}
{{- define "myapp.selectorLabels" -}}
app.kubernetes.io/name: {{ include "myapp.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
Common follow-ups
  • Why trunc 63? The DNS label length limit.
  • Why don’t selectorLabels include the version? Selectors are immutable (#6).
Bonus points

When multiple arguments are needed, pass dict "root" $ "component" "worker".

Common wrong answers

“template and include are the same.”

See Lesson 2 Module 3.

Q17. Explain scope in templates: ., $, with, range.Basic
30-second answer

. is the current context; at the top level it contains .Values/.Release/.Chart/.Capabilities/.Template/.Files. with and range change . to the current object/element; $ always points to the root context. Inside a block, access globals with $ (#21).

In-depth answer
{{- with .Values.podAnnotations }}
annotations:
  {{- toYaml . | nindent 2 }}
{{- end }}
{{- range $name, $cfg := .Values.workers }}
- name: {{ $name }}
  image: {{ $.Values.image.repository }}
  replicas: {{ $cfg.replicas }}
{{- end }}

with skips the whole block when the value is empty (you can also write else); range iterates over maps sorted by key, and over lists in order.

Common follow-ups
  • What is . inside a named template? It is the argument passed in when calling it, so with include you usually pass . or $.
Bonus points

Mention variable scope: inside if/range, use = to change an outer variable (supported in Go 1.11+ templates).

Common wrong answers

Writing in range .Release.Name and assuming it works.

See Lesson 2 Module 3.

Q18. What does values.schema.json do? How does it compare with required in templates?Intermediate
30-second answer

The schema validates the merged values against JSON Schema before rendering (types, required keys, enums, ranges, forbidden extra keys); install, upgrade, lint and template all run it, and errors are centralized and clear (#16). required required can only check whether a single value is empty, is scattered across templates, and only produces a warning during lint. The two complement each other: the schema handles structure and types, while required/fail handle cross-field business rules.

In-depth answer
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["image"],
  "properties": {
    "image": { "type": "object", "required": ["repository"],
      "properties": { "repository": {"type": "string"}, "tag": {"type": "string"},
                      "pullPolicy": {"enum": ["Always","IfNotPresent","Never"]} } },
    "replicaCount": { "type": "integer", "minimum": 1 },
    "service": { "type": "object", "additionalProperties": false,
      "properties": { "type": {"type":"string"}, "port": {"type":"integer"} } }
  }
}

Helm 4.3 uses santhosh-tekuri/jsonschema v6 for validation; it supports multiple draft versions and relies on $schema to identify the draft; a subchart’s schema also applies to its own section of the values; in an emergency you can --skip-schema-validation.

Common follow-ups
  • What are the risks of additionalProperties: false? An umbrella chart passes global to subcharts, so the schema must allow global.
Bonus points

Use tools such as helm-schema to generate the schema from values comments, and let the IDE complete based on the schema.

Common wrong answers

“The schema only takes effect during lint.”

See Lesson 2 Module 5.

Q19. How are chart dependencies managed? What do condition, tags, alias, import-values and Chart.lock each do?Intermediate
30-second answer

Declare them in Chart.yaml’s dependencies section (name, version constraint, repository). helm dependency update resolves versions, writes Chart.lock and downloads into charts/; build rebuilds exactly from Chart.lock. condition/tags controls whether it is enabled; alias lets the same chart be included multiple times under different names; import-values imports values exported by the subchart into the parent chart.

In-depth answer
dependencies:
  - name: redis
    alias: cache
    version: "~0.6.0"
    repository: oci://registry-1.docker.io/cloudpirates
    condition: cache.enabled
    tags: [backend]
  - name: common
    version: "2.x.x"
    repository: oci://myacr.azurecr.io/helm
    import-values:
      - child: exports.defaults
        parent: commonDefaults
Common follow-ups
  • In CI, build or update? build (#28).
  • Can a subchart read the parent chart’s values? No; it can only use its own section or global (#23).
Bonus points

Point out the risks of an umbrella chart with too many dependencies (one release that is too large, #11, and coupled upgrades); consider Helmfile multi-release orchestration (Q34).

Common wrong answers

Committing the charts/ directory to Git and updating it by hand.

See Lesson 2 Module 6.

Q20. What is a library chart? When should you use it instead of an ordinary subchart?Intermediate
30-second answer

type: library chart provides only named templates; it cannot be installed on its own and renders no resources. It suits sharing standard Deployment/Service/label/security-context implementations within an organization, keeping dozens of application charts consistent while each keeps its own independent release. An ordinary subchart, by contrast, means “installing another component alongside.”

In-depth answer
# application chart’s templates/deployment.yaml
{{- include "platform.deployment" (dict "root" . "component" "web") }}
# in the library chart
{{- define "platform.deployment" -}}
{{- $root := .root -}}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "platform.fullname" $root }}-{{ .component }}
...
{{- end }}
Common follow-ups
  • How do you roll out a library chart upgrade? Dependency version constraints + automatic Renovate PRs + per-application CI render comparison.
Bonus points

Discuss the trade-off between “one generic chart deploying all applications” and “a library chart + thin application charts” (Q44).

Common wrong answers

“A library chart can be helm installed.”

See Lesson 2 Module 6.

Q21. What types of Helm hooks are there? How do weights and deletion policies work?Intermediate
30-second answer

A hook is a resource with the helm.sh/hook annotation that runs at specific points in the lifecycle: pre/post-install, pre/post-upgrade, pre/post-rollback, pre/post-delete, and test. Within the same phase, hooks are sorted by helm.sh/hook-weight weight in ascending order (then by kind and name), created one by one and waited on until complete. helm.sh/hook-delete-policy: before-hook-creation, hook-succeeded, hook-failed. Hooks are not part of the release manifest, and uninstall does not delete them.

In-depth answer
  • Waiting semantics: Jobs wait for completion, Pods wait for success, and other kinds count as done once created. If any hook fails, the operation fails (#39).
  • The Helm 4 source also has helm.sh/hook-output-log-policy (hook-succeeded / hook-failed), which sends hook Pod logs to the client.
  • pre-install hooks run before regular resources (#41); if a post hook fails, the new version is already running.
Common follow-ups
  • Do hook resources show up in helm get manifest? No, use helm get hooks.
Bonus points

Explain that hooks are mapped to sync hooks in Argo CD, and the behaviour is not identical (#45).

Common wrong answers

“Hooks in the same phase run in parallel.”

See Lesson 6 Module 4.

Q22. What is helm test? How do you write a useful chart test?Basic
30-second answer

A Pod or Job with the helm.sh/hook: test annotation, placed in templates/tests/, is run by helm test <release> after installation; a container exit code of 0 means pass. Used for post-deployment smoke tests: the service is reachable, health checks pass and dependencies are connected.

In-depth answer
apiVersion: v1
kind: Pod
metadata:
  name: "{{ include "myapp.fullname" . }}-test-healthz"
  annotations:
    "helm.sh/hook": test
    "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
  restartPolicy: Never
  containers:
    - name: curl
      image: curlimages/curl:8.11.1
      args: ["-fsS", "http://{{ include "myapp.fullname" . }}:{{ .Values.service.port }}/healthz"]
helm test myapp -n myapp --logs --timeout 2m
Common follow-ups
  • How does it relate to ct install? chart-testing runs helm test after installing the chart.
Bonus points

Pin the test image to a version or digest, and comply with the cluster’s Pod Security policy (non-root, read-only file system).

Common wrong answers

Confusing unit tests (template assertions) with helm test (in-cluster smoke tests) (see Q25).

See Lesson 2 Module 7 helm lint and helm test.

Q23. What can the lookup function do? What are its limitations?Intermediate
30-second answer

lookup "apiVersion" "Kind" "namespace" "name" Queries objects in the cluster at render time (lists them if name is empty). Commonly used for “reuse the existing Secret if present, otherwise generate one”. Limitations: helm template,--dry-run=client Argo CD and other offline renders return empty; the executor needs read permission; and it makes rendering depend on cluster state, reducing repeatability.

In-depth answer

See #24 and #46 for examples and pitfalls. Alternatives: existingSecret + External Secrets; hand certificates to cert-manager; pass cross-release values explicitly through values.

Common follow-ups
  • Does lookup work with --dry-run=server? Yes.
Bonus points

Be able to explain why rendering determinism matters for GitOps diffs.

Common wrong answers

“lookup can find cluster objects in every situation.”

See Lesson 2 Module 4,Lesson 6 Module 3.

Q24. How do config changes trigger a Pod rollout? Changes to which fields cause an upgrade to fail?Intermediate
30-second answer

A Deployment only rolls out when the Pod template changes; a commonly used checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} annotation reflects config content changes in the Pod template (#22). The fields whose changes cause upgrade failures are immutable fields: a Deployment/StatefulSet selector, a StatefulSet’s volumeClaimTemplates and serviceName, a Job’s Pod template, a Service’s clusterIP, and parts of a PVC’s spec (#6).

In-depth answer
  • Do not use random annotations to force rollouts (GitOps will be permanently OutOfSync, #46).
  • For externally managed Secrets, use Reloader or have the application hot-reload on its own.
  • When an immutable field must change: create a new object under a new name and migrate, or do a planned --force-replace.
Common follow-ups
  • How do you change a StatefulSet’s storage size? It cannot be changed through volumeClaimTemplates; expand the PVCs directly (the StorageClass must allow expansion), then use --cascade=orphan to delete the StatefulSet and let Helm recreate it.
Bonus points

Run ct install --upgrade in CI to catch immutable-field changes before merge.

Common wrong answers

“helm upgrade automatically restarts all Pods.”

See Lesson 6 Module 7.

Q25. How do you systematically test a chart?Advanced
30-second answer

In layers: ① static: helm lint --strict, yamllint, schema validation of each environment’s values; ② unit tests: helm-unittest asserts on the rendered output (for example, “replicas is not rendered when HPA is enabled”); ③ manifest validation: helm template | kubeconform -strict, policy checks (Kyverno CLI / conftest); ④ integration: chart-testing (ct) runs install + helm test in kind, and uses --upgrade to upgrade from the previous version; ⑤ determinism check: rendering twice produces an empty diff.

In-depth answer
# tests/deployment_test.yaml (helm-unittest)
suite: deployment
templates: [templates/deployment.yaml]
tests:
  - it: should not render replicas when autoscaling is enabled
    set: { autoscaling.enabled: true }
    asserts:
      - notExists: { path: spec.replicas }
  - it: selector must not contain version
    asserts:
      - notExists: { path: spec.selector.matchLabels["app.kubernetes.io/version"] }
ct lint --config ct.yaml --target-branch main
ct install --config ct.yaml --upgrade
Common follow-ups
  • How does ct know which charts to test? It compares against the target branch to find changed charts, and checks that the version number has been incremented.
Bonus points

Turn this lesson’s production issues (#6, #13, #19, #22, #46) into unit tests, forming a “regression test library.”

Common wrong answers

“helm lint is the test.”

See Lesson 5 Module 1 Chart CI: lint, ct and kubeconform.

Chart quality pyramid (Q25): the further down, the faster and more frequent Upgrade test ct install + helm test (kind) kubeconform · policy checks · determinism diff lint --strict · schema · helm-unittest Catches: immutable fields #6Catches: probes/dependencies #5Catches: API versions #48, random values #46Catches: indentation #13, types #16 Minute-levelSecond-level
Figure 6-1: each class of production issue should be caught at some layer
Named templates are global across parent and child charts (Q16) Parent chart myappdefine "fullname" ✗ (no prefix)define "myapp.fullname" ✓ Subchart redisdefine "fullname" ✗ — collides with the parent chart’sdefine "redis.fullname" ✓ All charts’ templates are resolved in one shared template set; a same-named define loaded later overrides the one loaded earlier
Figure 6-2: always prefix named templates with the chart name

Scenario 6-1: review a chart submitted by a colleague

The chart in the PR: selector includes app.kubernetes.io/version; env uses a list; the password {{ randAlphaNum 16 }}; ServiceMonitor renders unconditionally; there is no schema; Chart.yaml version is unchanged. List your review comments and their priority.

Key points of the reference answer
  • Blocking: selector includes the version (every version bump hits an immutable field, #6); random password (changes on every upgrade, GitOps OutOfSync, #24/#46); chart content changed without incrementing version (#32).
  • High: add a values switch and a Capabilities guard for ServiceMonitor (#43); add values.schema.json (#16).
  • Medium: change env to a map to support multi-layer overrides (#19); add a ConfigMap checksum annotation (#22).
  • Add helm-unittest cases covering these points (Q25).

Scenario 6-2: where should the database migration go?

myapp 1.5 needs to add columns to a PostgreSQL table (in addition to Redis). Candidate options: a pre-upgrade hook Job, an init container, migration at application startup, or a separate pipeline step. Compare them and give a recommendation.

Key points of the reference answer
  • Hook Job: runs once before the new version; a failure blocks the release; but it has first-install dependency problems (#41), leftovers (#40) and GitOps mapping differences (#45).
  • init container: runs in every Pod, needs idempotency and locking; it also runs on scale-out.
  • Migration at application startup: simple, but has concurrency issues across replicas and startup-time problems.
  • Separate pipeline step: the clearest; can be approved and rolled back on its own; needs orchestration.
  • Recommendation: backward-compatible expand/contract migration + pre-upgrade hook (with before-hook-creation, activeDeadlineSeconds and log passthrough); large migrations go through a separate step.
or score ≥ 70% in the “Quiz”

Module 7 · Part B: Distribution, security and CI/CD (questions 26–38)

44:00 – 52:00 · HTTP repositories vs OCI, signing, secrets, RBAC, CI/CD pipelines, GitOps, Helmfile, versioning policy, supply chain, diff, multiple environments
8 minOCI · cosign · Argo CD v3.6 · Flux v2.1013 questions
Learning objectives
  • Be able to design the full “chart from PR to production” path: CI tests → package and sign → push to OCI (immutable) → GitOps/pipeline deployment → verification and rollback.
  • Be able to explain the security boundaries in a Helm setting: who can push charts, who can deploy, where secrets live, and what the release record contains.
  • Compare deployment approaches: Argo CD, Flux, Helmfile and plain pipelines.

Scan the questions and what they test first; click a row to jump to the details.

Q26. What is the difference between a traditional HTTP chart repository and an OCI registry? How do you choose?Basic
30-second answer

An HTTP repository serves index.yaml + .tgz as a static site; clients must repo add/update and cache the index; OCI stores charts as OCI artifacts in a container registry, pulled by oci://host/path/name:version tag or by digest directly, reusing the registry’s authentication, replication, scanning and retention policies. Prefer OCI for new projects.

In-depth answer
HTTP repositoryOCI
Indexindex.yaml (very large for big repositories)None; resolved by tag
Authenticationbasic auth / publicregistry tokens (ACR/ECR/GHCR)
Searchhelm search reporegistry API / Artifact Hub
ImmutabilityBy conventionDigest + tag immutability policy
Typical hostingGitHub Pages + chart-releaserACR, ECR, GHCR, Harbor
Common follow-ups
  • Can you helm search OCI charts? Not with search repo; you can helm show chart oci://….
  • The + sign in tags? It is replaced with _ (#32).
Bonus points

Mention that OCI puts charts and images in the same registry under the same replication and retention policies, which also makes syncing to offline/isolated environments easier.

Common wrong answers

“OCI also requires helm repo add first” (#26).

See Lesson 1 Module 6.

Q27. Describe the complete command workflow for publishing a chart to OCI and deploying it by digest.Intermediate
30-second answer

CI: helm dependency build → helm lint → helm package (you can set --version/--app-version) → helm registry login <host> → helm push chart.tgz oci://host/path (outputs the digest) → sign. CD: helm upgrade --install name oci://host/path/chart --version X, or in Helm 4 oci://host/path/chart@sha256:….

In-depth answer
helm package charts/myapp --version 1.4.0 --app-version 1.1 -d dist/
az acr login -n myacr --expose-token --query accessToken -o tsv | helm registry login myacr.azurecr.io -u 00000000-0000-0000-0000-000000000000 --password-stdin
helm push dist/myapp-1.4.0.tgz oci://myacr.azurecr.io/helm 2>&1 | tee push.log
DIGEST=$(awk '/Digest:/{print $2}' push.log)
helm upgrade --install myapp "oci://myacr.azurecr.io/helm/myapp@${DIGEST}" -n myapp -f values/prod.yaml --wait
Common follow-ups
  • What is different with ECR? You must create the path/chartname repository in advance (#34).
  • What happens if the digest does not match? The install is refused (#33).
Bonus points

Record both the chart version and the digest in the deployment record, so an audit can prove that “what was deployed is what was reviewed.”

Common wrong answers

In registry login , writing oci:// prefix (Helm 4 accepts only domain names, #30).

See Lesson 3 Module 2,Lesson 5 Module 2.

Q28. How do you ensure chart integrity and provenance? What is the difference between Helm provenance and cosign?Advanced
30-second answer

Helm’s native provenance: helm package --sign is generated with a PGP private key, producing a .prov file (containing the hash of Chart.yaml and the package, PGP-signed); at install time, use --verify --keyring to verify. For OCI, Sigstore cosign is more common: it signs the chart artifact’s digest (key-based or keyless with a transparency log), verified by an admission controller or the pipeline. Both need digest pinning.

In-depth answer
helm package charts/myapp --sign --key 'Release Bot' --keyring ~/.gnupg/secring.gpg
helm verify myapp-1.4.0.tgz --keyring pubring.gpg
helm install myapp oci://myacr.azurecr.io/helm/myapp --version 1.4.0 --verify --keyring pubring.gpg
cosign sign --yes myacr.azurecr.io/helm/myapp@sha256:…
cosign verify myacr.azurecr.io/helm/myapp@sha256:… --certificate-identity-regexp 'https://github.com/org/charts/.*' --certificate-oidc-issuer https://token.actions.githubusercontent.com

The modern GnuPG keyring format (.kbx) must first be exported to the legacy format for Helm to use; Helm 4 plugins also support signing and verification (helm plugin verify).

Common follow-ups
  • Can Argo CD / Flux verify? Flux’s OCI sources support cosign/notation verification; Argo CD can verify image signatures through admission policies (Kyverno, Ratify).
Bonus points

Include chart signatures, image signatures and SBOMs together in the supply-chain policy (Q36).

Common wrong answers

“If the registry has access control, signing is unnecessary.”

See Lesson 5 Module 3 Documentation and signing.

Q29. How do you manage secrets in Helm deployments? Compare helm-secrets/SOPS, External Secrets and Secrets Store CSI.Intermediate
30-second answer

Principle: secrets must not go into Git or values in plain text (they end up in the release record). helm-secrets + SOPS: values files are encrypted in Git and decrypted at deploy time—simple, but the deploy side needs the decryption key, and the release record still holds plain text. External Secrets Operator: the chart only declares an ExternalSecret, and a controller syncs it from Key Vault/Secrets Manager into a Kubernetes Secret—the secret never passes through Helm. Secrets Store CSI: mounted as a volume, optionally synced into a Secret.

In-depth answer
Does the secret pass through Helm?RotationGitOps-friendly
--set / plaintext valuesYes (visible in the release Secret)ManualNo
helm-secrets + SOPSYesChange the file and redeployRequires plugin support
External SecretsNoAutomatic refreshYes
CSI driverNoRefreshed on mountYes

The chart provides a uniform existingSecret interface, decoupled from the source of the secret.

Common follow-ups
  • How do you give ESO its cloud identity? Workload Identity / Pod Identity; the SA name must be fixed (#38).
Bonus points

Point out that the configmap storage driver makes the secrets in the release record visible to anyone who can read ConfigMaps.

Common wrong answers

“Kubernetes Secrets are encrypted, so putting them in values is fine.”

See Lesson 6 Module 3,Lesson 3 Module 3.

Q30. What permissions should the identity running Helm in CI/CD have? How do you achieve least privilege?Intermediate
30-second answer

Helm’s permissions are simply the executor’s Kubernetes RBAC. Each application pipeline’s identity has create/update/delete rights only on the resources it needs within its target namespace (including Secrets, since they hold release records), and is not granted cluster-admin; cluster-level resources (CRDs, ClusterRoles, webhooks) are managed separately by a platform pipeline. In the cloud, OIDC is used to obtain short-lived credentials.

In-depth answer
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata: { name: helm-deployer, namespace: myapp }
rules:
  - apiGroups: ["", "apps", "batch", "networking.k8s.io", "policy", "autoscaling"]
    resources: ["deployments","services","configmaps","secrets","serviceaccounts","jobs","ingresses","poddisruptionbudgets","horizontalpodautoscalers","pods","pods/log"]
    verbs: ["get","list","watch","create","update","patch","delete"]

AKS: Entra ID groups + namespace-scoped roles in Azure RBAC for Kubernetes; EKS: access entries + namespace-scoped access policies (#36).

Common follow-ups
  • Why are list/watch needed? Waiting (kstatus) and ownership checks need to read objects.
  • What was the problem with Helm 2? Tiller concentrated high privileges (Q3).
Bonus points

Keep the deployment identity, the chart-push identity and the registry-pull identity separate.

Common wrong answers

“Helm needs cluster-admin.”

See Lesson 3 Module 6,Lesson 4 Module 6.

Q31. Describe a production-grade chart CI pipeline (on the chart repository side).Intermediate
30-second answer

PR stage: ct lint (including the version-increment check), helm-unittest, kubeconform, policy checks, helm-docs to verify the README is current, ct install (kind) + upgrade test. Merge to main: package (including dependencies) → push to OCI (or chart-releaser publishes a GitHub Release + index) → sign → update the version in the deployment repository (Renovate/automatic PR).

In-depth answer
# GitHub Actions snippet (pin tool versions; check each project’s release page)
jobs:
  test:
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - uses: azure/setup-helm@v4
        with: { version: v4.3.2 }
      - uses: helm/chart-testing-action@v2
      - run: ct lint --target-branch ${{ github.event.repository.default_branch }}
      - uses: helm/kind-action@v1
      - run: ct install --target-branch ${{ github.event.repository.default_branch }} --upgrade
Common follow-ups
  • Why does ct need fetch-depth: 0? It needs to compare against the target branch to find the changed charts.
Bonus points

Turn issues such as #6, #13 and #46 from this lesson’s issue list into automated checks.

Common wrong answers

Only lint, with no install or upgrade tests.

See Lesson 5 Modules 1–2.

Q32. When deploying Helm through a pipeline (not GitOps), how should the production deployment steps be written?Intermediate
30-second answer

Serialize deployments of the same release → log in to cloud and cluster via OIDC → render and show the diff (helm diff upgrade) for approval → helm upgrade --install --version <pinned> -f values/prod.yaml --rollback-on-failure --wait --timeout 10m --history-max 20 → post-deployment smoke test (helm test / external probe) → on failure, collect evidence and alert.

In-depth answer
set -euo pipefail
helm diff upgrade myapp oci://myacr.azurecr.io/helm/myapp --version 1.4.0 -f values/prod.yaml -n myapp --allow-unreleased
helm upgrade --install myapp oci://myacr.azurecr.io/helm/myapp --version 1.4.0 \
  -f values/common.yaml -f values/prod.yaml -n myapp --create-namespace \
  --rollback-on-failure --wait=watcher --timeout 10m --history-max 20 || {
    kubectl get events -n myapp --sort-by=.lastTimestamp | tail -40
    helm history myapp -n myapp --max 5; exit 1; }
helm test myapp -n myapp --logs
Common follow-ups
  • What if CI cancellation leaves the release pending? See #2: serialization + timeout settings + a runbook.
Bonus points

job timeout > Helm timeout; failure information is collected automatically through hook-output-log-policy and events (#9, #39).

Common wrong answers

Using helm install || helm upgrade as a two-step process.

See Lesson 3 Module 6,Lesson 5 Module 7.

Q33. What is the fundamental difference between how Argo CD and Flux manage Helm?Advanced
30-second answer

Argo CD treats Helm as a renderer: helm template It generates manifests, which Argo CD applies and diffs itself; there is no Helm release (#45), hooks are mapped to sync hooks, and lookup is unavailable. The Flux helm-controller uses the Helm SDK to run the real install/upgrade, with release records, supporting Helm hooks, tests and remediation (retries, rollback, uninstall) (#47).

In-depth answer
Argo CDFlux
Helm releaseNoneYes (visible in helm list)
Diff detectionIts own diff, with an intuitive UIHelm storage + drift-detection options
hooksMapped to PreSync/PostSyncNative Helm
Failure handlingRetries, sync wavesremediation retries + strategy
Multi-clusterCentralized ApplicationSetPer-cluster autonomy
Common follow-ups
  • The team already has a Helm runbook; which is cheaper to migrate to? Flux’s release semantics are closer; Argo CD has stronger visualization and multi-cluster management.
Bonus points

Point out that both require deterministic chart rendering (#46), and the authentication methods for OCI chart sources (Flux: OCIRepository/HelmRepository type oci; Argo CD: repository credentials with enableOCI).

Common wrong answers

“Apps deployed by Argo CD can be rolled back with helm rollback.”

See Lesson 5 Modules 4–5.

Q34. What problem does Helmfile solve? When should you use it instead of an umbrella chart?Intermediate
30-second answer

Helmfile uses one declarative file to describe “multiple releases + each chart’s version + values + environments”, and supports helmfile diff/apply/sync, release dependencies (needs), environment layering and secrets integration. Compared with an umbrella chart, it keeps multiple independent releases (each upgraded, rolled back and with its own history), avoiding a single release that is too large and coupled.

In-depth answer
environments:
  dev: { values: [env/dev.yaml] }
  prod: { values: [env/prod.yaml] }
---
releases:
  - name: redis
    namespace: myapp
    chart: oci://registry-1.docker.io/cloudpirates/redis
    version: 0.x.x
  - name: myapp
    namespace: myapp
    chart: oci://myacr.azurecr.io/helm/myapp
    version: 1.4.0
    needs: [myapp/redis]
    values: [values/common.yaml, "values/{{ .Environment.Name }}.yaml"]
helmfile -e prod diff && helmfile -e prod apply
Common follow-ups
  • Does Helmfile conflict with GitOps? It can be used in Argo CD through a plugin, or only in non-GitOps scenarios (cluster bootstrapping).
Bonus points

Bootstrap platform components (CRDs, controllers) with Helmfile, and manage applications with GitOps.

Common wrong answers

“Helmfile is a replacement for Helm”—it orchestrates Helm.

See Lesson 5 Module 6 Helmfile and multi-release orchestration.

Q35. How should the chart’s version and appVersion be managed? What is the versioning policy?Basic
30-second answer

version is the chart’s SemVer; it must be incremented for any change to the chart’s content (templates, default values, dependencies); appVersion describes the default application version deployed, often used as the default image tag. The two are independent: an application release can change only appVersion (while bumping the chart patch version), and a chart refactor can leave appVersion unchanged. Published versions are immutable.

In-depth answer
  • MAJOR: incompatible values (renamed/removed keys), selector changes and other changes that need manual intervention; MINOR: new optional features; PATCH: fixes.
  • Multiple charts in one repository: use ct to enforce version increments; at release time, generate the version from a Git tag or CI,helm package --version --app-version.
  • Pre-releases: 1.5.0-rc.1, consumers need --devel to use them (#27).
Common follow-ups
  • Where should the build number go? Do not use +build to distinguish content (#32); put it in annotations or appVersion.
Bonus points

Record the source commit in Chart.yaml annotations (for example org.opencontainers.image.source OCI-style keys) for easier traceability.

Common wrong answers

“version and appVersion must be the same.”

See Lesson 2 Module 1.

Q36. From a supply-chain security perspective, what should you check before using a third-party chart?Advanced
30-second answer

Source and maintenance (Artifact Hub verified publisher, update frequency, license); image source and whether it can continue to be obtained (for example, the Bitnami catalog change in 2025-08); default permissions (RBAC, hostPath, privileged mode, ClusterRole scope); what the hooks do; whether there are CRDs and webhooks; scanning of the rendered output (Trivy/Checkov/Kyverno); signature and digest pinning; then mirror both the images and the chart into your own registry.

In-depth answer
helm pull oci://registry-1.docker.io/cloudpirates/redis --version 0.x.x --untar -d review/
helm template r review/redis -f my-values.yaml | yq 'select(.kind|test("Role|Binding|Webhook|CustomResourceDefinition"))|.kind+"/"+.metadata.name'
helm template r review/redis -f my-values.yaml | grep -E 'image:' | sort -u
helm get hooks …   # or check helm.sh/hook in templates
Common follow-ups
  • How do you use it on an isolated network? Sync the chart and images to an internal ACR/ECR/Harbor, and override the registry in values (global.imageRegistry).
Bonus points

Record review conclusions in an internal “approved chart list”, and use policy to block HelmRepository/OCIRepository sources that are not on it.

Common wrong answers

“Charts in official repositories are all safe.”

See Lesson 1 Module 0 note on Bitnami,Lesson 5 Module 3.

Q37. How do you review the changes a Helm deployment will bring in a PR?Intermediate
30-second answer

Two layers of diff: ① rendering diff against the previous chart version (offline: run old and new charts with the same values through helm template and diff the output; a GitOps repository can post it via a CI bot); ② diff against production (helm diff upgrade plugin, or --dry-run=server + kubectl diff). Focus on: selector, PVCs, deleted objects, RBAC and images.

In-depth answer
helm plugin install https://github.com/databus23/helm-diff
helm diff upgrade myapp oci://myacr.azurecr.io/helm/myapp --version 1.5.0 -f values/prod.yaml -n myapp --context 3
diff -u <(helm template myapp ./chart-1.4.0 -f values/prod.yaml) <(helm template myapp ./chart-1.5.0 -f values/prod.yaml)

Compatibility of helm-diff with Helm 4 follows the plugin repository’s notes; Argo CD users can use directly argocd app diff.

Common follow-ups
  • How do you hide Secrets in the diff? helm-diff masks Secret content by default; custom scripts must --hide-secret (dry-run only).
Bonus points

Set automatic blocking rules for “deleted objects”, “PVC replacement” and “RBAC expansion.”

Common wrong answers

Reviewing only changes to the values file and ignoring the rendered output.

See Lesson 1 Module 7.

Q38. How do you organize values and promotion across multiple environments (dev/staging/prod, multiple regions and clusters)?Intermediate
30-second answer

The same immutable chart version is promoted across environments, changing only values. Values layers: common.yaml → env/<env>.yaml → cluster/<region>.yaml, maps merge, and avoid lists that need to be stacked (#19). Promotion is done by a PR that changes the chart version in the environment directory (GitOps); prod requires approval.

In-depth answer
deploy-repo/
  apps/myapp/
    base/values.yaml
    envs/dev/values.yaml        chart: 1.5.0-rc.2
    envs/staging/values.yaml    chart: 1.5.0
    envs/prod-cc/values.yaml    chart: 1.4.0   ← canadacentral
    envs/prod-ca/values.yaml    chart: 1.4.0   ← ca-central-1

Argo CD ApplicationSet or Flux Kustomization generates deployments per directory; Renovate automatically opens PRs for dev, and staging/prod are promoted manually.

Common follow-ups
  • What if the environments differ too much? Large differences mean the configuration surface is poorly designed; reduce the differences to a few switches, or split them into different charts.
Bonus points

Run lint + schema + rendering diff on each environment’s values in CI.

Common wrong answers

One branch per environment (branches drift and are hard to merge).

See Lesson 6 Module 2 Values layering and multiple environments.

Chart delivery path and identity boundaries (Q27–Q33) Chart repository PRct · unittest package · signcosign / .prov OCI registryImmutable tag · digest Deployment repository PRVersion + values · diff Argo CD / Flux / pipelineNamespace-level RBAC Identity 1: publisherOIDC → AcrPush / ECR pushSigning key / keyless Identity 2: deployerAcrPull + namespace RoleCan read and write release Secrets Identity 3: workloadSA → Workload/Pod IdentitySecrets come from ESO / CSI
Figure 7-1: three separate identities: publish, deploy, run

Scenario 7-1: design a chart delivery platform for 50 microservice teams

50 teams, each with its own services; the platform team wants unified standards without becoming a bottleneck. Design the chart organization, repositories, CI/CD and governance.

Key points of the reference answer
  • The platform provides a library chart (standard Deployment, labels, security context, probes, PDB) + an application chart template repository; teams maintain thin application charts.
  • OCI registry (ACR/ECR) with paths and RBAC split by team, immutable tags, signing.
  • CI templates (reusable workflows / YAML templates): ct, unittest, kubeconform, policy checks; after the platform upgrades the library, Renovate automatically opens PRs.
  • CD: GitOps, with ApplicationSets generated per team/environment; namespace-level permissions; prod approval.
  • Governance: policies (Kyverno/Gatekeeper) as a cluster-side safety net; a scorecard tracks adoption rates.

Scenario 7-2: a security audit finds a database password in a release Secret

The audit used helm get values and read the production database password. Propose a short-term containment and a long-term remediation plan.

Key points of the reference answer
  • Short term: rotate the password; tighten read permissions on Secrets (anyone who can get secrets can read release records); trim old values from historical revisions (old records are deleted once a new deployment is made and history-max is reduced).
  • Long term: the chart supports existingSecret; secrets are synced from Key Vault/Secrets Manager by External Secrets; CI forbids --set *password*; static scanning of values and pipelines.
  • Verify that helm get values --all no longer contains secrets.

Scenario 7-3: migrating from Jenkins script deployments to GitOps

Right now Jenkins uses helm upgrade to deploy 30 releases. Would you choose Argo CD or Flux? During migration, how do you avoid downtime and “dual controllers”?

Key points of the reference answer
  • Basis for the choice: whether Helm release semantics and hooks must be kept (Flux is closer); whether multi-cluster visualization is needed (Argo CD).
  • Flux: a HelmRelease using the same release name and namespace can take over the existing release (helm-controller continues with the upgrade). Argo CD: it renders and applies, object annotations change, the original release Secret becomes “legacy” and must be cleaned up, and the runbook must be switched (#45).
  • Migration steps: freeze Jenkins deployments of the release → create the GitOps definition (sync manually or pause auto-sync first) → confirm the diff is empty → turn on auto-sync → delete the Jenkins job.
or score ≥ 70% in the “Quiz”

Module 8 · Part B: Production practice and scenario design (questions 39–50)

52:00 – 60:00 · zero downtime, migrations, recovering stuck releases, rollback strategies, chart granularity, platform charts, CRDs, scale, multi-tenancy, Helm 4 migration, disaster recovery, end-to-end design
8 minAKS · EKS · GitOps12 questions
Learning objectives
  • Be able to distil the 50 Part A issues into design principles, and proactively mention risks and mitigations in open-ended questions.
  • Be able to explain an end-to-end solution in 5 minutes: chart design → delivery → deployment → observability → rollback → disaster recovery.
  • Answer structure: clarify requirements and constraints → solution → trade-offs → risks and validation.

Scan the questions and what they test first; click a row to jump to the details.

Q39. How do you achieve zero-downtime upgrades with Helm? What chart design is needed?Intermediate
30-second answer

Helm only submits the new desired state; zero downtime comes from workload design: RollingUpdate (maxUnavailable: 0, maxSurge: 1), an accurate readinessProbe, preStop + terminationGracePeriodSeconds to drain connections, PDBs, and multiple replicas spread across nodes/availability zones, combined with --wait=watcher and automatic rollback; also avoid changes that force replacement (immutable fields, renames).

In-depth answer
strategy:
  type: RollingUpdate
  rollingUpdate: { maxUnavailable: 0, maxSurge: 1 }
template:
  spec:
    terminationGracePeriodSeconds: 30
    topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: topology.kubernetes.io/zone
        whenUnsatisfiable: ScheduleAnyway
        labelSelector: { matchLabels: {{- include "myapp.selectorLabels" . | nindent 10 }} }
    containers:
      - lifecycle: { preStop: { exec: { command: ["sh","-c","sleep 10"] } } }
        readinessProbe: { httpGet: { path: /healthz, port: http }, periodSeconds: 5 }
Common follow-ups
  • What about database schema changes? expand/contract (Q40).
  • Renaming a Service/Ingress? Run old and new side by side for a while before deleting the old one.
Bonus points

Mention connection draining at the Ingress/Gateway layer, and load balancer health-check intervals (LBC target group deregistration delay).

Common wrong answers

“helm upgrade is zero-downtime by itself.”

See Lesson 6 Module 7 Zero-downtime upgrades and compatibility design.

Q40. Should database migrations go in a Helm hook, an init container, or a separate step?Advanced
30-second answer

There is no silver bullet. pre-upgrade hook Job: runs once, and a failure blocks the release. Suitable for small and medium migrations, but you must handle first-install dependencies, leftovers and GitOps mapping (#39–#41, #45). init container: runs in every Pod and needs idempotency + a distributed lock. Standalone pipeline step: can be approved, observed and retried separately; suitable for large or long-running migrations. Either way, the migration must be backward compatible (expand → deploy → contract).

In-depth answer
  • Key points of hook design: before-hook-creation,hook-succeeded,activeDeadlineSeconds,backoffLimit: 0~1,hook-output-log-policy: hook-failed, relying only on configuration created at the hook level.
  • Rollback: Helm rollback does not roll back the schema (Q7); the contract step must be deferred until rollback is no longer needed.
Common follow-ups
  • What if the migration takes 30 minutes? Don’t put it in a hook (--timeout CI timeouts and pending risk); use a standalone Job + observability.
Bonus points

Provide a runbook for “migration failure”: failed hook logs, release status, and how to retry safely.

Common wrong answers

“Put the migration in a post-upgrade hook”—the new code is already running against the old schema.

See Lesson 6 Module 4.

Q41. A release is stuck in pending-upgrade in production. How do you handle it?Intermediate
30-second answer

First confirm no deployment is running (CI, a colleague’s terminal, the GitOps controller); check helm history and the creation time of the pending revision; the preferred option is helm rollback <last deployed> to clear it; if rollback is not possible (pending-install), back up and delete the pending Secret, then redeploy; finally fix the root cause (CI cancellation, timeout settings).

In-depth answer
helm history myapp -n myapp --max 5
kubectl get secret -n myapp -l owner=helm,name=myapp -L status,version --sort-by=.metadata.creationTimestamp
helm rollback myapp <LAST_DEPLOYED> -n myapp --wait
# or:
kubectl get secret sh.helm.release.v1.myapp.v18 -n myapp -o yaml > v18.yaml && kubectl delete secret sh.helm.release.v1.myapp.v18 -n myapp
Common follow-ups
  • What about releases managed by Flux? helm-controller handles it; if needed, suspend → fix → resume (#47).
  • Can I just change the Secret’s status label to failed? The label is only an index; the status lives in the Secret data, so changing the label is unreliable.
Bonus points

Prevention: CI concurrency control, job timeout > --timeout, alert on “pending longer than N minutes”.

Common wrong answers

“Delete all release Secrets” (scenario question 5-2).

See Lesson 7 Module 2.

Q42. Should automatic rollback (--rollback-on-failure) be enabled in production? How do you choose between rollback and roll forward?Intermediate
30-second answer

Usually enabled: on failure it quickly restores the last known-good version and reduces manual intervention. It must be paired with failure evidence collection (#9), sensible timeouts, readiness probes that truly reflect health, and backward-compatible migrations. Roll forward is better when an irreversible data change has already run, the rollback target has a security vulnerability, or the problem lies in the environment (quotas, external dependencies) rather than the version itself.

In-depth answer
  • Automatic rollback only covers failures detectable during deployment; an error-rate increase that appears minutes after go-live needs progressive delivery (Argo Rollouts/Flagger) or monitoring-triggered rollback.
  • GitOps: rollback = git revert, keeping Git as the single source of truth; Flux’s remediation.strategy: rollback will temporarily make the cluster diverge from Git, so fix Git afterward.
Common follow-ups
  • Is it appropriate to automatically uninstall after a failed first install? Disable it in dev to make troubleshooting easier; enable it in prod.
Bonus points

Use SLO-driven canary releases to complement Helm’s “at-deploy-time checks”.

Common wrong answers

“With automatic rollback, no testing is needed.”

See Lesson 5 Module 7.

Q43. What are the pros and cons of an umbrella chart versus a separate chart for each service?Intermediate
30-second answer

Umbrella: one release deploys the whole system, with consistent versions and simple installation (suited to customer deliveries and demo environments). Drawbacks: coupled upgrades (one failing service fails the whole release), larger release records (#11), coarse permission granularity, and teams blocking each other. Separate charts: each is released and rolled back independently and teams are autonomous; composition needs an orchestration tool (Helmfile, GitOps dependency ordering).

In-depth answer
umbrellaSeparate charts
Release cadenceUnifiedIndependent
Rollback granularityWhole systemSingle service
Dependency orderinghooks / no guaranteeneeds / sync wave
Best forPackaged delivery, small systemsMulti-team microservices
Common follow-ups
  • A compromise? Group by “components that change together”: the app plus its dedicated cache in one release; shared database separate.
Bonus points

Cite #11 and #23 to illustrate umbrella’s real failure modes.

Common wrong answers

“An umbrella chart guarantees subchart install order”—subchart resources are submitted together with parent resources and sorted together, not in dependency order.

See Lesson 6 Module 1 Chart granularity.

Q44. A platform team needs to provide a “common chart” for all applications. How would you design and govern it?Advanced
30-second answer

Two patterns: ① a single generic application chart (every service only writes values) — highest consistency, but the values surface balloons into “another YAML language”; ② a library chart + thin application charts — standardizes the common parts while applications keep their freedom. I lean toward ② with a strict schema, secure defaults (non-root, resource requests, probes, PDB), semantic versioning with automatic upgrade PRs, and rendering snapshot tests.

In-depth answer
  • Interface: the values schema is the API; breaking changes go through a MAJOR bump with migration notes.
  • Defaults: secure defaults + explicit exemptions (for example, a legacy service that needs root documents why).
  • Distribution: OCI + signing; Renovate opens batch PRs; CI compares rendered snapshots.
  • Cluster backstop: a policy engine blocks non-compliant objects even when the chart is bypassed.
Common follow-ups
  • What if a team needs a sidecar? Provide controlled extension points (extraContainers, extraVolumes) instead of forking.
Bonus points

Measure with metrics: adoption rate, version distribution, policy violation count.

Common wrong answers

“Write one giant generic chart where every field is configurable.”

See Lesson 2 Module 6,Lesson 6 Module 8 Comprehensive architecture review.

Q45. How do you manage the lifecycle of operators and CRDs?Advanced
30-second answer

CRDs are cluster-level APIs and are managed separately from the operator: the platform pipeline (or a dedicated CRD chart / the upstream-provided CRD toggle) upgrades CRDs first and the operator afterward; add helm.sh/resource-policy: keep or place it in crds/ to prevent deletion on uninstall (#44); check version conversion before upgrading (conversion webhook, storage version); guard the application chart’s use of CRs with Capabilities + values toggles (#43).

In-depth answer
  • crds/: simple, but never upgraded (#42); templates/: upgradable, but dangerous on uninstall and needs keep.
  • GitOps ordering: Argo CD sync waves (CRD -1, operator 0, CR 1); Flux uses dependsOn with HelmRelease’s install.crds/upgrade.crds policy.
  • Before removing an old API version, confirm the storage version has been migrated.
Common follow-ups
  • Multiple teams depend on the same CRD? There can be only one owner (the platform); application charts must not ship the CRD.
Bonus points

Mention RBAC restrictions on CRD deletion and admission policies.

Common wrong answers

“helm upgrade automatically upgrades CRDs.”

See Lesson 6 Module 6.

Q46. What performance and scale problems does Helm hit at large scale (hundreds of releases, very large charts)?Advanced
30-second answer

release records approach the 1 MiB limit (#11); many historical Secrets make helm list list operations slow and put pressure on etcd (lower --history-max); slow rendering (many include nested,tpl, large files .Files.Get); waiting on many resources times out; GitOps controllers that render frequently consume CPU.

In-depth answer
  • Measure: time helm template,helm get manifest | wc -c, Secret size (diagnostic commands from #11).
  • Optimize: split releases; .helmignore; avoid repeatedly including the same large template inside loops (store it in a variable first); move large config files out of the chart; Helm 4 also improves dependency resolution and content caching.
  • Storage: at extreme scale, evaluate an SQL driver.
Common follow-ups
  • Argo CD rendering is slow? Scale and cache repo-server, reduce the number of applications generated by ApplicationSets, avoid lookup.
Bonus points

Provide capacity planning: releases per namespace × history-max × average record size.

Common wrong answers

“Set history-max to 0 (unlimited) to make rollback easier.”

See Lesson 7 Modules 5, 6.

Q47. How do you let multiple teams use Helm safely in a multi-tenant cluster?Intermediate
30-second answer

Each team gets one or more namespaces, and releases live inside their namespace (release records are also in the team namespace and are mutually invisible); the team’s deployment identity has only namespace-level Roles; cluster-level objects (CRDs, ClusterRoles, webhooks, IngressClasses) can only be delivered by the platform; ResourceQuota/LimitRange, Pod Security Admission, NetworkPolicy and a policy engine limit what a chart can create.

In-depth answer
  • Third-party charts often create ClusterRole/ClusterRoleBinding by default—under team permissions this fails, so they must be provided after platform review.
  • Note: read access to Secrets = being able to read all release values in that namespace (Q5).
  • Argo CD: AppProjects restrict target namespaces, allowed source repositories and resource kinds; Flux: multi-tenancy lockdown (forbid cross-namespace references, default SA impersonation).
Common follow-ups
  • Can team A take over team B’s objects? The ownership check blocks it (#4); but --take-ownership it can be done with the RBAC permission alone, so RBAC is the real boundary.
Bonus points

Mention that release names can repeat across namespaces, but cluster-level object names collide, so cluster-level object names in a chart should include the namespace or release.

Common wrong answers

“Helm has built-in multi-tenant isolation.”

See Lesson 6 Module 8.

Q48. How do you migrate from Helm 3 to Helm 4 in a large organization?Advanced
30-second answer

Inventory → compatibility scan → phased cutover → monitoring. Inventory every place that calls Helm (CI images, the Helm version bundled in GitOps controllers, scripts, plugins); scan for old flags and behavioral dependencies (#30, #49, #50); deploy with Helm 4 in non-production first and compare renders and results; keep existing upgrades on client-side merge and plan the SSA switch separately; Helm 3 security fixes run until 2027-02-10, which is the deadline.

In-depth answer
  • Charts: v2 charts need no changes; check template functions and plugins that depend on Helm 3-specific behavior.
  • Plugins: post-renderers become plugins; for third-party plugins (diff, secrets, mapkubeapis), confirm the Helm 4-compatible version.
  • Wait: explicitly set --wait=watcher and re-evaluate timeouts; during the transition you can --wait=legacy.
  • SSA: new releases default to SSA; migrate existing releases in batches --server-side=true, detecting conflicts in staging first (#12).
  • GitOps: Argo CD and Flux each bundle their own Helm library; follow their release notes for the version.
Common follow-ups
  • Can Helm 3 and Helm 4 operate on the same release? The release storage format is the same (v1), so they can be used interchangeably, but standardize quickly to avoid a mix of apply methods.
Bonus points

Provide a fallback plan: keep the Helm 3.22 tag in CI images so you can switch back quickly if problems arise.

Common wrong answers

“Just replace the binary.”

See Lesson 7 Module 7.

Q49. The entire cluster is lost. How do you restore all Helm-deployed applications?Advanced
30-second answer

The best answer is to “not depend on in-cluster state”: the GitOps repository stores every release’s chart version and values, charts are immutable in OCI, and secrets live in an external secret store; create a new cluster (Terraform) → bootstrap the GitOps controller → rebuild automatically in dependency order (CRDs/platform → data layer → applications); restore stateful data from backups (Velero snapshots, database-native backups). Release history restarts from v1, which is acceptable.

In-depth answer
  • Without GitOps: at minimum, periodically export helm list -A -o json and each release’s helm get values, along with the chart version used; or back up the namespace holding release Secrets with Velero.
  • Post-restore verification: compare rendered output, run helm test, and check external dependencies (DNS, certificates, and the federated credential issuer of cloud identities, which has changed: the OIDC issuer URL of a new AKS/EKS cluster differs, so federated credentials and trust policies must be updated; see #38).
Common follow-ups
  • How do you shorten RTO? Pre-provision a warm standby cluster, rehearse regularly, and reduce manual steps.
Bonus points

Point out the easily overlooked change in the new cluster’s OIDC issuer.

Common wrong answers

“Just back up etcd”—restoring etcd across clusters is impractical, and you still have to handle cloud identity and data.

See Lesson 5 Modules 4, 5,Lesson 6 Module 8.

Q50. Design question: deploy myapp (Flask + Redis) to both AKS and EKS from the same chart, with no long-lived keys, auditable and rollback-capable.Advanced
30-second answer

One myapp chart (library standardization + Redis as an optional dependency or externally managed cache), with cloud differences kept only in values (ingress class, identity annotations, storage class); the chart and images are pushed to ACR/ECR (OIDC, signing, immutable tags); the deployment repository, by envs/<cloud>-<env> organizing values and chart versions, deployed via GitOps; Workload Identity / Pod Identity accesses Key Vault / Secrets Manager, and ESO generates the Secret; rollback = git revert; observability and SLO-driven promotion.

In-depth answer
# values/aks-prod.yaml
image: { repository: myacr.azurecr.io/myapp, tag: "1.1", digest: "sha256:…" }
serviceAccount:
  name: myapp
  annotations: { azure.workload.identity/client-id: "11111111-…" }
podLabels: { azure.workload.identity/use: "true" }
ingress: { className: webapprouting.kubernetes.azure.com }
redis: { enabled: false, externalHost: myapp.redis.cache.windows.net }
# values/eks-prod.yaml
image: { repository: 123456789012.dkr.ecr.ca-central-1.amazonaws.com/myapp, tag: "1.1" }
serviceAccount: { name: myapp }          # Pod Identity association is configured in Terraform by SA name
ingress: { className: alb, annotations: { alb.ingress.kubernetes.io/scheme: internet-facing } }
redis: { enabled: false, externalHost: myapp.xxxxxx.cache.amazonaws.com }
  • Audit: Git history + signatures + deployment records (chart version + digest) + cloud audit logs.
  • Risks and mitigations: fixed SA name (#38); LBC/routing components before the application (#37); deterministic rendering (#46); release size (#11); Helm 4 SSA conflicts (#12).
  • Verification: run ct tests in kind; render each cloud’s values in CI and run kubeconform; after deployment, run helm test + synthetic monitoring.
Common follow-ups
  • Why not use two charts? The differences are only in the configuration layer, and two charts would cause logic drift. Split only when the differences are truly large.
Bonus points

Proactively cover cost and cleanup (resource groups/regions from Lessons 3 and 4) and disaster recovery (Q49).

Common wrong answers

Filling the chart with if eq .Values.cloud "aws" branches instead of parameterizing the differences.

See Lesson 3,Lesson 4,Lesson 6 Module 8.

Q50 whiteboard: one chart, two clouds Chart repositorymyapp chart + libraryCI: ct · sign · push ACRcanadacentral ECRca-central-1 Deployment repositoryenvs/aks-prodenvs/eks-prodVersion + digest + values AKS + GitOpsWI → Key Vault EKS + GitOpsPod Identity → SM Risk list (from Part A)#38 SA name and identity · #37 controller webhook ready first · #46 deterministic rendering · #12 SSA conflicts · #11 release size · #6 immutable fieldsRollback = git revert; disaster recovery = new cluster + GitOps bootstrap + updated OIDC issuer (Q49)
Figure 8-1: answer skeleton for the design question: distribution → configuration → identity → deployment → risks

Scenario question 8-1: postmortem of a Friday-night release incident

A myapp upgrade: the pre-upgrade migration succeeded, the new Pod’s readiness probe failed,--rollback-on-failure and the Deployment was rolled back, but the application still errors. What is the cause, and what improvements should the postmortem recommend?

Key points of the reference answer
  • Cause: the migration (hook) had already changed the schema; Helm rollback only rolls back Kubernetes objects (Q7), so the old code is incompatible with the new schema.
  • Improvements: expand/contract migrations; decouple migrations from releases (Q40); collect evidence when a deployment fails (#9); canary releases; add “check migrations before rolling back” to the runbook.
  • Process: blameless postmortem, and automate the checks (migration compatibility tests).

Scenario question 8-2: after the platform upgrades to Helm 4, several teams’ deployments start timing out

These deployments took 30 seconds in the Helm 3 era; now --wait they wait until the 10-minute timeout. What are the possible causes and troubleshooting steps?

Key points of the reference answer
  • Helm 4’s watcher (kstatus) waits more strictly: for example, a LoadBalancer Service that never gets an address, an unbound PVC, a custom resource whose conditions are not Ready, or a Job that has not completed; Helm 3 legacy does not necessarily wait for these (#49).
  • Troubleshooting: read the per-resource not ready. status status in the error (#5); compare --wait=legacy.
  • Fix: correct the resources that are truly not ready; adjust the chart for resources that should not be waited on (for example, don’t create a LoadBalancer in test environments); use legacy during the transition.

Scenario question 8-3: design a “release health” dashboard for 300 releases

The platform lead wants to know at any time which releases are stuck, failed, or behind on versions. What data would you collect, and how would you implement it?

Key points of the reference answer
  • Data: release status (pending/failed duration), chart version gap versus latest, last deployment time, history count, release record size, GitOps sync status.
  • Implementation: a scheduled job helm list -A -a -o json + kubectl get secret -l owner=helm exports metadata (without decoding content) as metrics; use the metrics built into Argo CD/Flux; alerts for “pending > 15 minutes”, “failed > 1 hour”, “release record > 700 KB”.
  • Mind permissions: reading release content requires Secret read access, so the dashboard should only read labels and sizes.

Teaching videos (titles and channels verified via YouTube oEmbed)

▶
Introduction to Helm | Kubernetes Tutorial | Beginners Guide — That DevOps Guy
English · end-to-end demo, good for reviewing the whole process
▶
Introduction to External Secrets - Secrets Operator for Kubernetes — Microsoft Developer
English · the secrets approach in Q50

No verified video specifically covering Helm production scenario design interviews was found. Storyboard: use Figure 8-1 as the whiteboard, cover Q50 in 5 minutes, and at each arrow point out the corresponding Part A issue number.

or score ≥ 70% in the “Quiz”

Issue cheat sheet + interview flash cards

50 entries of “error → first diagnostic command → common fix” · 50 one-line key-point cards · printable
After class

A · 50 production issues quick reference

Filter by keyword (for example pending,nil,oci,hook). Click a number to jump to the details in the matching module.

B · 50 interview question flash cards

First recall the answer from the question, then expand to compare with the one-line key point; for details, return to the matching module’s “Interview question details”.

General command card

Release status

helm list -A -a                     # all statuses
helm history REL -n NS --max 10
helm status REL -n NS --show-resources
helm get all|values|manifest|hooks|metadata REL -n NS [--revision N]
kubectl get secret -n NS -l owner=helm,name=REL -L status,version
helm rollback REL N -n NS --wait

Render debugging

helm template REL ./chart -f v.yaml --debug --show-only templates/x.yaml
helm lint ./chart --strict -f v.yaml
helm get values REL -n NS --all
helm upgrade … --dry-run=server --hide-secret
helm template … | kubeconform -strict -kubernetes-version 1.37.0
helm diff upgrade REL ./chart -n NS        # plugin

Repository / OCI

helm repo update; helm search repo X --versions --devel
helm dependency list|build|update ./chart
helm registry login HOST                   # domain only (Helm 4)
helm push chart.tgz oci://HOST/PATH
helm show chart oci://HOST/PATH/NAME --version V
helm install REL oci://HOST/PATH/NAME@sha256:…

Helm 4 flags

--rollback-on-failure    # formerly --atomic
--force-replace          # formerly --force
--wait[=watcher|hookOnly|legacy] --timeout 10m --wait-for-jobs
--server-side=true|false|auto --force-conflicts
--take-ownership --cleanup-on-fail --history-max 20
--reset-then-reuse-values --skip-schema-validation

Comprehensive drill + mock interview

8 mixed fault scenarios (observe the symptoms, form your own judgment, then expand the answer) · full mock interview with 10 questions drawn at random from 50 · final quiz
After class ≈ 40 minutes

1. Comprehensive fault drill

Each scenario combines several Part A issues. First write down your first diagnostic command and your judgment, then expand the answer.

Scenario 1: On Monday morning a prod deployment reports “another operation is in progress”; on Friday night a deployment was cancelled by hand
$ helm history myapp -n myapp --max 3
41  superseded       Upgrade complete
42  deployed         Upgrade complete
43  pending-upgrade  Preparing upgrade
$ kubectl get deploy myapp -n myapp -o jsonpath='{.spec.template.spec.containers[0].image}'
myacr.azurecr.io/myapp:1.2      ← v43’s image is half-committed

Answer: The cancelled job left v43 stuck in pending (#2), while the Deployment was partially updated. Confirm nobody is running it → helm rollback myapp 42 --wait (produces v44, image restored) → redeploy after the fix. Improvements: serialize CI, job timeout > --timeout, and do not interrupt deployment steps on cancellation (Q41).

Scenario 2: Migrating a kubectl-managed legacy application to Helm: the install fails; after adding --take-ownership, another error appears
Error: INSTALLATION FAILED: unable to continue with install: Service "legacy" in namespace "legacy" exists and cannot be imported into the current release: invalid ownership metadata; …
(after adding --take-ownership)
Error: INSTALLATION FAILED: … Deployment.apps "legacy" is invalid: spec.selector: … field is immutable

Answer: First helm template | kubectl diff, make the chart’s selectorLabels match the existing object (a temporary values override is fine); once takeover succeeds, plan the label migration as a scheduled change.

Scenario 3: chart 1.5.0 installs fine in dev, but the prod upgrade reports a nil pointer
deploy.sh: helm upgrade myapp corp/myapp --version 1.5.0 -n myapp --reuse-values
Error: UPGRADE FAILED: template: myapp/templates/deployment.yaml:61:30: executing … at <.Values.probes.startup.enabled>: nil pointer evaluating interface {}.enabled

Answer: dev is a fresh install (with the new defaults), while prod uses --reuse-values ignores the 1.5.0-added probes defaults (#18, #14). Change to --reset-then-reuse-values or pass the full values from Git; on the chart side, for newly added parent keys, use dig compatibility; add required to the schema.

Scenario 4: On a new GitHub Actions runner, the chart publish job fails
$ helm dependency build charts/myapp
Error: no repository definition for https://stefanprodan.github.io/podinfo. Please add the missing repos via 'helm repo add'
(after the fix)
$ helm registry login oci://myacr.azurecr.io/helm …
$ helm push … → response status code 401: unauthorized

Answer: A clean runner has no repo definition (#28); the registry login wrote oci:// a URL with a path; Helm 4 accepts only the domain, and the credentials are not stored per host (#30), which causes the push to return 401 (#31). Fix: in CI helm repo add or switch dependencies to OCI; helm registry login myacr.azurecr.io.

Scenario 5: In Argo CD, myapp syncs every 3 minutes and the Redis client repeatedly fails authentication
Secret/myapp-redis  OutOfSync  (password changed)
templates/secret.yaml: password: {{ randAlphaNum 24 | b64enc }}
$ helm list -n myapp   → empty

Answer: Argo CD generates a new password on every render (#46), lookup does not work in Argo CD (#24), and there is no Helm release here (#45). Fix: existingSecret + External Secrets; a temporary ignoreDifferences does not solve the authentication problem.

Scenario 6: First install of myapp on EKS; Ingress creation fails
helmfile apply:
  aws-load-balancer-controller  deployed
  myapp  Error: … failed calling webhook "mservice.elbv2.k8s.aws": … no endpoints available for service "aws-load-balancer-webhook-service"
$ kubectl -n kube-system get pod -l app.kubernetes.io/name=aws-load-balancer-controller
CrashLoopBackOff   (AccessDenied: … elasticloadbalancing:DescribeLoadBalancers)

Answer: The LBC was installed without --wait and missing IAM permissions made the webhook unavailable (#37); a mismatch between the controller’s SA name and the Pod Identity association causes the same (#38). Fix IAM/association → LBC ready → then deploy the application; in Helmfile, add wait: true and declare on myapp needs.

Scenario 7: After the cluster upgraded from 1.36 to 1.37, a release untouched for half a year cannot be upgraded, and another release fails to write
release A: Error: UPGRADE FAILED: current release manifest contains removed kubernetes api(s) for this kubernetes version …
release B: Error: UPGRADE FAILED: create: failed to create: Secret "sh.helm.release.v1.monitoring.v31" is invalid: data: Too long: must have at most 1048576 bytes

Answer: A: the release record contains removed APIs (#48) — use helm-mapkubeapis or rewrite the records per the official docs; scan release records before cluster upgrades. B: the umbrella monitoring chart carries a large amount of dashboard JSON (#11) — move it out of the chart and split the release.

Scenario 8: On the first day of migrating to Helm 4, CI shows warnings and failures
Flag --atomic has been deprecated, use --rollback-on-failure instead
Error: plugin: {Name:./kustomize-wrapper.sh Type:postrenderer/v1} not found
(another release) Error: UPGRADE FAILED: … Apply failed with 1 conflict: conflict with “kubectl-edit” using apps/v1: .spec.replicas

Answer: Old flags (#49); the post-renderer must be changed to a plugin (#50); new releases default to SSA, which conflicts with manual kubectl edit field changes (#12) — once Git is confirmed as the source of truth, --force-conflicts, forbid manual edits; in HPA scenarios, do not render replicas.

2. Full mock interview (10 questions drawn at random from 50)

Each question has a 2-minute countdown: answer aloud first (you can jot key points in the text box), then expand the reference answer and self-rate as “Got it / Partly / Missed”. When finished, the round score is shown, along with cumulative mastery rates by module. Self-rating results are saved in this browser.

3. Open-ended self-check (6 questions)

  1. Draw the helm upgrade --install steps, and mark at which step #1, #2, #4, #5, #6, #11 and #12 each occur.
  2. Explain why the pending-* states act as a “lock”, and how that differs from a true distributed lock.
  3. How do the values merge rules lead to #18 and #19? What should chart authors and users each do to guard against this?
  4. Placing CRDs in crds/ versus placing them in templates/ ; what are the consequences of each?
  5. How do the differences in how Argo CD and Flux use Helm affect hooks, lookup, and rollback?
  6. Give a checklist for migrating your organization to Helm 4 (at least 6 items).

4. Final quiz (12 questions)

Sources and version notes

Verified 2026-11-15 · Version baseline: Helm 4.3.x (4.3.2) · Kubernetes v1.37 · kind v0.33.0

Official documentation and source references

TopicConclusions used in this courseSource (accessed 2026-11-15)
Helm 4 changes overview--atomic → --rollback-on-failure, --force → --force-replace; new installs default to SSA, upgrades and rollbacks keep the original method; kstatus; plugin system (optional Wasm; CLI/getter/postrenderer); post-renderers must be plugins; install OCI by digest; registry login accepts only domains; Chart API v3 is experimentalhelm.sh/docs/overview
helm install / upgrade flags--wait (watcher/hookOnly/legacy; hookOnly when omitted), --timeout default 5m, --server-side, --force-conflicts, --take-ownership, --history-max default 10, --reset-then-reuse-values, --dry-run=client|server, --hide-secret, --skip-schema-validationhelm install · helm upgrade
Exact error messagescannot reuse a name that is still in use; another operation (install/upgrade/rollback) is in progress; has no deployed releases; exists and cannot be imported into the current release: invalid ownership metadata; failed pre-install / pre-upgrade hooks failed; YAML parse error on; parse error at; execution error at; values don't meet the specifications of the schema(s); chart requires kubeVersion; looks like … is not a valid chart repository; no repository definition for; found in Chart.yaml, but missing in charts/ directory; chart reference digest mismatch; current release manifest contains removed kubernetes api(s); release has no %d version; kubernetes cluster unreachable; resource … not ready. status; Flag --atomic has been deprecatedHelm v4.3.2 source code (pkg/action, pkg/engine, pkg/kube, pkg/registry, pkg/downloader, pkg/cmd)
Hooksphases, weights, deletion policies (default before-hook-creation if unset), helm.sh/hook-output-log-policyChart Hooks · source pkg/release/v1/hook.go
CRDcrds/ install only; not upgraded or deletedCRD best practices
OCIpush/pull; in tags + → _Registries · source pkg/registry/reference.go
Schemavalues.schema.json; Helm 4.3 uses santhosh-tekuri/jsonschema v6Schema Files · source pkg/chart/common/util/jsonschema.go
Removed APIshelm-mapkubeapis, manually rewriting release recordsDeprecated Kubernetes APIs
Server-Side ApplyField managers, conflicts and forceKubernetes docs
Argo CD / FluxArgo CD renders then applies, with hook mapping; Flux helm-controller uses the Helm SDK, remediationArgo CD Helm · Flux HelmRelease
ACR / ECR / AKS / EKSACR Helm OCI, ECR pushes require pre-created repositories, kubelogin, EKS access entriesACR · ECR · kubelogin · EKS access entries

Video verification notes

All videos were verified on 2026-11-15 via the YouTube oEmbed endpoint (https://www.youtube.com/oembed?url=…&format=json) to verify titles and channels; oEmbed does not return durations or publish dates, so these are not shown. Verified: TechWorld with Nana “What is Helm in Kubernetes? Helm and Helm Charts explained | Kubernetes Tutorial 23” (-ykwb1d0DXU), “ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes” (MeU5_k9ssrs); DevOps Hint “How to use helm lint, helm –debug –dry run, and helm template | How to Troubleshoot Errors in Helm” (5tHWBVbNmq0); Rahul Wagh “Helm Upgrade Command | How to use Helm Upgrade Command - Part 12” (6ua2LBzPfxo), “Complete Helm Chart Tutorial: From Beginner to Expert Guide” (DQk8HOVlumI); SP Nexa DevOps “Helm Charts Kubernetes Release Lifecycle: Upgrade, Rollback & Dependencies | Part 6” (5XnEK_aPl-U); That DevOps Guy “Introduction to Helm | Kubernetes Tutorial | Beginners Guide” (5_J7RWLLVeQ); Akuity “How to Use Private OCI Helm Repositories in Argo CD” (Hn4pgrySYRU); Terry Howe “Helm with oras-go v3 Demo Mirroring and Blocking Registries” (3yPa6mz0nas); IBM Technology “What is Helm?” (fy8SHvNZGeE); KodeKloud “What is Helm? | Helm Concepts Explained | KodeKloud” (kJscDZfHXrQ); DevOps Journey “How to Create Helm Charts - The Ultimate Guide” (jUYNS90nq8U), “Helm and Helm Charts Explained - Helm Tutorial for Beginners” (w51lDVuRWuk); CNCF “Building Helm Charts From the Ground Up: An Introduction to Kubernetes [I] - Amy Chen, Heptio” (vQX5nokoqrQ); Anton Putra “AWS Load Balancer Controller Tutorial (TLS): AWS EKS Kubernetes Tutorial - Part 6” (5XpPiORNy1o); Containers from the Couch “EKS Pod Identity vs IRSA | Securely Connect Kubernetes Pods to AWS Services” (aUjJSorBE70); Jon Gallant “Connect to Azure from a GitHub Action with OpenID Connect (OIDC)” (IKuw9T6vZYU); Microsoft Developer “Introduction to External Secrets - Secrets Operator for Kubernetes” (2FOB49oXts8); DevOps & AI Toolkit “Manage Kubernetes Secrets With External Secrets Operator (ESO)” (SyRZe5YVCVk). Most of these videos are based on Helm 3; for Helm 4 parameters and behavior, refer to this course and helm.sh. No verified videos specifically covering Helm production troubleshooting, Helm 4 migration, or Helm interview questions were found; the related pages provide storyboard scripts instead.

Voice notes

The “Voice” page uses the browser’s built-in Web Speech API and uploads no data. A Chinese (zh-CN) voice pack must be installed on the system; without one, you can read the script directly.

Known limitations

  • Helm’s own error strings were checked against the Helm v4.3.2 source; the outer wrapping and the format for merged multiple errors (for example 1 error occurred:) and the parts from the Kubernetes API server, client-go, registry, cloud services (Entra, ECR) and Flux/Argo CD may change between versions; entries are marked “wording varies by version”. Helm 3’s older wording (such as cannot re-use a name…,rendered manifests contain a resource that already exists,timed out waiting for the condition) is also listed to make searching easier.
  • All “sample output” is illustrative; names, digests, and times differ from your environment; reproduction labs are written from the Helm 4.3 docs and source,not actually run in this environment,helm create Generated template details (line numbers, indentation, whether httproute.yaml is included) vary slightly by version; the labs already give manual adjustment hints.
  • Conservatively handled details (official docs are authoritative): Helm 4’s readiness judgments for specific resource types; the exact error when a hook conflicts with an existing object in SSA mode; Helm 4-compatible versions of plugins such as helm-mapkubeapis and helm-diff; the plugin.yaml fields of the Helm 4 postrenderer plugin; ACR refresh token lifetime; Flux’s status message after retries are exhausted and the CLI reset command; current version numbers of tools such as chart-testing, helm-unittest, and cosign (versions not hard-coded).
  • Mock interview self-ratings are stored only in the current browser’s localStorage and are lost when site data is cleared.