Helm Hour 7: Deep Troubleshooting, Optimization and Advanced Topics

Break every Helm operation down into observable layers: why a release gets stuck in pending-upgrade, why a hook “fails with no logs”, who is grabbing fields in an SSA conflict, why a release Secret exceeds 1 MiB, and the pitfalls that CI scripts hit when migrating from Helm 3 to Helm 4
Helm v4.3.2Kubernetes v1.37kind v0.33.0Verified against v4.3.2 sourceHelm 3 security fix cutoff 2027-02-10
Overall learning goals
  • By the seven-layer model (chart fetch → values merge → template rendering → API validation → apply → wait → release record) to locate any Helm error and skillfully use --debug,helm template --debug,--dry-run=server,helm get all,helm get metadata and kubectl get events.
  • Explain pending-install/pending-upgrade/pending-rollback 's real causes (process killed by SIGKILL, CI timeout, network interruption), and understand another operation (install/upgrade/rollback) is in progress, and safely recover (roll back to the last deployed revision; delete the release Secret only as a last resort).
  • Diagnose hook Job failures and timeouts, and understand hook-delete-policy why it “deletes the evidence”, and use Helm 4's helm.sh/hook-output-log-policy print hook logs to output, and know the risks of --no-hooks .
  • Master server-side apply (SSA) field ownership: a fresh Helm 4 install defaults to SSA, while a release migrated from Helm 3 still defaults to client-side apply (CSA); understand Apply failed with 1 conflict, and use managedFields Identify the “field-grabbing” manager, and use correctly --force-conflicts and --server-side.
  • Use fail/required write readable errors, debug templates by printing intermediate values, and understand lookup how it behaves under various dry-runs, and the sources of rendering time for large charts.
  • Understand release storage (Secret driver, gzip+base64, 1 MiB limit,--history-max default of 10, SQL driver), and can handle “release too large”.
  • Complete one Helm 3 → Helm 4 Migration Assessment: parameter renames,--wait semantic changes, post-renderer plugin conversion, plugin signature verification, GitOps tool compatibility; output an actionable checklist.

1-Hour Time Allocation Table

#TimeModuleCore ContentAnimation / InteractionLab (kind cluster lab, namespace faults)
0Pre-classPrep: Fault Injection EnvironmentCreate the faultbox chart (toggleable hook Job, CRD, values switches) and deploy the release fbEnvironment self-check checklistDeploy baseline revision 1
100–06Troubleshooting Methodology and --debugSeven-layer model,--debug,template --debug,--dry-run=server,get all, and eventsError → layer locatorOne chart produces 4 layers of different errors
206–14Release Stuck: pending-upgradecauses of the pending state, errPending pessimistic lock, reading history, rollback recovery, risks of deleting the SecretCore animation: causes and recovery of pending-upgradekill -9 an upgrade running with --wait, and recover
314–21Hook Failures and Timeoutshook Job failure, delete-policy deleting evidence, output-log-policy,--timeout,--no-hooksHook policy combination simulatorFailed pre-upgrade migration Job
421–29SSA and Field Ownership ConflictsmanagedFields, conflict determination,--force-conflicts,--server-side=auto/true/false, and Helm 3-migrated releaseCore animation: SSA field conflict determinationkubectl patch grabbing a field → conflict → two fixes
529–36Template Debugging and Rendering Performancefail/required, printing intermediate values,-s, rendering time,lookup and dry-runrequired/fail validators + lookup behavior tableWrite defensive templates + timing
636–43Release Storage, Size and CleanupSecret driver, 1 MiB,--history-max, SQL driver,--keep-historyrelease size calculatorCreate an oversized release and fix it
743–52Migrating from Helm 3 to Helm 4rename parameters,--wait, SSA default, post-renderer plugin, Wasm plugins and signatures, CI/GitOps checklistCI script migration scannerHelm 3 vs Helm 4 side-by-side comparison
852–60Mixed Fault Blind Box8 fault types injected at random, diagnosed, and fixedIn-browser fault simulator + interactive troubleshooting treefault-box.sh random injection
—Post-classCheat Sheet · Comprehensive LabDiagnose and fix the 8 faults one by one + output a Helm 3→4 migration checklistFinal quiz (12 questions)Comprehensive Lab

Knowledge Coverage Matrix

Target skillsM1M2M3M4M5M6M7M8Key commandsLab
Locate Helm errors by layer✓✓✓✓✓✓·✓--debug,get allM1 four-layer errors
release state machine and recovery·✓✓··✓·✓history,rollbackkill -9 lab
hook failure·✓✓····✓get hooks,kubectl logs job/…Failed migration Job
SSA and field ownership···✓··✓✓--force-conflicts,--show-managed-fieldsfield-grabbing lab
Template Debugging and Performance✓···✓··✓template --debug -sDefensive templates
release storage and size·✓···✓·✓kubectl get secret -l owner=helm1 MiB lab
Immutable fields and CRDs✓··✓···✓--force-replace,kubectl apply --server-sideSelector / CRD failures
Helm 3 → 4 migration···✓··✓✓--rollback-on-failure,--wait=watcherside-by-side comparison + checklist

Content not covered in this lesson (and where to learn it)

TopicWhy it's not in this lessonWhere to learn
Basic Helm commands, values precedence, OCI distributionIntroductory contentLesson 1 · Helm 4 introduction in Lesson 6 of the Kubernetes course
template syntax, helpers, schema, dependencies, lint/testBasics of writing chartsLesson 2
hook execution order and weights, chart-testing, GitOps HelmRelease reconciliationthis lesson only covers what to do when they failLesson 5,Lesson 6
Pod-level troubleshooting (CrashLoopBackOff, scheduling, probes)belongs to Kubernetes itselfKubernetes course
50 production problems, 50 interview questionsLesson 8 (optional)Lesson 8

How to Use This Courseware

10 pages per module
Theory · Diagrams · Animations · Commands · Labs · Production Cases · Troubleshooting · Quizzes · Audio · Video. All labs in this lesson run in the kind cluster lab 's namespace faults , and each lab is “inject → observe → diagnose → fix → reset”.
Learning Progress
A quiz score ≥ 70%, or clicking “Mark this module complete”, counts toward progress. Progress is saved in this browser (cleared on refresh when local storage is disabled).
Chinese Audio
The “Audio” page reads the lecture script aloud with the browser Web Speech API (en-US); English terms are pronounced with en-US. The lecture script remains readable even without a Chinese voice pack.
Version Notes This lesson is based on Helm v4.3.2 (2026-11-13) as the baseline; the state machine, error messages and parameter names are verified against the v4.3.2 source (pkg/action,pkg/cmd,pkg/storage/driver,pkg/kube). Helm 3's last feature release, 3.22, was published on 2026-09-09,with security fixes continuing until 2027-02-10 (Helm official blog; originally 2026-11, since extended). In this lesson, “Helm 3 behavior” refers to version 3.22 and earlier. Times, hashes, IPs and durations in sample output are example values.

Module 0 · Prep: Fault Injection Environment

Create a chart designed to be “broken” in the kind cluster lab: faultbox. All faults are injected through values switches or scripts, and can be reset at any time
Pre-class ≈ 10 minutesHelm 4.3.2 · kind v0.33.0Local lab, zero cost
Prerequisites
  • Lessons 1–6 completed: installed Helm 4 (get-helm-4 script or package manager), a kind cluster lab (node image kindest/node:v1.37.0), kubectl 1.37. The myapp chart is still in ~/helm-lab/myapp, but this lesson does not inject faults into myapp, instead creating a new faultbox so as not to break the results of your earlier lessons.
  • Connection to the previous lesson: Lesson 6 covered hook execution order and weights, and helm test; Module 3 of this lesson directly covers diagnosing hooks that fail. The GitOps tools from Lesson 5 (Argo CD v3.6.1 / Flux v2.10.0) appear in Modules 4 and 7 as “another field manager”.
  • Optional: Helm 3.22 binary (for the side-by-side comparison in Module 7), installed at ~/bin/helm3,do not overwrite Helm 4.

Step 1: Check tools and cluster

helm version --short
kind get clusters
kubectl config use-context kind-lab
kubectl get nodes
kubectl create namespace faults
v4.3.2+g<commit>
lab
Switched to context "kind-lab".
NAME                STATUS   ROLES           AGE   VERSION
lab-control-plane   Ready    control-plane   6d    v1.37.0
namespace/faults created

If you do not have a cluster yet: kind create cluster --name lab --image kindest/node:v1.37.0.

Step 2: Generate the faultbox chart and add “fault switches”

mkdir -p ~/helm-lab && cd ~/helm-lab
helm create faultbox
# Append fault switches (coexists with the defaults generated by helm create)
cat >> faultbox/values.yaml <<'EOF'

# ===== Lesson 7 fault switches =====
hook:
  enabled: false          # Module 3: pre-upgrade migration Job
  fail: false             # true = Job fails with exit code 1
  sleep: 2                # Job run time in seconds (used to simulate a timeout)
  deletePolicy: before-hook-creation
  outputLogPolicy: ""     # Helm 4: hook-failed / hook-succeeded
widget:
  enabled: false          # Module 8: use the CRD in crds/
  color: ""
blob:
  enabled: false          # Module 6: render a large file into a ConfigMap
EOF
{{- if .Values.hook.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
  name: {{ include "faultbox.fullname" . }}-migrate
  labels:
    {{- include "faultbox.labels" . | nindent 4 }}
  annotations:
    "helm.sh/hook": pre-upgrade
    "helm.sh/hook-weight": "0"
    "helm.sh/hook-delete-policy": {{ .Values.hook.deletePolicy | quote }}
    {{- with .Values.hook.outputLogPolicy }}
    "helm.sh/hook-output-log-policy": {{ . | quote }}
    {{- end }}
spec:
  backoffLimit: 0
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: migrate
          image: busybox:1.37
          command:
            - sh
            - -c
            - |
              echo "migrating schema to revision {{ .Release.Revision }}"
              sleep {{ .Values.hook.sleep }}
              {{- if .Values.hook.fail }}
              echo 'ERROR: relation "orders" already exists' >&2
              exit 1
              {{- else }}
              echo "migration done"
              {{- end }}
{{- end }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: widgets.lab.example.com
spec:
  group: lab.example.com
  names: {kind: Widget, plural: widgets, singular: widget}
  scope: Namespaced
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                size: {type: integer}
{{- if .Values.widget.enabled }}
apiVersion: lab.example.com/v1
kind: Widget
metadata:
  name: {{ include "faultbox.fullname" . }}
spec:
  size: 3
  {{- with .Values.widget.color }}
  color: {{ . | quote }}
  {{- end }}
{{- end }}

Step 3: Deploy the baseline release fb

cd ~/helm-lab
helm lint faultbox
helm upgrade --install fb ./faultbox -n faults --wait --timeout 3m
helm history fb -n faults
helm get metadata fb -n faults | grep -E 'STATUS|APPLY_METHOD'
kubectl -n faults get secret -l owner=helm,name=fb
==> Linting faultbox
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, 0 chart(s) failed
Release "fb" does not exist. Installing it now.
NAME: fb
...
STATUS: deployed
REVISION: 1
REVISION  UPDATED                   STATUS    CHART           APP VERSION  DESCRIPTION
1         Mon Nov 16 09:02:11 2026  deployed  faultbox-0.1.0  1.16.0       Install complete
STATUS: deployed
APPLY_METHOD: server-side apply
NAME                       TYPE                 DATA   AGE
sh.helm.release.v1.fb.v1   helm.sh/release.v1   1      12s
Remember these three observation points: ① the STATUS and DESCRIPTION columns of① helm history ; ② helm get metadata 's APPLY_METHOD (on a fresh Helm 4 install = server-side apply); ③ the name of the release Secret sh.helm.release.v1.<release>.v<revision> and its labels owner=helm,name=…,status=…,version=…. Every diagnosis in this lesson comes back to these three points.

Step 4 (optional): Install Helm 3.22 for side-by-side comparison

# For the latest 3.22 patch number, refer to https://github.com/helm/helm/releases; v3.22.0 is used as the example here
mkdir -p ~/bin && cd /tmp
curl -fsSLO https://get.helm.sh/helm-v3.22.0-linux-amd64.tar.gz
tar -xzf helm-v3.22.0-linux-amd64.tar.gz && mv linux-amd64/helm ~/bin/helm3
~/bin/helm3 version --short

Warm-up: answer from memory (30 seconds)

Where does Helm store a release's history?

By default it is stored in Secrets in the release's namespace, one per revision, of type helm.sh/release.v1, and named sh.helm.release.v1.fb.vN, whose contents are the release JSON, gzip-compressed and then base64-encoded (including the chart, values, rendered manifest and hooks).

Helm 4's --wait flag: what happens if it is omitted?

The default strategy is hookOnly: it only waits for hook resources to complete, and does not wait for ordinary resources such as Deployments to become ready; writing --wait (with no value) is equivalent to --wait=watcher, using kstatus to determine readiness.

Environment self-check checklist

Module 1 · Troubleshooting Methodology and --debug

00:00 – 06:00 · Every Helm error occurs at one of the seven layers. Determine the layer first, then choose the tool; this is ten times faster than blindly retrying
6 minutes--debug · --dry-run=server★★★★★
Learning Objectives
  • Name the seven layers of helm upgrade --install : chart fetch → values merge and schema validation → template rendering → API validation → apply (SSA/CSA) → wait (kstatus) → release record.
  • Determine the layer from the error prefix: failed to fetch,values don't meet the specifications,template: …: executing,error validating data,Apply failed with … conflict,not ready. status: InProgress,another operation … is in progress.
  • Skillfully combine --debug,helm template --debug,--dry-run=server,helm get all/manifest/values/hooks/metadata and kubectl get events.
Prerequisites: Lesson 1 upgrade mechanism animation. Importance:★★★★★

What: the seven-layer model

LayerWhat Helm does (v4.3.2 source location)Typical errorsPreferred tool
① Chart fetchResolve a local directory / .tgz / oci:// / repository index; download and load (pkg/downloader,loader.Load)failed to fetch … 401,chart "x" version "y" not found,no cached repo foundhelm pull --debug,helm show chart,helm registry login
② valuesmerge default values, the parent chart,-f,--set; handling --reuse-values; JSON Schema validationvalues don't meet the specifications of the schema(s), type mismatcheshelm get values --all,helm template --debug
③ RenderGo template executes all templates (pkg/engine), post-renderer plugintemplate: faultbox/templates/x.yaml:12:8: executing … nil pointer,error converting YAML to JSONhelm template --debug -s templates/x.yaml
④ API validationbuilds objects and performs OpenAPI validation (strict field validation), checks resource ownershiperror validating data,unknown field,invalid ownership metadata,resource mapping not found--dry-run=server,kubectl explain
⑤ Applywrite pending record → pre hooks → SSA patch / CSA three-way merge (KubeClient.Update)Apply failed with 1 conflict,field is immutable, admission webhook rejection,forbiddenkubectl get events,--show-managed-fields
⑥ Waitaccording to the --wait strategy (hookOnly / watcher / legacy) waits for resources and hooksresource Deployment/faults/fb not ready. status: InProgress + context deadline exceededkubectl rollout status,describe,logs
⑦ release recordmarks the old revision as superseded, marks the new revision as deployed/failed, and writes back to the Secretanother operation (install/upgrade/rollback) is in progress,data: Too long,has no deployed releaseshelm history,kubectl get secret -l owner=helm

Why: why layering is needed

“Deployment failed” is a phrase with no information value. The first three layers occur entirely on the client side, do not change the cluster, and do not produce a revision. Layer ④ is judged by the API Server during a dry-run or a real request. From layer ⑤ onward, the cluster has already been changed and a pending revision record exists, so a “retry” may run into a half-finished leftover from the previous attempt. Layering lets you know immediately: Has the cluster been changed? What state is the release record in? Can I retry directly as the next step?

How: four core tools

  • --debug (or environment variable HELM_DEBUG=true): Helm 4 uses structured logging (slog) and prints a DEBUG log for each step to stderr ("preparing upgrade", "creating upgraded release", "performing update", etc.); when rendering fails, it also prints the manifest that failed.
  • helm template --debug: purely client-side rendering (default --dry-run=client semantics), which prints the rendered output even when the YAML is invalid, making it easy to see which line is broken; combine it with -s templates/x.yaml to look at a single file.
  • helm upgrade --dry-run=server: fully runs layers ①–④ and has the API Server validate via dry-run (including admission webhooks, quotas and immutable fields), but does not write a release record. helm template --validate In Helm 4 it is already marked deprecated, suggesting use of --dry-run=server.
  • helm get all fb --revision N: retrieves the values, manifest, hooks and notes of a given revision in one go; helm get metadata shows the status and APPLY_METHOD.

When: first look at which

appears in the error message template: → layer ③,helm template --debug; when a resource name and is invalid appear → layers ④/⑤,--dry-run=server + kubectl get events; when not ready or context deadline exceeded → layer ⑥, return to Kubernetes troubleshooting; when another operation or has no deployed releases → layer ⑦,helm history.

Comparison with similar tools

helm templateinstall/upgrade --dry-run=client--dry-run=serverhelm diff (plugin)
Connects to clusterNoNoYesYes
lookupReturns empty mapReturns empty mapReturns real objectsDepends on plugin parameters
admission / immutable fieldsNot checkedNot checkedCheckedPartial
Writes release recordNoNoNoNo
Common misconceptions① “--debug will show more Kubernetes events” — no, it only shows Helm's own logs; events must be checked with kubectl. ② “helm template passing means it can be installed” — it does not go through layers ④–⑦. ③ “Just rerun the upgrade if it failed” — if the failure happens after layer ⑤, rerunning may hit the pending lock or an SSA conflict. ④ “--dry-run with no value equals server” — in Helm 4, with no value it equals client, and prints a deprecation warning.

Seven-layer pipeline and the “observation window” of each layer

① Fetchrepo / OCI ② valuesMerge + schema ③ RenderGo template ④ API validationOpenAPI / ownership ⑤ Applyhooks + SSA ⑥ Waitkstatus ⑦ Recordrelease Secret Pure client-side: cluster not modified, no new revision dry-run=server reachable Cluster has been modified; a pending → deployed/failed revision exists Observation window helm pull --debugget values --alltemplate --debug -s--dry-run=serverevents · managedFieldsrollout status · logshistory · get metadata --debug (HELM_DEBUG) runs through all layers: it outputs Helm's structured DEBUG logs to stderrit tells you “how far Helm got”; for what happened on the Kubernetes side, use kubectl events / describe / logs
Figure 1-1 Seven-layer model: errors in the three layers on the left can be retried safely; for errors in the three layers on the right, check the release status first

Decision: error text → layer

Error contains… "template:" / "nil pointer""schema(s)""is invalid" / "unknown field""conflict" / "immutable""not ready" / "in progress" ③ Render → helm template --debug -s② values → get values --all, schema④ API validation → --dry-run=server, kubectl explain⑤ Apply → managedFields, the cost of --force-replace⑥/⑦ → kubectl rollout status / helm history
Figure 1-2 Error keyword → layer → preferred tool

Interactive: error locator

Click a real error to see which of the seven layers it falls in, whether the cluster has already been modified, and the next command to run.

Select an error above.
$ # Suggested diagnostic commands will appear here

Core Commands

CommandLayerDescription
helm upgrade fb ./faultbox -n faults --debugAllDEBUG logs go to stderr; in CI, it is recommended to 2>helm-debug.log and save them as an artifact
helm template fb ./faultbox --debug -s templates/deployment.yaml③output the rendered result even if the YAML is invalid
helm upgrade fb ./faultbox -n faults --dry-run=server①–④server-side dry-run; lookup available; does not write a release; --hide-secret hides Secret contents
helm get all fb -n faults --revision 3⑦the values, hooks, manifest and notes of a revision
helm get values fb -n faults --all②all merged values (without --all only shows the user-supplied ones)
helm get metadata fb -n faults⑦STATUS, REVISION,APPLY_METHOD
helm history fb -n faults⑦STATUS and DESCRIPTION for each revision (failure reasons are written here)
kubectl -n faults get events --sort-by=.lastTimestamp⑤⑥Facts on the Kubernetes side
cd ~/helm-lab
helm upgrade fb ./faultbox -n faults --set replicaCount=2 --debug 2>&1 | grep -E 'level=DEBUG' | head -8
time=2026-11-16T09:10:01Z level=DEBUG msg="preparing upgrade" name=fb
time=2026-11-16T09:10:01Z level=DEBUG msg="performing update" name=fb
time=2026-11-16T09:10:01Z level=DEBUG msg="determined release apply method" ...
time=2026-11-16T09:10:01Z level=DEBUG msg="creating upgraded release" name=fb
...
time=2026-11-16T09:10:03Z level=DEBUG msg="updating status for upgraded release" name=fb

How to verify:helm history Revision 2 deployed appears. Common mistakes: Pasting --debug output directly into a ticket; it may contain the rendered Secret manifest. In CI, store it only as a protected artifact. Production use: automatically run on failure helm history + helm get all + kubectl get events and upload.

Lab 1: One chart, four different layers of errors (about 5 minutes)

③ Render-layer error: references a nested values key that does not exist.
cd ~/helm-lab
helm template fb ./faultbox -s templates/deployment.yaml >/dev/null && echo OK
# Trigger a nil pointer:
printf '{{ .Values.missing.key }}\n' > faultbox/templates/bad.yaml
helm template fb ./faultbox --debug -s templates/bad.yaml
OK
Error: template: faultbox/templates/bad.yaml:1:17: executing "faultbox/templates/bad.yaml" at <.Values.missing.key>: nil pointer evaluating interface {}.key

The error gives file:line:column and the failing expression. After fixing, delete: rm faultbox/templates/bad.yaml.

④ API validation-layer error: valid YAML, but not a valid Deployment.
helm upgrade fb ./faultbox -n faults --set-string replicaCount=two --dry-run=server
Error: UPGRADE FAILED: unable to build kubernetes objects from new release manifest: error validating "": error validating data: ValidationError(Deployment.spec.replicas): invalid type for io.k8s.api.apps.v1.DeploymentSpec.replicas: got "string", expected "integer"

helm history fb -n faults No new revision appears; failures before layer ④ leave no record.

⑥ Wait-layer error: the image does not exist; wait 60 seconds with watcher.
helm upgrade fb ./faultbox -n faults --set image.tag=does-not-exist --wait --timeout 60s
helm history fb -n faults | tail -2
kubectl -n faults get events --sort-by=.lastTimestamp | tail -3
Error: UPGRADE FAILED: resource Deployment/faults/fb-faultbox not ready. status: InProgress, message: <reason given by kstatus>
context deadline exceeded
3   Mon Nov 16 09:14:20 2026  failed  faultbox-0.1.0  1.16.0  Upgrade "fb" failed: resource Deployment/faults/fb-faultbox not ready...
...  Warning  Failed   pod/fb-faultbox-7d9c...  Failed to pull image "nginx:does-not-exist": ... not found

Resource names follow your fullname (the release name fb does not include the chart name, so the fullname is fb-faultbox). Note: revision 3 is failed, and the Deployment in the cluster has already been changed.

⑦ Record layer + reset:
helm get metadata fb -n faults | grep -E 'REVISION|STATUS'
helm rollback fb 2 -n faults --wait
helm history fb -n faults
REVISION: 3
STATUS: failed
Rollback was a success! Happy Helming!
REVISION  ...  STATUS      ...  DESCRIPTION
1              superseded       Install complete
2              superseded       Upgrade complete
3              failed           Upgrade "fb" failed: ...
4              deployed         Rollback to 2

Case 1: CI only printed “UPGRADE FAILED: context deadline exceeded”

Problem: The team reran the pipeline repeatedly; all three attempts timed out. Approach: Judging by layer, this falls under layer ⑥: Helm simply cannot wait for readiness, and the root cause is in the Pod. Added diagnostic steps after failure to the pipeline: kubectl get events,kubectl describe deploy,kubectl logs --previous. Result: Found that the readinessProbe path in the new version was misconfigured. Limitation: Helm 4's kstatus error messages already include the resource name and status, which is more useful than Helm 3's legacy wait, but they still do not include Pod logs.

Case 2: Local template is fine, but the cluster upgrade is rejected

Problem: An Ingress annotation was rejected by a Kyverno policy. Approach: In CI, replace helm template with helm upgrade --dry-run=server, so the admission webhook is triggered at the merge request stage. Limitation: CI needs dry-run permissions beyond cluster read-only (dry-run requests also go through the RBAC create/patch verbs).

Case 3: --debug log leaked a database password

Problem: When rendering failed, --debug printed a manifest containing a Secret, which was captured by the public pipeline logs. Approach: Do not enable --debug in public logs; add --hide-secret for dry-runs; debug output should only be stored as a restricted artifact.

Common errors and fixes

Error: INSTALLATION FAILED: template: x/templates/a.yaml:7:20: executing … nil pointer evaluating interface {}.port

Layer:③. Cause: Accessed a nested key that does not exist. Diagnosis:helm template --debug -s templates/a.yaml, then helm get values --all check the actual values. Fix: Use dig,default dict or required (Module 5).

Error: UPGRADE FAILED: unable to build kubernetes objects from new release manifest: resource mapping not found for name: "x" namespace: "" from "": no matches for kind "Widget" in version "lab.example.com/v1"

Layer:④. Cause: The CRD does not exist (or it is placed in templates/ and created in the same batch as the CR). Diagnosis:kubectl get crd | grep widgets,kubectl api-resources | grep -i widget. Fix: Install the CRD first (the crds/ directory or a separate chart), and protect the CR with .Capabilities.APIVersions.Has .

Error: UPGRADE FAILED: … invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"

Layer:④ (resource ownership check). Cause: A resource with the same name already exists in the cluster but was not created by this release. Fix: After confirming the resource can be adopted, use --take-ownership (available in Helm 4 install/upgrade), or manually add the annotation meta.helm.sh/release-name,meta.helm.sh/release-namespace and labels app.kubernetes.io/managed-by=Helm.

--dry-run did not trigger lookup / admission, so the result differs from a real install

Cause: In Helm 4, --dry-run with no value equals client (and prints a warning). Fix: explicitly write --dry-run=server.

Error: Kubernetes cluster unreachable: Get "https://127.0.0.1:xxxxx/version": dial tcp … connect: connection refused

Layer: Connectivity check before ④. Diagnosis:kubectl config current-context,echo $KUBECONFIG,helm env | grep KUBE. The ports change after a kind cluster restarts, so re- kind export kubeconfig --name lab.

Command-line exercises
1. Without modifying the cluster, verify whether an upgrade would pass the API Server's admission and field validation, and hide Secret contents.
helm upgrade fb ./faultbox -n faults -f prod.yaml --dry-run=server --hide-secret
2. Retrieve the full values (including defaults) and manifest of revision 3, save them to files, and compare.
helm get values fb -n faults --revision 3 --all > r3-values.yaml
helm get manifest fb -n faults --revision 3 > r3.yaml
helm get manifest fb -n faults --revision 2 > r2.yaml
diff r2.yaml r3.yaml
Scenario analysis
An upgrade reports “context deadline exceeded”, and a colleague suggests increasing --timeout to 30m and retrying. How do you respond?

First determine the layer: this is layer ⑥, where Helm is waiting for resources to become ready. Increasing the timeout only helps when it genuinely takes a long time (rolling many replicas, slow startup). If the Pod is in ImagePullBackOff or CrashLoopBackOff, it will never become ready no matter how long you wait, and a longer timeout just keeps the release in pending-upgrade for longer, increasing the risk of it getting stuck when CI kills the job (Module 2). The correct approach: kubectl get events,describe,logs find the root cause; if necessary, helm rollback; the timeout should be estimated from maxUnavailable, the number of replicas, and startup time.

Verified instructional videos

▶
How to use helm lint, helm –debug –dry run, and helm template | How to Troubleshoot Errors in Helm — DevOps Hint
English · Combined usage of lint, --debug, dry-run and template (recorded in the Helm 3 era; a bare --dry-run equals client in Helm 4)

Official documentation

Video storyboard (about 90 seconds)

Shot 1 · 0–20s
Visual: seven boxes line up from left to right; the left three are blue “client side” and the right three are red “cluster already modified”.
Narration: every helm upgrade passes through seven layers, so first determine which layer the error is in.
Shot 2 · 20–50s
Visual: the error text flies in; the keyword “template:” is highlighted and lands on the third box; “not ready” lands on the sixth box.
Narration: the keywords in an error are the address of the layer.
Shot 3 · 50–75s
Visual: the terminal shows the output differences between helm template --debug and --dry-run=server side by side.
Narration: template renders only locally; dry-run=server also has the API Server check it.
Shot 4 · 75–90s
Visual: in the helm history table, the failed row is circled and the DESCRIPTION column is zoomed in.
Narration: the failure reason is written into the release record; check history first, then decide whether to retry or roll back.
or score ≥ 70% in the “Quiz”

Module 2 · Release Stuck: pending-install / pending-upgrade / pending-rollback

06:00 – 14:00 · The pending state is Helm's “pessimistic lock”: the record is written before the cluster is touched, and if the process cannot finish cleanup, the lock stays in place
8 minutesCore animationerrPending★★★★★
Learning Objectives
  • State the record order of a Helm 4 upgrade: read the last revision → if it is pending, report an error → write a new revision (pending-upgrade, "Preparing upgrade") → hooks → apply → wait → change the old revision to superseded and the new revision to deployed.
  • Distinguish three kinds of interruption: SIGINT/SIGTERM (Helm 4 catches the signal and marks the revision as failed),SIGKILL / node outage / OOM (no time to write, so a pending is left behind),API Server unreachable (write-back fails).
  • Choose the recovery method by state: pending-upgrade/pending-rollback → helm rollback <release> <the last deployed revision>; for a revision 1 pending-install → helm uninstall then reinstall; deleting the release Secret is a last resort, and the risks must be stated clearly.
Prerequisites: Stages ⑤–⑦ of Module 1. Importance:★★★★★

What: the full set of release states (pkg/release/common/status.go)

StateMeaningWritten byDoes it “lock” the next upgrade?
pending-installFirst install in progress; DESCRIPTION is "Initial install underway"install, before creating resourcesYes
pending-upgradeUpgrade in progress; DESCRIPTION is "Preparing upgrade"upgrade, before hooks and applyYes
pending-rollbackRollback in progress; DESCRIPTION is "Rollback to N"rollback, before applyYes
deployedCurrently effective revision (normally only one)When the operation completes successfullyNo
failedOperation failed; DESCRIPTION records the reasonFailure handling / received SIGINT or SIGTERMNo (you can upgrade again directly)
supersededWas deployed, later replaced by a new revisionA successful upgrade/rollbackNo
uninstalling / uninstalledUninstalling / uninstalled but history retained (--keep-history)uninstall—

Why: why the pending record is written first

Helm has no server-side component; it uses the release record itself for concurrency control. The v4.3.2 source pkg/action/upgrade.go 's comments state it plainly: concurrent helm upgrade operations either fail at the step “the last revision is pending” (errPending), or fail with “already exists” when creating a Secret of the same name —this is a pessimistic lock. The cost of the lock: if the process holding it never gets a chance to clean up, the lock is never released.

errPending = errors.New("another operation (install/upgrade/rollback) is in progress")

How: when a pending state is left behind

Interruption methodHelm 4 behaviorResult
Ctrl+C (SIGINT) / SIGTERMhelm upgrade A signal handler is registered: it prints Release fb has been cancelled., cancels the context, and marks the revision as failed (reason context canceled)Not stuck; you can retry or roll back directly
SIGKILL (kill -9), CI runner timeout followed by a forced kill, Pod OOMKilled / evicted, laptop lid closed with network disconnectedThe process has no chance to execute any codepending is left behind permanently
API Server unreachable during cleanup (control plane upgrade, VPN disconnected)Write-back to the Secret failspending may be left behind
Two pipelines upgrading the same release concurrentlythe latecomer reads pending → errPendingnormal protection; waits for the first one to finish

Key amplifiers: --wait and --timeout. When it is not written, --wait (Helm 4 default hookOnly), the pending window is only “hooks + apply”, lasting a few seconds; with --wait --timeout 15m, the pending window lasts up to 15 minutes. If the CI job's own timeout is 10 minutes, the job is killed before Helm finishes cleanup,almost certainly leaving a pending-upgrade behind. Rule: the CI job timeout must be clearly greater than Helm's --timeout (including hook time).

When: how to recover

  1. First confirm that no other process is actually running: check whether CI has a job for the same release,kubectl get secret -l owner=helm,name=fb,status=pending-upgrade 's creation time (label createdAt) to see whether it was a long time ago.
  2. helm history fb Find the last deployed revision N.
  3. helm rollback fb N --wait Note: rollback does not check the pending state. It creates a new revision (pending-rollback → deployed), and applies using the manifest of the pending revision as the “current” and the manifest of N as the “target”, so partially applied changes are reverted too. Afterwards the old pending revision remains in the history (until it is cleaned up by --history-max ), which does not affect later operations.
  4. For revision 1's pending-install there is no version to roll back to: helm uninstall fb then reinstall (or helm install --replace applies only to failed/uninstalled, not pending).
  5. Last resort: delete the pending Secret (sh.helm.release.v1.fb.v5). Risks: resources created by that revision are no longer recorded by any revision (they may later become orphans or cause ownership conflicts on the next upgrade); accidentally deleting the deployed revision makes Helm lose the “current state”; before the operation, always kubectl get secret … -o yaml > backup.yaml. Changing only the status label on the Secret does not work— Helm reads the release object encoded in the Secret data.
Common misconceptions① “helm rollback fb (without a revision) always returns to the last good version” — it actually goes to “current revision − 1”; if that one failed, you get back its failed configuration. In production, always specify the revision. ② “--rollback-on-failure (originally --atomic) prevents getting stuck” — it only takes effect while the Helm process is alive; SIGKILL still leaves a pending behind. ③ “pending times out and is released automatically” — no, nothing will change it. ④ “Deleting the Secret is the standard fix” — rollback is; deleting the Secret loses the audit record.

Record sequence of an upgrade (v4.3.2)

helm processrelease Secret (storage)Cluster resources Last(fb) → v4 deployed (if pending → errPending) Create v5: pending-upgrade "Preparing upgrade" pre-upgrade hooks → SSA apply v5 manifest --wait: kstatus observes until Current or --timeout ⚡ SIGKILL during this stage → v5 stays pending-upgrade forever after post hooks: Update v4 → superseded Update v5 → deployed "Upgrade complete"
Figure 2-1: the v5 record is written before the cluster is touched; the “lock” is released only in the final two steps

Recovery decision

another operationis in progress Is a process really still running?CI job / createdAt label Yes Wait for it to finish; do not touch it No pending-upgrade / rollbackFind last deployed = N in historyhelm rollback fb N --wait v1 pending-installhelm uninstall fbFix the root cause, then reinstall Last resortBack up, then delete the pending SecretRisks: orphaned resources, audit gaps
Figure 2-2: first confirm there is no concurrency, then choose the recovery path based on the state

Core animation: causes and recovery of a release stuck in pending-upgrade

Three swim lanes: the helm process in CI, the release Secret in the namespace, and the Deployment in the cluster. Click “Next step” to step through; switch “Interruption method” to compare SIGKILL with SIGTERM.

① helm process (CI job)
Idle
② release Secret
③ Deployment fb-faultbox
image nginx:1.16.0 · 2/2 Ready
Ready: v4 is deployed. Click “Next step” to start one helm upgrade --wait --timeout 10m.
$ helm history fb -n faults

Core commands

CommandPurpose
helm history fb -n faultsSTATUS, CHART and DESCRIPTION for each revision; --max default 256; -o json convenient for scripting
helm list -n faults --pending / --failed / -Afilter stuck or failed releases (without a status argument,helm list shows the latest revision of each release, regardless of status)
kubectl -n faults get secret -l owner=helm,name=fb -L status,version,createdAtinspect the storage layer directly: each revision's status label and creation time (Unix seconds)
helm rollback fb 4 -n faults --wait --timeout 5mreturn to the manifest and values of revision 4, creating a new revision
helm uninstall fb -n faultsThe way out for pending-install
helm history fb -n faults -o json | jq '[.[]|select(.status=="deployed")][-1].revision'find the last deployed revision in the script
# One-click diagnosis function, which can go into the CI failure step
helm_stuck() {
  local rel=$1 ns=$2
  helm history "$rel" -n "$ns" --max 5
  kubectl -n "$ns" get secret -l owner=helm,name="$rel" -L status,version,createdAt \
    --sort-by=.metadata.creationTimestamp | tail -5
}
helm_stuck fb faults
REVISION  UPDATED                   STATUS           CHART           APP VERSION  DESCRIPTION
3         Mon Nov 16 09:14:20 2026  failed           faultbox-0.1.0  1.16.0       Upgrade "fb" failed: ...
4         Mon Nov 16 09:16:02 2026  deployed         faultbox-0.1.0  1.16.0       Rollback to 2
5         Mon Nov 16 09:30:41 2026  pending-upgrade  faultbox-0.1.0  1.16.0       Preparing upgrade
NAME                       TYPE                 DATA   AGE   STATUS            VERSION   CREATEDAT
sh.helm.release.v1.fb.v4   helm.sh/release.v1   1      15m   deployed          4         1763284562
sh.helm.release.v1.fb.v5   helm.sh/release.v1   1      2m    pending-upgrade   5         1763285441

How to verify recovery: The last line is deployed, and helm upgrade no longer reports errPending. Common mistakes: Running rollback while another pipeline is still running, so two processes change resources at the same time.

Lab 2: Deliberately create and recover a pending-upgrade (about 6 minutes)

Start an upgrade that will wait for a long time, then kill -9 (a bad image means --wait never finishes):
cd ~/helm-lab
helm upgrade fb ./faultbox -n faults --set image.tag=does-not-exist --wait --timeout 10m &
HPID=$!
sleep 10
kill -9 $HPID
helm history fb -n faults --max 3
[1]+  Killed                  helm upgrade fb ./faultbox ...
REVISION  ...  STATUS           ...  DESCRIPTION
4              deployed              Rollback to 2
5              pending-upgrade       Preparing upgrade
Observe the “lock”:
helm upgrade fb ./faultbox -n faults --set replicaCount=2
helm list -n faults --pending
Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress
NAME  NAMESPACE  REVISION  UPDATED  STATUS           CHART           APP VERSION
fb    faults     5         ...      pending-upgrade  faultbox-0.1.0  1.16.0

At this point the Deployment in the cluster already uses the bad image (the v5 manifest has been applied), and the Pods of the old ReplicaSet are still serving. This is the “half-finished” state.

Recovery: roll back to the last deployed revision:
LAST=$(helm history fb -n faults -o json | jq '[.[]|select(.status=="deployed")][-1].revision')
echo "rollback to $LAST"
helm rollback fb "$LAST" -n faults --wait --timeout 3m
helm history fb -n faults --max 3
kubectl -n faults get deploy -o wide
rollback to 4
Rollback was a success! Happy Helming!
4   superseded       Rollback to 2
5   pending-upgrade  Preparing upgrade
6   deployed         Rollback to 4
NAME          READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES
fb-faultbox   2/2     2            2           40m   faultbox     nginx:1.16.0

Revision 5 remains in the history but is no longer the “last one”, so the lock is released. Without jq, read the number directly from helm history the output.

Compare with SIGTERM (Helm 4 cleans up gracefully):
helm upgrade fb ./faultbox -n faults --set image.tag=does-not-exist --wait --timeout 10m &
HPID=$!; sleep 10; kill -TERM $HPID; wait $HPID
helm history fb -n faults --max 2
helm rollback fb 6 -n faults --wait
Release fb has been cancelled.
Error: UPGRADE FAILED: context canceled
7   failed   Upgrade "fb" failed: context canceled

Conclusion: if the CI cancel button sends SIGTERM and allows a sufficient grace period, Helm 4 marks the revision as failed instead of leaving the lock behind.

(Optional) pending-install: repeat the first step with a new release name (helm install fb2 … --wait & then kill -9), and then helm upgrade --install fb2 … observe errPending, and use helm uninstall fb2 -n faults to recover.

Case 1: GitLab runner times out after 1 hour, and the Helm --timeout is also 1 hour

Problem: Occasional slow upgrades of a large StatefulSet; after the runner forcibly kills the job, the release is stuck in pending-upgrade, and every subsequent release fails. Approach: Helm --timeout 40m, with the job timeout set to 60m; the failure branch runs helm history and, if pending, automatically helm rollback <last deployed> (prerequisite: a CI resource group ensures only one job runs per release). Limitation: Automatic rollback must assume “no concurrency”; otherwise it will fight with an upgrade that is still running.

Case 2: Argo CD and a manual helm both manage one release

Problem: An engineer manually helm upgrade ran it while the laptop lost its network connection, leaving a pending state; Argo CD uses helm template plus its own sync. It does not read release records, so everything “looks fine”, yet the manual helm keeps reporting errPending. Approach: Make it explicit that a release can have only one manager (GitOps or the helm CLI), and clean up leftover release records.

Case 3: “Ghost” resources appear after deleting a Secret

Problem: To unlock, the pending v12 Secret was deleted directly. The CronJob newly added in v12 had already been created, but v11 does not include it, so later upgrades neither delete nor manage it, and the CronJob keeps running. Approach: Prefer rollback (it uses the v12 manifest as the “current” and will delete the resources v12 added). If the Secret must be deleted, first helm get manifest fb --revision 12 save the manifest and check the newly added resources.

Common errors and fixes

Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress

Cause: The last revision is pending-*. Diagnosis:helm history, the Secret's createdAt labels, and whether CI has concurrent jobs. Fix: After confirming there is no concurrency, helm rollback fb <last deployed>. Prevention: CI timeout > Helm timeout; serialize releases for the same release (resource group / concurrency group); send SIGTERM when cancelling a job.

Error: INSTALLATION FAILED: cannot reuse a name that is still in use

Cause: A release with the same name already has history (including pending-install). --replace The name can be reused only when the final state is failed or uninstalled. Fix: If it already exists, use helm upgrade --install; if stuck in pending-install, helm uninstall.

Error: release has no 0 version

Cause: A rollback without a revision was run on a release that has only revision 1 (target = 1 − 1 = 0). Fix: For pending-install, use uninstall; or specify a revision that exists.

Error: UPGRADE FAILED: "fb" has no deployed releases

Cause: No deployed revision can be found, and the last revision is not failed/superseded (for example, history was manually deleted until only uninstalled remains). Diagnosis:kubectl get secret -l owner=helm,name=fb -L status. Fix: Restore the backed-up Secret, or helm uninstall then use --take-ownership to reinstall and adopt the existing resources.

Changed the Secret's status label to deployed, but Helm still reports in progress

Cause: The label is only used for filtering; Helm decodes data.release to read the state from the release object. Fix: Do not edit it by hand; use rollback.

Command-line exercises
1. List all releases stuck in a pending state across all namespaces.
helm list -A --pending
kubectl get secret -A -l owner=helm -L status | grep pending
2. Roll fb back to revision 4; if it fails, delete the resources newly created by this operation, and write up an explanation.
helm rollback fb 4 -n faults --wait --timeout 5m --cleanup-on-fail --description "unlock after runner kill"
Scenario analysis
Early-morning release: the pipeline shows “Job cancelled”, and after that every retry reports another operation is in progress. The on-call colleague is about to delete all helm Secrets and reinstall. How do you handle it?

Stop the “delete all Secrets” plan: it would lose all history, and a reinstall could still hit ownership conflicts because the resources already exist. Steps: ① confirm no other job is running; ② helm history find the pending revision and the last deployed N; ③ kubectl get deploy,sts -o wide inspect the half-finished state; ④ helm rollback fb N --wait; ⑤ review whether the cancel sent SIGKILL, whether the CI timeout was less than the Helm timeout, and whether a serialization lock is needed.

Verified instructional videos

▶
Helm Charts Kubernetes Release Lifecycle: Upgrade, Rollback & Dependencies | Part 6 — SP Nexa DevOps
English · demonstration of the upgrade / rollback / history lifecycle; does not specifically cover pending getting stuck
▶
Helm Upgrade Command | How to use Helm Upgrade Command - Part 12 — Rahul Wagh
English · explanation of helm upgrade parameters (Helm 3 era)

No verified video specifically covering pending-upgrade getting stuck and its recovery was found; please refer to this module's animation and storyboard.

Official documentation

Video storyboard (about 90 seconds)

Shot 1 · 0–20s
Visual: the helm process writes a yellow card “v5 pending-upgrade”, with a lock hanging from the card.
Narration: before touching the cluster, Helm first writes a pending record; that is its lock.
Shot 2 · 20–45s
Visual: the progress bar is in the “waiting for readiness” stage; the CI timer hits its limit first, and a lightning bolt cuts the process down.
Narration: if the process is force-killed, it has no chance to change the record to deployed or failed.
Shot 3 · 45–65s
Visual: a second pipeline hits the lock, and “another operation is in progress” pops up.
Narration: the next upgrade reads the last record as pending and rejects it outright.
Shot 4 · 65–90s
Visual: the helm history table; a finger points to v4, the last deployed; helm rollback produces a green v6.
Narration: find the last deployed version, roll back to that revision, and the lock is released.
or score ≥ 70% in the “Quiz”

Module 3 · Hook Failures and Timeouts

14:00 – 21:00 · When a hook fails, the biggest enemy is often not the error itself but the fact that “the evidence has already been deleted”
7 minuteshook-output-log-policy--no-hooks is risky★★★★☆
Learning Objectives
  • Understand how a hook failure affects the release: if a pre-* hook fails, resources are not applied and the revision is marked failed; if a post-* hook fails, resources have already been applied and the revision is still marked failed.
  • Understand the three deletion policies before-hook-creation (default),hook-succeeded,hook-failed and their relation to diagnostic capability; use helm.sh/hook-output-log-policy to have Helm print the hook Pod logs to stderr.
  • Set correctly --timeout (for each individual Kubernetes operation, including waiting for each hook) and the Job's backoffLimit/activeDeadlineSeconds; understand --no-hooks the consequences of skipping a migration.
Prerequisites:Lesson 6 hook execution order and weights. Importance:★★★★☆

What: where hooks sit in an upgrade

The order of an upgrade in v4.3.2: write pending record → pre-upgrade hooks (ascending by weight, same weight by name) → apply resources → wait (if --wait) → post-upgrade hooks → finalization. Each hook resource is created (not updated), then Helm waits for it to “complete”: a Job must finish successfully, a Pod must reach Succeeded, and other kinds are considered complete once created.

Failure pointCluster staterelease recordError prefix
pre-upgrade hookRegular resources Unchangedfailedpre-upgrade hooks failed: …
post-upgrade hookRegular resources Already on the new versionfailedpost-upgrade hooks failed: …
hook resource creation failed (for example, a Job with the same name already exists)Unchangedfailedwarning: Hook pre-upgrade … failed: … already exists

Why: the deletion policy determines whether you can still see logs

hook-delete-policyWhen to deleteCan you still kubectl logs after failure?
before-hook-creation (default when no annotation is set)Before the next creation of a hook with the same nameYes, until the next upgrade
hook-succeededAfter the hook succeedsYes (failed ones are not deleted)
hook-failedAfter the hook failsNo— the evidence is deleted immediately
hook-succeeded,hook-failedRegardless of success or failureNo

Helm 4 provides helm.sh/hook-output-log-policy annotation (accepted values hook-succeeded,hook-failed; multiple values can be combined with commas): for Jobs (selecting Pods by job-name=<hook name> ), and for Pod-type hooks, Helm, after determining success or failure and before executing the deletion policy, it writes the container logs to stderr. This makes “hook-failed deletion plus logs still available” possible.

How: how timeouts are calculated

  • --timeout (default 5m) is the waiting limit for “any single Kubernetes operation”: each hook separately waits at most this long, and resource readiness waits also take at most this long. So an upgrade with 3 pre-upgrade hooks has a worst case of ≈ 3×timeout + the apply wait.
  • The Job's default backoffLimit: 6, so failed Pods are retried with exponential backoff at 10s, 20s, 40s…; a migration Job that is certain to fail may take several minutes before it is marked Failed, often hitting --timeout, which shows up as a timeout rather than a failure. For migration-type hooks, it is recommended to set backoffLimit: 0 to 0 or 1, and set activeDeadlineSeconds.
  • In Helm 4, when --wait is not written, the default is hookOnly: hooks are still waited for, but ordinary resources are not.

When: the risks of --no-hooks

--no-hooks Skip this operation's all hooks (install/upgrade/rollback/uninstall all have this flag). It suits emergencies where the hook itself is buggy and skipping it has been confirmed safe. Risks: database migrations are not executed, so the new version connects to the old schema; pre-delete cleanup (for example, deregistering external DNS or deleting cloud resources) is not executed and leaves residue; post-install initialization does not run. After use, the hook's work must be done manually and recorded in the change log.

Common misconceptions① “After a hook fails, Helm automatically rolls back resources” — no, unless you use --rollback-on-failure; when a post hook fails, resources are already on the new version. ② “A hook Job will be helm uninstall removed along with the release”—hook resources are not part of the release manifest, so uninstall does not delete them; they are handled only by the deletion policy. ③ “--timeout is the total duration of the whole command” — it is the upper limit for a single operation. ④ “A hook is updated by upgrade” — hooks are always treated as “newly created”; an old Job with the same name that was not deleted will report immutable / already exists, or may even be misjudged as successful (see the troubleshooting page).

Hook lifecycle and the “evidence window”

Delete old hook with the same namebefore-hook-creation Create JobSSA / create Wait for completion≤ --timeout Output logsoutput-log-policy Delete per policysucceeded / failed Evidence window: the period during which kubectl logs job/… is available (with the hook-failed policy, it ends at the moment of failure) pre-upgrade failedRegular resources unchanged · revision = failedAfter fixing the hook, you can re-upgrade directly post-upgrade failedRegular resources already on the new version · revision = failedDecision: fix the hook and rerun, or roll back
Figure 3-1: log output happens before deletion; this is why output-log-policy can “rescue the evidence”

Interactive: hook policy combination simulator

Choose the deletion policy, log policy, Job behavior and timeout, then click “Run helm upgrade” to see Helm's output, the release state, and what evidence is still available afterwards.

$ helm upgrade fb ./faultbox -n faults --set hook.enabled=true
Results will appear here.

Core commands

CommandPurpose
helm get hooks fb -n faults --revision NView the hook manifest rendered for this revision (including annotations)
helm status fb -n faultsDESCRIPTION contains the hook failure reason; test hooks show as TEST SUITE
kubectl -n faults get jobs,pods -l job-name=fb-faultbox-migrateWhether the hook Job and Pod still exist
kubectl -n faults logs job/fb-faultbox-migrateJob logs (while the Job exists)
kubectl -n faults get events --field-selector involvedObject.kind=JobAfter the Job is deleted, events (kept for about 1 hour by default) may still be there
helm upgrade … --timeout 10mWaiting limit for a single operation (each hook)
helm upgrade … --no-hooksSkip all hooks (risks are explained on the Theory page)
annotations:
  "helm.sh/hook": pre-upgrade
  "helm.sh/hook-weight": "0"
  "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
  "helm.sh/hook-output-log-policy": hook-failed

Meaning: deletes on success; on failure, keeps the Job for investigation and Helm immediately prints the logs to stderr (visible in the CI log); cleans up the old Job before the next upgrade to avoid already exists.

Lab 3: Failed pre-upgrade migration Job (about 6 minutes)

Create a failure with “no evidence”:
cd ~/helm-lab
helm upgrade fb ./faultbox -n faults --set hook.enabled=true,hook.fail=true \
  --set hook.deletePolicy=hook-failed --timeout 2m
kubectl -n faults get jobs
helm history fb -n faults --max 1
Error: UPGRADE FAILED: pre-upgrade hooks failed: resource Job/faults/fb-faultbox-migrate not ready. status: Failed, message: ...
No resources found in faults namespace.
REVISION  ...  STATUS  ...  DESCRIPTION
9              failed       Upgrade "fb" failed: pre-upgrade hooks failed: ...

The Job was deleted by the hook-failed policy,kubectl logs so there is nothing to go on; you can only rely on luck to check the events.

The same failure, with output-log-policy added:
helm upgrade fb ./faultbox -n faults --set hook.enabled=true,hook.fail=true \
  --set hook.deletePolicy=hook-failed --set hook.outputLogPolicy=hook-failed --timeout 2m
migrating schema to revision 10
ERROR: relation "orders" already exists
Error: UPGRADE FAILED: pre-upgrade hooks failed: ...

The evidence goes to Helm's stderr, and therefore into the CI log.

Policy for keeping the failure scene:
helm upgrade fb ./faultbox -n faults --set hook.enabled=true,hook.fail=true \
  --set hook.deletePolicy='before-hook-creation\,hook-succeeded' --timeout 2m
kubectl -n faults logs job/fb-faultbox-migrate
kubectl -n faults get deploy fb-faultbox -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'
migrating schema to revision 11
ERROR: relation "orders" already exists
nginx:1.16.0

Note: --set commas in the value need escaping \,. The Deployment image did not change: the pre-upgrade hook failed, so regular resources were not applied.

Timeout vs failure: make the Job hang for 200 seconds, with a 60-second timeout.
helm upgrade fb ./faultbox -n faults --set hook.enabled=true,hook.sleep=200 \
  --set hook.deletePolicy=before-hook-creation --timeout 60s
Error: UPGRADE FAILED: pre-upgrade hooks failed: resource Job/faults/fb-faultbox-migrate not ready. status: InProgress, message: ...
context deadline exceeded

The Job is still running (Helm just stops waiting); it may succeed later, but this revision is already failed.

Fix and reset:
helm upgrade fb ./faultbox -n faults --set hook.enabled=true,hook.fail=false --timeout 2m
helm history fb -n faults --max 1
# Reset to the baseline without hooks
helm upgrade fb ./faultbox -n faults --reset-values
kubectl -n faults delete job -l app.kubernetes.io/instance=fb --ignore-not-found

Case 1: The migration Job failed, but there is nothing at all in the pipeline logs

Problem: To “keep the cluster clean”, the chart author wrote hook-succeeded,hook-failed, and every failure left nothing to investigate. Approach: Changed to before-hook-creation,hook-succeeded + hook-output-log-policy: hook-failed; the migration Job sets backoffLimit: 0,activeDeadlineSeconds: 900, and Helm --timeout 20m. Limitation: output-log-policy only applies to hooks of Job and Pod type.

Case 2: Using --no-hooks to “bypass” a failed migration

Problem: The on-call engineer used --no-hooks to ship the release; ten minutes later the new version was returning many 500s because a database column was missing. Approach: Roll back the application version; fix the migration script; and in the release standard, list --no-hooks as an operation requiring approval. Lesson: A hook carries business prerequisites; skipping it is the same as skipping a deployment step.

Case 3: A post-install hook runs repeatedly in GitOps

Problem: Argo CD does not run Helm hooks; instead, it maps hook annotations to its own sync hooks (PreSync/PostSync). Some semantics (such as post-install running only on the first install) cannot be mapped one-to-one, so the initialization Job runs on every sync. Approach: Compare against the Helm hook mapping table in the Argo CD documentation, and make the Job idempotent. Limitation: For mapping details, refer to the Argo CD v3.6 documentation.

Common errors and fixes

Error: UPGRADE FAILED: pre-upgrade hooks failed: … status: Failed

Diagnosis:kubectl logs job/<hook>; when the Job has been deleted, check kubectl get events, and check helm get hooks 's deletion policy. Fix: Fix the script; add output-log-policy; when a pre-hook fails the resources are unchanged, so once fixed, simply re-upgrade.

Error: UPGRADE FAILED: warning: Hook pre-upgrade faultbox/templates/hook-job.yaml failed: … field is immutable / already exists

Cause: The previous hook Job with the same name still exists, and the deletion policy does not include before-hook-creation. In v4.3.2, creating a hook on an SSA release is a server-side apply patch: when the Job template has changed, it reports spec.template: … field is immutable; if the template is exactly the same, the patch is a no-op, and Helm sees the old completed Job and directly judges success, so the migration did not actually run again. A client-side apply release (a release migrated from Helm 3) reports already exists. Fix:kubectl delete job fb-faultbox-migrate, add before-hook-creation to the policy, or include {{ .Release.Revision }} (note that this leaves multiple Jobs behind).

post-upgrade hooks failed, but the new version's Pods are already running

Cause: The post hook runs after resources have been applied (and waited on). Decision: Is the new version healthy? If it is, fix the hook and re-upgrade (with the same values); if it is not healthy, helm rollback.

the hook stays “running” until context deadline exceeded

Cause: The Job is in backoff retries, the image cannot be pulled, or it is waiting for a dependency (the database is not ready). Diagnosis:kubectl describe job,kubectl get pods -l job-name=…. Fix:backoffLimit,activeDeadlineSeconds, and a more reasonable --timeout.

After helm uninstall, the hook Job still exists

Cause: Hook resources are not part of the release manifest. Fix: Add hook-succeeded to the deletion policy; or clean up manually by label.

Command-line exercises
1. Check which deletion policy is used in the hook definition of revision 9.
helm get hooks fb -n faults --revision 9 | grep -A1 hook-delete-policy
2. The hook Job has been deleted; find the events related to it from within the last hour.
kubectl -n faults get events --field-selector involvedObject.name=fb-faultbox-migrate
kubectl -n faults get events --sort-by=.lastTimestamp | grep -i migrate
Scenario analysis
A chart has 3 pre-upgrade hooks (weights -5, 0, 5), --timeout 5m, and the CI job times out at 10m. What problems will occur? How should it be adjusted?

In the worst case, the 3 hooks each wait 5 minutes = 15 minutes, plus resource waiting, which far exceeds CI's 10 minutes; the job is killed and leaves a pending-upgrade behind (Module 2). Adjustment: set the Job itself with activeDeadlineSeconds and a smaller backoffLimit; set the CI timeout based on the worst path to be ≥ total hook duration + resource waiting + margin; or merge the hooks.

Verified instructional videos

▶
Helm Chart Hooks Tutorial: pre-install VS post-install — Anton Putra
English · Timing of pre/post hooks and Job demonstration
▶
How to use Helm Hooks for Fun and Profit — mkdev
English · Hook annotations, weights and deletion policies

Both videos predate Helm 4 and do not cover hook-output-log-policy.

Official documentation

Video storyboard (about 80 seconds)

Shot 1 · 0–20s
Visual: on the timeline, the pre-upgrade Job turns red; the Deployment beside it stays gray and unchanged.
Narration: when a pre hook fails, regular resources are not changed.
Shot 2 · 20–45s
Visual: the hook-failed policy's broom sweeps the Job away; kubectl logs returns NotFound.
Narration: the deletion policy may delete the evidence before you ever see the logs.
Shot 3 · 45–80s
Visual: the output-log-policy annotation lights up; the logs are copied to the CI window first, and only then is the Job deleted.
Narration: Helm 4's log policy outputs the logs before deletion, so the evidence stays in the pipeline.
or score ≥ 70% in the “Quiz”

Module 4 · Server-Side Apply (SSA) and Field Ownership Conflicts

21:00 – 29:00 · Helm 4 no longer “quietly overwrites” fields that others have changed: every field has an owner, and grabbing a field either reports a conflict or requires an explicit --force-conflicts
8 minutesCore animationfield manager = helm★★★★★
Learning Objectives
  • Explain Helm 4's choice of apply method: install defaults to --server-side=true; upgrade and rollback default to --server-side=auto, inheriting the value recorded in the previous revision's ApplyMethod; a release created by Helm 3 does not have this field and is treated as client-side apply (CSA).
  • Understand managedFields, applying SSA rules to decide whether an apply conflicts: a field owned by another manager with a different value = conflict; the same value = shared ownership; a field you no longer declare and that nobody shares = deleted.
  • Handle conflicts with kubectl, HPA and GitOps controllers: --force-conflicts (which is mutually exclusive with --force-replace ), let the chart give up the field, or explicitly migrate a Helm 3 release to --server-side=true.
Prerequisites: The three-way merge of kubectl apply from the Kubernetes course. Importance:★★★★★

What: two apply methods

Client-side apply CSA (Helm 3 approach)Server-side apply SSA (default for new Helm 4 installs)
Who computes the diffHelm: performs a three-way merge using the “previous revision manifest / new manifest / current cluster object” and generates a patchAPI Server: Helm sends the complete “desired fields”, and the server merges them according to field ownership
Fields changed by othersfield in the chart unchanged→ keep others' value (drift preserved); field in the chart changed→ silently overwrittenValue differs and is owned by someone else → conflict, operation fails, unless --force-conflicts
Where the record livesmanagedFields has operation=Update, manager=helmmanagedFields has operation=Apply, manager=helm
When Helm 4 uses eachReleases migrated from Helm 3 (auto), or explicitly --server-side=falseNew installs, or explicitly --server-side=true

Why: why Helm 4 switched to SSA

The three-way merge has two old problems: ① it cannot see “who” changed a field, and can only choose between two options based on whether the chart changed, so it either keeps drift or overwrites silently; ② it is based on the previous revision's manifest, so when the manifest and the cluster disagree (for example, resources were deleted by hand or the post-renderer changed), the patch goes wrong. SSA records ownership with the API Server, and conflicts are explicitly surfaced at apply time, so multiple managers (Helm, HPA, cert-manager injection, GitOps controllers) can safely own different fields.

How: the decision logic of v4.3.2

  • install: --server-side is a boolean, default true; the release record ApplyMethod=ssa,helm get metadata shows APPLY_METHOD: server-side apply.
  • upgrade / rollback: --server-side is a string true|false|auto, default auto: the previous revision is ssa to use SSA; a Helm 3 release (empty field) shows client-side apply (defaulted) and continues to use CSA.
  • When switching from CSA to SSA (--server-side=true), Helm takes the fields it originally owned via Update and upgrades them to Apply ownership (in the source code, as upgradeClientSideFieldManager), so that after the switch it does not conflict with “its past self”.
  • The field manager name is fixed to helm (set via cmd/helm/helm.go kube.ManagedFieldsManager = "helm"); programs using the Helm SDK that do not set it will use the executable name.
  • --force-conflicts: with SSA, forcibly take ownership of conflicting fields; mutually exclusive with --force-replace (delete and recreate, originally --force) — specifying both is rejected by argument parsing.

SSA conflict decision rules (Kubernetes documentation)

  1. For each field helm declares this time: if no other manager owns it → helm owns it, set to the declared value.
  2. Owned by another manager, and the same value → no conflict; helm and the other party share ownership.
  3. Owned by another manager, and a different value → conflict; with force, helm takes ownership and the other party loses the field.
  4. Fields helm declared last time but does not declare this time: if no other manager → deleted (or restored to default); if there are sharers → kept, but helm no longer owns it.
  5. Any write operation that “changes a field value” (kubectl edit/patch/scale, controller Update) makes the writer the owner of that field.

When: typical sources of conflict

SourceCommon fieldsRecommended handling
On-call engineers kubectl scale/edit/patch.spec.replicas, image, environment variablesWrite the change back to values, then use --force-conflicts to reclaim it once; permanently ban manual edits in the long run
HPA (via the scale subresource).spec.replicasWhen HPA is enabled, the chart should not render replicas (helm create template already does this)
GitOps controllers (Argo CD, Flux)the whole objectAn object can have only one “declaration source”; do not mix Helm CLI and GitOps management
Injecting controllers (Istio, Linkerd, certificate injection)annotations, CA bundleThe chart does not declare these fields
Common misconceptions① “After upgrading to Helm 4, all releases become SSA” — Helm 3 releases still default to CSA until explicitly --server-side=true. ② “--force-conflicts and --force are the same” — the former only takes field ownership; the latter (now named --force-replace) deletes and recreates resources, which causes an outage. ③ “SSA conflicts are a bug, so force should always be added” — a conflict is a reminder that there is another manager; blindly forcing will fight with HPA back and forth. ④ “Fields not written in the chart are deleted by SSA” — only fields that helm once owned, no longer declares, and nobody shares are deleted.

managedFields illustration

Deployment fb-faultbox · managedFields manager: helm · operation: Applyf:spec.f:selector · f:template.f:spec.f:containers[faultbox].f:image … manager: ops-hotfix · operation: Updatef:spec.f:replicas (changed to 3 by kubectl patch) manager: kube-controller-manager · Updatef:status … (subresource: status) helm upgrade declares replicas: 1replicas owned by ops-hotfix, current value 3 ≠ 1→ Apply failed with 1 conflictconflict with "ops-hotfix": .spec.replicas Three ways out① Change values to 3: same value → shared, no conflict② --force-conflicts: helm takes back replicas③ The chart no longer renders replicas (left to HPA / people)
Figure 4-1: the basis for determining a conflict is “who owns the field” and “whether the value is the same”

Path for migrating a Helm 3 release into Helm 4

Helm 3 releaseApplyMethod is empty helm 4 upgrade (auto)continue with CSA three-way merge upgrade --server-side=true (once)Upgrading helm's field ownership → afterward auto = SSA
Figure 4-2: migration is an explicit step; it is recommended to rehearse first in a pre-production environment with --dry-run=server

Core animation: the SSA field conflict decision process

The left side shows the current values of the object in the cluster and their field owners; the right side shows the values helm is declaring this time. Click “Decide field by field” to see how the API Server handles each field; switch --force-conflicts or change helm's declaration and retry.

FieldCurrent cluster valueCurrent ownerhelm declarationDecision
Select a scenario, then click “Decide field by field”.
$ helm upgrade fb ./faultbox -n faults

Core commands

CommandPurpose
helm get metadata fb -n faultsAPPLY_METHOD: server-side apply / client-side apply / client-side apply (defaulted)
kubectl get deploy fb-faultbox -n faults -o yaml --show-managed-fieldskubectl hides managedFields by default; this flag is required
kubectl get deploy fb-faultbox -n faults -o json | jq '.metadata.managedFields[] | {manager, operation, subresource}'Quickly list all managers
helm upgrade … --force-conflictsForcibly take over conflicting fields with SSA
helm upgrade … --server-side=true|false|autoExplicitly choose the apply method (rollback supports it too)
kubectl apply --server-side --field-manager=helm --dry-run=server -f r.yamlReproduce, outside Helm, an apply with the same name as Helm's to check for conflicts (read-only rehearsal)
kubectl -n faults get deploy fb-faultbox -o json \
  | jq -r '.metadata.managedFields[] | "\(.manager)\t\(.operation)\t\(.subresource // "-")\t\(.fieldsV1 | tostring | .[0:80])"'
helm	Apply	-	{"f:metadata":{"f:annotations":{"f:meta.helm.sh/release-name":{},"f:meta.helm.sh/re
kube-controller-manager	Update	status	{"f:metadata":{"f:annotations":{"f:deployment.kubernetes.io/revision":{}}},"f:statu
ops-hotfix	Update	-	{"f:spec":{"f:replicas":{}}}

Lab 4: Grab a field → conflict → two fixes → compare with CSA (about 7 minutes)

On-call engineer scales manually (explicitly specify the field manager, for easier observation):
kubectl -n faults patch deploy fb-faultbox --field-manager=ops-hotfix \
  --type=merge -p '{"spec":{"replicas":3}}'
kubectl -n faults get deploy fb-faultbox -o json | jq -r '.metadata.managedFields[] | "\(.manager) \(.operation)"'
deployment.apps/fb-faultbox patched
helm Apply
kube-controller-manager Update
ops-hotfix Update
helm upgrade, with no changes to the chart:
cd ~/helm-lab
helm upgrade fb ./faultbox -n faults
Error: UPGRADE FAILED: conflict occurred while applying object faults/fb-faultbox apps/v1, Kind=Deployment: Apply failed with 1 conflict: conflict with "ops-hotfix" using apps/v1: .spec.replicas

Even though the chart did not change, helm still declares replicas: 1, and this field now belongs to ops-hotfix with the value 3 → conflict. This revision is recorded as failed, and the cluster is not modified.

Fix A: same value → shared ownership:
helm upgrade fb ./faultbox -n faults --set replicaCount=3
kubectl -n faults get deploy fb-faultbox -o json | jq -r '.metadata.managedFields[] | select(.fieldsV1|tostring|test("replicas")) | .manager'
Release "fb" has been upgraded. Happy Helming!
helm
ops-hotfix
Fix B: explicitly reclaim by Helm:
kubectl -n faults patch deploy fb-faultbox --field-manager=ops-hotfix --type=merge -p '{"spec":{"replicas":4}}'
helm upgrade fb ./faultbox -n faults --set replicaCount=2 --force-conflicts
kubectl -n faults get deploy fb-faultbox -o jsonpath='{.spec.replicas}{"\n"}'
helm upgrade fb ./faultbox -n faults --set replicaCount=2 --force-conflicts --force-replace
deployment.apps/fb-faultbox patched
Release "fb" has been upgraded. Happy Helming!
2
Error: if any flags in the group [force-replace force-conflicts] are set none of the others can be; [force-conflicts force-replace] were all set
Compare with CSA (simulating a release migrated from Helm 3):
helm install fbcsa ./faultbox -n faults --server-side=false
helm get metadata fbcsa -n faults | grep APPLY_METHOD
kubectl -n faults patch deploy fbcsa-faultbox --field-manager=ops-hotfix --type=merge -p '{"spec":{"replicas":3}}'
helm upgrade fbcsa ./faultbox -n faults              # auto → stays on CSA
kubectl -n faults get deploy fbcsa-faultbox -o jsonpath='{.spec.replicas}{"\n"}'
helm upgrade fbcsa ./faultbox -n faults --set replicaCount=2
kubectl -n faults get deploy fbcsa-faultbox -o jsonpath='{.spec.replicas}{"\n"}'
APPLY_METHOD: client-side apply
Release "fbcsa" has been upgraded. Happy Helming!
3
Release "fbcsa" has been upgraded. Happy Helming!
2

CSA: when the chart is unchanged, drift (3) is silently preserved; when the chart changes, it is silently overwritten (2). There is no error at all; this is the problem SSA is meant to solve.

Migrate the CSA release to SSA and clean up:
helm upgrade fbcsa ./faultbox -n faults --set replicaCount=2 --server-side=true
helm get metadata fbcsa -n faults | grep APPLY_METHOD
helm uninstall fbcsa -n faults
helm upgrade fb ./faultbox -n faults --reset-values --force-conflicts
APPLY_METHOD: server-side apply
release "fbcsa" uninstalled

Case 1: The first --server-side=true upgrade after migrating to Helm 4 fails

Problem: For years on-call engineers manually changed the resource limits of many Deployments, and CSA kept those changes silently. When switching to SSA, 40 conflicts were exposed at once. Approach: First use --dry-run=server --server-side=true to list the conflicts; decide for each one whether to “write back to values” or “give up the field”; after writing everything back, use one --force-conflicts to reclaim. Limitation: The dry-run conflict list depends on the API Server's SSA implementation; complex CRDs (lists without listType annotations) may be treated as a single atomic field.

Case 2: HPA and the chart's replicas tug-of-war

Problem: The chart still renders replicas: 2 when HPA is enabled. Under Helm 3, every release reset the replica count to 2, and HPA pulled it back to 8, causing a momentary capacity drop during the release; under Helm 4 SSA, it reports a conflict directly. Approach: Wrap the template with {{- if not .Values.autoscaling.enabled }} around replicas (consistent with helm create generated templates). Note: In the upgrade that switches from “rendering replicas” to “not rendering”, if helm is the only owner, SSA deletes that field and the Deployment falls back to the default of 1 replica. First confirm that HPA has taken over (once HPA writes to the scale subresource it becomes the field owner), then release.

Case 3: Mixing Argo CD and the helm CLI

Problem: Argo CD (with the ServerSideApply sync option enabled) applies resources under its own field manager, and an engineer then used the helm CLI to upgrade the same release; the two conflict with each other. Approach: Each object has only one declaration source; when a temporary manual change is needed, pause automatic sync in Argo CD and write the change back to Git.

Common errors and fixes

Error: UPGRADE FAILED: conflict occurred while applying object faults/fb-faultbox apps/v1, Kind=Deployment: Apply failed with 1 conflict: conflict with "kubectl-edit" using apps/v1: .spec.template.spec.containers[name="faultbox"].image

Cause: Someone used kubectl edit to change the image, so the current value differs from the chart. Diagnosis:--show-managed-fields, confirm the owner and time (managedFields[].time). Fix: If the manual change should be kept → write it into values (same value means shared); otherwise --force-conflicts. The manager name should be taken from what is actually displayed in managedFields.

conflict with "kube-controller-manager" … .spec.replicas

Cause: HPA modified the replica count through the scale subresource. Fix: When HPA is enabled, the chart does not render replicas; do not use force to tug-of-war with HPA.

Error: if any flags in the group [force-replace force-conflicts] are set none of the others can be

Cause: The two flags are mutually exclusive (--force and --force-conflicts are likewise mutually exclusive). Fix: Use --force-conflicts; only use --force-replace when deletion and recreation is required (immutable fields).

A Helm 3-era release still “silently overwrites” manual changes after an upgrade

Cause:--server-side=auto It continues to use CSA. Diagnosis:helm get metadata shows client-side apply (defaulted). Fix: Plan a one-time --server-side=true migration.

After switching to SSA, some field is deleted (for example, an annotation or the replica count)

Cause: helm was once the only owner of that field, and the new chart no longer declares it. Fix: If it should be kept, let the real manager (a controller or a person) first write to the field to become its owner, or keep declaring it in the chart.

Command-line exercises
1. List all Helm releases in all namespaces that still use client-side apply.
for r in $(helm list -A -o json | jq -r '.[] | "\(.name)/\(.namespace)"'); do
  n=${r%%/*}; ns=${r##*/}
  m=$(helm get metadata "$n" -n "$ns" | awk -F': ' '/APPLY_METHOD/{print $2}')
  echo "$ns/$n: $m"
done | grep client-side
2. Without modifying the cluster, rehearse whether migrating release fb to SSA would conflict.
helm upgrade fb ./faultbox -n faults --server-side=true --dry-run=server
Scenario analysis
The platform team wants to add --force-conflicts uniformly to all helm upgrade commands in CI, “so conflicts don't interrupt releases”. Your opinion?

I don't recommend a blanket rule. A conflict means another manager exists. For HPA, force resets the replica count, causing a capacity drop, and HPA changes it back the next moment, creating a tug-of-war. For an emergency patch from the security team (for example, changing an image), force silently rolls the patch back. Recommendations: do not add it by default; when a conflict occurs, have CI output the conflicting fields and their managers; establish a process that “manual changes must be written back to values”; use force only in a single, confirmed release.

Verified instructional videos

▶
Adopting Server Side Apply in Knative - a Case Study - Dave Protasowski, VMware — CNCF [Cloud Native Computing Foundation]
English · Field ownership issues encountered when a project migrated to SSA (not a Helm-specific topic)
▶
Helm 4: What’s New in the Open Source Kubernetes Package Manager? — The New Stack
English · Interview on Helm 4's new features, including SSA by default

Official documentation

Video storyboard (about 90 seconds)

Shot 1 · 0–25s
Visual: beside each field of the Deployment are name tags: helm, ops-hotfix, kube-controller-manager.
Narration: server-side apply records an owner for every field.
Shot 2 · 25–55s
Visual: helm hands over a form with replicas equal to 1; the API Server sees the tag ops-hotfix and the value 3, and a red light comes on.
Narration: a field owned by someone else with a different value is a conflict.
Shot 3 · 55–90s
Visual: the three ways out are demonstrated in turn: the same value shares the tag; force tears off the tag and replaces it with helm; the chart gives up the field to HPA.
Narration: first work out who should own this field, then decide how to resolve the conflict.
or score ≥ 70% in the “Quiz”

Module 5 · Template Debugging and Rendering Performance

29:00 – 36:00 · Make templates explain themselves when they fail; “print” intermediate values when needed; know why rendering is slow and why lookup is empty in dry-run
7 minutesfail · required · lookup★★★★☆
Learning Objectives
  • Use required and fail to write errors with context (Helm wraps them as execution error at (file:line:column): message), and understand how they manifest in helm lint .
  • Master the 4 techniques for printing intermediate values: toYaml writing into comments,fail (toYaml $x) interrupting dump,printf "%T"/kindOf checking types,-s and --output-dir narrowing the scope.
  • Know the main sources of rendering time (number of dependencies, repeated include/tpl,lookup network calls, huge .Files), and can use time and HELM_PPROF_CPU_PROFILE to measure; understand lookup how it behaves under template / client / server dry-run.
Prerequisites:Lesson 2 template syntax. Importance:★★★★☆

What: readable failures

{{- define "faultbox.validate" -}}
{{- $repo := required "image.repository must not be empty: set the image repository in values" .Values.image.repository -}}
{{- if and .Values.ingress.enabled (not .Values.ingress.hosts) -}}
{{- fail "when ingress.enabled=true, at least one ingress.hosts entry must be configured" -}}
{{- end -}}
{{- if and (not .Values.autoscaling.enabled) (lt (int .Values.replicaCount) 1) -}}
{{- fail (printf "replicaCount must be ≥ 1 (currently %v, type %T)" .Values.replicaCount .Values.replicaCount) -}}
{{- end -}}
{{- end -}}

In deployment.yaml , add the following line at the top {{ include "faultbox.validate" . }} (it outputs nothing). On failure, Helm's engine formats the template error as:

Error: execution error at (faultbox/templates/deployment.yaml:1:3): when ingress.enabled=true, at least one ingress.hosts entry must be configured
FunctionPurposeIn helm lint,
required "msg" .Values.xfails when the value is empty (nil or empty string); otherwise returns it unchangedIn lint mode,does not fail (the value may be provided at install time); it only gives a hint
fail "msg"Unconditionally fails, used for composite condition validationfails
values.schema.jsonStructure and type validation, before rendering (layer ②)fails

Why: why not hand everything to the schema

JSON Schema is good at types, enums and required fields; cross-field business rules (“an ingress must have a host when enabled”, “the built-in postgres must be turned off when an external database is enabled”) are written with if/then are hard to write, whereas fail can give directly actionable hints. In practice the two are used together: the schema manages structure, and fail manages business rules.

How: techniques for printing intermediate values

  1. write into comments: # DEBUG {{ .Values.resources | toJson }}, visible in the rendered output, and does not affect the YAML (remove after debugging).
  2. interrupting dump: {{ fail (toYaml $ctx) }}— to view, in a complex range/with block, the current . value, exactly what it is; the error message is the dump content.
  3. Check type: {{ printf "%T" .Values.replicaCount }},kindOf,typeOf. Numbers coming from --set are int64, while numbers from a YAML file are float64,--set-string is a string — comparing with eq is a common cause of failure.
  4. Narrow the scope: helm template -s templates/deployment.yaml; --output-dir out/ outputs per file, convenient for diff; --debug still outputs the rendered result when the YAML is invalid.

When: why rendering is slow

SourceCauseOptimization
Number of dependenciesThe templates of the parent chart and all subcharts are parsed into one template set and executed one by one; the values of each subchart must be mergedDisable unused subcharts (condition); split very large umbrella charts
Repetition includea helper is executed repeatedly for every resource and every container (for example, a helper that generates labels is called hundreds of times)At the beginning of the template $labels := include … cache in a variable
tplevery call has to parse the string as a new templateuse only for the small number of values that really need templating
lookupeach call is a synchronous API request (during server dry-run and real installs)Avoid calling it inside range ; store the result in a variable
.Files / huge valuesall files in the chart are loaded (they also enter the release record, see Module 6).helmignore Exclude

Measure: time helm template … give end-to-end time; HELM_PPROF_CPU_PROFILE=cpu.out helm template … and HELM_PPROF_MEM_PROFILE (v4.3.2 pkg/cmd/profiling.go), generate a pprof file,go tool pprof -top cpu.out view hotspots.

lookup With dry-run

CommandConnects to clusterlookup returns
helm templateNoempty map ({})
install/upgrade --dry-run (= client)Noempty map
install/upgrade --dry-run=serverYesreal objects
real install/upgradeYesreal objects
helm lintNoempty map

So a template that “reuses the password if the Secret already exists, otherwise generates a random one” will, in helm template and in GitOps tools (Argo CD renders with ), a new password is generated every time. Templates must handle an empty map: {{- $s := lookup "v1" "Secret" .Release.Namespace "x" -}}{{- if $s }}…{{- end }}.

Common misconceptions① “required can check that a value is false or 0” — it only tests for nil and the empty string; 0 and false are valid values. ② “If lint passes, all required conditions are met” — in lint mode, required does not fail. ③ “lookup also works in dry-run” — only --dry-run=server. ④ “Slow rendering means Kubernetes is slow” —helm template rendering runs entirely offline; if it is slow, the template itself is slow.

Debugging funnel: from the full output to a single variable

helm template --debug (full output; printed even if the YAML is invalid) -s templates/deployment.yaml / --output-dir # DEBUG {{ $x | toJson }} · printf "%T" fail (toYaml .) — dump the context at the point of error
Figure 5-1: locate template problems from coarse to fine

Composition of rendering time (illustrative)

Load chart Merge values Execute templates (repeated include / tpl calls) lookup network round trips × N Sort output In a large umbrella chart, template execution and lookup usually dominate (proportions are illustrative; defer to real pprof measurements)
Figure 5-2: measure before optimizing

Interactive: required / fail validators + lookup behavior

Change values and the execution mode, and observe faultbox.validate 's output, and lookup "v1" "Secret" "faults" "fb-db" returns in that mode.

$ helm template fb ./faultbox

Core commands

CommandPurpose
helm template fb ./faultbox --debug -s templates/deployment.yamlRenders only one file
helm template fb ./faultbox --output-dir out/Each template is written as one file, convenient for diff -r
helm template fb ./faultbox --set-json 'ingress={"enabled":true}'Precisely passing structured values
helm lint ./faultbox --strict -f ci/values.yamlNote that required does not fail in lint
time helm template big ./umbrella >/dev/nullEnd-to-end rendering time
HELM_PPROF_CPU_PROFILE=cpu.out helm template …Generate a CPU profile,go tool pprof -top cpu.out
helm upgrade … --dry-run=serverso that lookup returns real objects
# Inside range, see what the “current context” actually is
cat > /tmp/dump.yaml <<'EOF'
{{- range $i, $h := .Values.ingress.hosts }}
{{- if eq $i 0 }}{{ fail (toYaml $h) }}{{ end }}
{{- end }}
EOF
cp /tmp/dump.yaml ~/helm-lab/faultbox/templates/zz-dump.yaml
helm template fb ~/helm-lab/faultbox; rm ~/helm-lab/faultbox/templates/zz-dump.yaml
Error: execution error at (faultbox/templates/zz-dump.yaml:2:20): host: chart-example.local
paths:
- path: /
  pathType: ImplementationSpecific

Lab 5: Defensive templates + timing (about 5 minutes)

Add the validation helper: save the Theory page's _validate.tpl to ~/helm-lab/faultbox/templates/_validate.tpl, and insert at the first line of deployment.yaml :
cd ~/helm-lab
sed -i '1i {{- include "faultbox.validate" . }}' faultbox/templates/deployment.yaml
helm template fb ./faultbox --set ingress.enabled=true --set-json 'ingress.hosts=[]'
helm template fb ./faultbox --set replicaCount=0
helm template fb ./faultbox --set image.repository=
Error: execution error at (faultbox/templates/deployment.yaml:1:4): when ingress.enabled=true, at least one ingress.hosts entry must be configured
Error: execution error at (faultbox/templates/deployment.yaml:1:4): replicaCount must be ≥ 1 (currently 0, type int64)
Error: execution error at (faultbox/templates/deployment.yaml:1:4): image.repository must not be empty: set the image repository in values

The line and column point to where include is located; the actual rule is in the helper. Note --set produces int64.

required in lint:
helm lint ./faultbox --set image.repository=

Observation: in lint mode required does not make lint fail (the LintMode behavior of the v4.3.2 engine), so CI still needs an extra run with real values via helm template.

lookup behavior:
kubectl -n faults create secret generic fb-db --from-literal=password=s3cr3t
cat > faultbox/templates/zz-lookup.yaml <<'EOF'
{{- $s := lookup "v1" "Secret" .Release.Namespace "fb-db" }}
# lookup-found: {{ if $s }}yes{{ else }}no{{ end }}
EOF
helm template fb ./faultbox -n faults | grep lookup-found
helm upgrade fb ./faultbox -n faults --dry-run=client | grep lookup-found
helm upgrade fb ./faultbox -n faults --dry-run=server | grep lookup-found
rm faultbox/templates/zz-lookup.yaml
# lookup-found: no
# lookup-found: no
# lookup-found: yes

Only server dry-run can read Secrets from the cluster. If written as a bare --dry-run, Helm 4 treats it as client and prints a deprecation warning.

Render timing: create 300 repeated includes.
for i in $(seq 1 300); do printf '# {{ include "faultbox.labels" . | quote }}\n' ; done > faultbox/templates/zz-heavy.yaml
time helm template fb ./faultbox >/dev/null
HELM_PPROF_CPU_PROFILE=/tmp/cpu.out helm template fb ./faultbox >/dev/null && ls -l /tmp/cpu.out
rm faultbox/templates/zz-heavy.yaml

The difference for a small chart is tiny (milliseconds); the key is learning how to measure. On an umbrella chart with dozens of subcharts, the difference is very noticeable.

Case 1: Argo CD rotates the database password on every sync

Problem: The chart uses lookup to reuse an existing password, otherwise randAlphaNum 24. Argo CD renders in helm template mode; lookup is always empty, so a new password is generated on every sync, and the application and database fall out of step. Approach: The password is managed by external secret management (External Secrets / Key Vault), and the chart only references the Secret name. Limitation: Any logic that depends on lookup is not suitable for the GitOps rendering path.

Case 2: An umbrella chart takes 90 seconds to render

Problem: A platform chart containing 60 subcharts; in CI, helm template takes 90 seconds. Approach: pprof shows that most of the time is spent in tpl: every subchart runs tpl over the whole values string. Changed to apply tpl only to a few fields and to use condition to disable unused subcharts, which brought it down to 12 seconds (this figure was recorded for this case and is for reference only).

Case 3: eq A comparison is always false

Problem:{{ if eq .Values.port 8080 }} It has no effect when set in values.yaml. Cause: Numbers in YAML are parsed as float64, which has a different type from an int constant when compared. Approach:eq (int .Values.port) 8080, and use printf "%T" to debug.

Common errors and fixes

Error: execution error at (x/templates/a.yaml:3:4): …(custom message)

This is the business error raised by fail or required . Fix the values according to the message. If the message is unclear, improve the hint text in the chart.

error calling eq: incompatible types for comparison

Cause: Compared different types (for example int64 and string). Diagnosis:printf "%T". Fix:int,toString unify the types.

rendering template has a nested reference name: x: unable to execute template

Cause:include Recursion exceeded the limit (1000 times in v4.3.2). Fix: Check whether a helper includes itself, or whether tpl references itself.

lookup is always empty in CI

Cause: Used helm template or client dry-run. Fix: When real data is needed, use --dry-run=server; make the template compatible with an empty map.

getHostByName always returns an empty string

Cause: Helm disables DNS lookups in templates by default. Fix: When it is really needed, --enable-dns (this makes rendering depend on the network, so it is not recommended).

Command-line exercises
1. Render the chart to a directory and compare it with the rendering result of the previous version.
helm template fb ./faultbox -f prod.yaml --output-dir /tmp/new
git stash && helm template fb ./faultbox -f prod.yaml --output-dir /tmp/old && git stash pop
diff -ru /tmp/old /tmp/new
2. Generate a CPU profile for helm template and view the top 10 hotspots.
HELM_PPROF_CPU_PROFILE=cpu.out helm template big ./umbrella >/dev/null
go tool pprof -top -nodecount=10 cpu.out
Scenario analysis
For a chart you need to add the constraint “the built-in postgres must be turned off when the external database is enabled”: use the schema or fail? How should the error message be written?

Cross-field business rules are better suited to fail (the schema's if/then is hard to read and its errors are obscure). Example: {{- if and .Values.externalDatabase.enabled .Values.postgresql.enabled }}{{ fail "when externalDatabase.enabled=true, set postgresql.enabled=false to avoid deploying the built-in database at the same time" }}{{ end }}. A good error message includes which field, the current value, the expected value and how to fix it.

Verified instructional videos

▶
How to use helm lint, helm –debug –dry run, and helm template | How to Troubleshoot Errors in Helm — DevOps Hint
English · Demonstration of template debugging commands (same video as Module 1)
▶
Complete Helm Chart Tutorial: From Beginner to Expert Guide — Rahul Wagh
English · Long-form tutorial, including template functions and debugging snippets

Official documentation

Video storyboard (about 75 seconds)

Shot 1 · 0–25s
Visual: an obscure nil pointer error is shown side by side with a clear fail error.
Narration: a good chart tells the user directly which value to change when it fails.
Shot 2 · 25–50s
Visual: the funnel narrows from the full output to a single file with -s, and then to a single DEBUG comment.
Narration: narrow step by step from the full output down to one variable.
Shot 3 · 50–75s
Visual: switches for the four execution modes; the lookup light turns on only for dry-run=server and real upgrades.
Narration: lookup only returns data when connected to a cluster.
or score ≥ 70% in the “Quiz”

Module 6 · Release Storage, Size Limits and Cleanup

36:00 – 43:00 · Each revision is a complete snapshot: chart (including all files and subcharts) + values + manifest + hooks. After compression it must fit into a 1 MiB Secret
7 minutesHELM_DRIVER1 MiB★★★★☆
Learning Objectives
  • State how the release record is encoded: release object → JSON → gzip (highest compression level) → base64 → the Secret's data.release; Secret type helm.sh/release.v1, labels owner=helm,name,status,version, when creating or modifying, add createdAt/modifiedAt.
  • Know the Kubernetes per-object size cap for a Secret (and ConfigMap) data 1 MiB , and recognize data: Too long: must have at most 1048576 bytes, and find out “what made the release larger”.
  • Choose drivers: secret (default),configmap,memory,sql (PostgreSQL,HELM_DRIVER_SQL_CONNECTION_STRING); use --history-max (default 10, environment variable HELM_MAX_HISTORY) to control history; understand helm uninstall --keep-history.
Prerequisites: The release states from Module 2. Importance:★★★★☆

What: what a revision contains

PartContentCommon “bloat sources”
chartChart.yaml, templates, default values, schema,all files in the chart directory that are not excluded by .helmignore, all subcharts (recursively)large Grafana dashboard JSON, embedded CRDs, test data, accidentally packaged binaries
configuser-supplied values (-f / --set)stuffing certificates and large configuration files into values
manifestAll rendered manifestslarge files embedded in ConfigMaps, hundreds or thousands of resources
hookshook manifests and the last run status—
infostatus, time, description, NOTES—

Encoding (v4.3.2 pkg/storage/driver/util.go): json.Marshal → gzip.BestCompression → base64.StdEncoding. Text content usually compresses to 10%–25%, while binaries that are already compressed or random hardly compress at all; base64 then inflates by 4/3. Therefore the gzipped data must be roughly smaller than 768 KiB, and only after base64 encoding can it fall below 1 MiB.

Why: why there is a 1 MiB limit

The Kubernetes documentation specifies that a single Secret is at most 1 MiB (ConfigMaps likewise limit data to 1 MiB), to prevent large objects from exhausting the memory of the API Server and etcd. This limit is applied to each revision, independent of the number of history entries —--history-max reducing it to 1 cannot save a revision that is already oversized by itself. But the number of history entries determines the total etcd footprint: 10 revisions of 900 KiB each come to about 9 MiB.

How: driver comparison

HELM_DRIVERStorage locationSize limitSuitable scenarios
secret (default; can also be written as secrets or left empty)Secret in the release namespace1 MiB / revisionMost scenarios; read access can be restricted with RBAC
configmapConfigMap1 MiBNot recommended: sensitive data in values is readable in plaintext (release content is not encrypted)
memoryprocess memory—Tests,helm template scenarios; lost when the process ends
sqlPostgreSQL table releases_v1,custom_labels_v1database field limitsVery large releases, centralized auditing; all users need to be configured with the same connection string (HELM_DRIVER_SQL_CONNECTION_STRING), v4.3.2 supports only the postgres dialect

When: cleanup and history

  • --history-max: available for upgrade and rollback; the default is 10 (HELM_MAX_HISTORY can override), 0 means unlimited. When a new revision is created, the oldest records are deleted, but always keeps the last deployed revision.
  • helm uninstall: deletes resources and all history; --keep-history keeps the history and sets its status to uninstalled (helm list --uninstalled is visible, and can be helm rollback restored). A release name whose history is retained cannot be helm install reused directly; you need --replace or must completely uninstall first.
  • With large numbers of namespaces and releases,kubectl get secret -A -l owner=helm the total size is worth monitoring.
Common misconceptions① “The release Secret is encrypted” — it is only gzip+base64; anyone who can read the Secret can decode the passwords in values, so protect it with RBAC and etcd encryption at rest. ② “Lowering history-max fixes Too long” — the limit applies to a single revision. ③ “Files not referenced in templates are not stored in the release” — all files in the chart are stored, so they must be excluded with .helmignore. ④ “Deleting an old Secret affects the running application” — it does not affect resources; it only loses rollback capability (do not delete the last deployed one).

From release object to Secret

release objectchart (+ subcharts + files)config (user values)manifesthooks · info JSON gziptext ×0.1–0.25 base64×4/3 Secretsh.helm.release.v1.fb.v12≤ 1 MiB labels: owner=helm · name=fb · status=deployed · version=12 · createdAt / modifiedAt
Figure 6-1: one Secret per revision; the limit applies to each single Secret

Pruning with --history-max=3

v7 superseded ✗ v8 superseded ✗ v9 deployed ✓ v10 failed v11 created Before creating v11, delete the oldest records until 2 older revisions remain; the last deployed (v9) is never deleted
Figure 6-2: history pruning happens when a new revision is created

Interactive: release size calculator

Enter the uncompressed size of each part of the chart to estimate the byte count of data.release in the Secret (the compression ratio is an empirical range; actual measurements prevail).

Estimate result
Full progress bar = 1 MiB (1,048,576 bytes)

Core commands

CommandPurpose
kubectl -n faults get secret -l owner=helm,name=fb -L status,versionList all revisions of fb
kubectl -n faults get secret sh.helm.release.v1.fb.v1 -o jsonpath='{.data.release}' | base64 -d | wc -cByte count of the release field in the Secret (the API returns data base64-encoded again, so decoding once gives the stored bytes)
… | base64 -d | base64 -d | gunzip | jq '{chart: (.chart|tostring|length), manifest: (.manifest|length), config: (.config|tostring|length)}'Break down the size of each part to find the bloat source
helm upgrade … --history-max 5Keep at most 5 revisions
HELM_DRIVER=sql HELM_DRIVER_SQL_CONNECTION_STRING=postgresql://… helm listUse the SQL driver (all users must be consistent)
helm uninstall fb -n faults --keep-historyDelete resources, keep history (state uninstalled)
helm package faultbox && tar -tzvf faultbox-0.1.0.tgz | sort -k3 -n | tailFind the largest file in the chart
S=$(kubectl -n faults get secret -l owner=helm,name=fb,status=deployed -o name)
kubectl -n faults get "$S" -o jsonpath='{.data.release}' | base64 -d | base64 -d | gunzip \
  | jq '{chart_templates: ([.chart.templates[].data|length]|add), chart_files: ([.chart.files[]?.data|length]|add), values: (.config|tostring|length), manifest: (.manifest|length)}'
{
  "chart_templates": 9840,
  "chart_files": 1612,
  "values": 2,
  "manifest": 2730
}

The chart's template and file content inside the release JSON are themselves base64-encoded (in the []byte field), so the values are about 4/3 of the original size. Without jq, use python3 -m json.tool to view the structure.

Lab 6: Create an “oversized release” and fix it (about 5 minutes)

Put a 1.5 MB incompressible file into the chart (not referenced in the templates):
cd ~/helm-lab
mkdir -p faultbox/files && head -c 1500000 /dev/urandom > faultbox/files/blob.bin
helm upgrade fb ./faultbox -n faults
Error: UPGRADE FAILED: create: failed to create: Secret "sh.helm.release.v1.fb.v21" is invalid: data: Too long: must have at most 1048576 bytes

Are resources modified? No. Writing the pending record (creating the Secret) is the first step before touching the cluster, and it failed, so this is one of the few cases of a “layer ⑦ error with the cluster unchanged”. helm history Also, v21 does not appear.

Locate:
helm package faultbox -d /tmp >/dev/null && tar -tzvf /tmp/faultbox-0.1.0.tgz | sort -k3 -n | tail -3
-rw-r--r-- 0/0   1923 ... faultbox/templates/deployment.yaml
-rw-r--r-- 0/0   2254 ... faultbox/values.yaml
-rw-r--r-- 0/0 1500000 ... faultbox/files/blob.bin
Fix: exclude the file:
echo "files/*.bin" >> faultbox/.helmignore
helm upgrade fb ./faultbox -n faults --history-max 5
kubectl -n faults get secret -l owner=helm,name=fb --no-headers | wc -l
Release "fb" has been upgraded. Happy Helming!
5

This upgrade pruned fb's history to 5 revisions (keeping the last deployed one).

What about compressible text files?
yes '{"panel":"cpu","expr":"rate(container_cpu_usage_seconds_total[5m])"}' | head -c 3000000 > faultbox/files/dash.json
helm upgrade fb ./faultbox -n faults && echo "3 MB of repeated text was gzip-compressed to well under 1 MiB"
rm faultbox/files/dash.json

Highly repetitive text compresses extremely well, so it succeeds; real dashboards compress less, so a few dozen of them may hit the limit.

--keep-history experience (using a temporary release):
helm install tmp ./faultbox -n faults --set replicaCount=1
helm uninstall tmp -n faults --keep-history
helm list -n faults --uninstalled
helm rollback tmp 1 -n faults && helm list -n faults | grep tmp
helm uninstall tmp -n faults

Case 1: A kube-prometheus-style umbrella chart suddenly cannot be upgraded

Problem: After adding 30 Grafana dashboard JSON files as chart files, the upgrade reports Too long. Approach: Move the dashboards into standalone ConfigMaps loaded from Git by GitOps or a Grafana sidecar, rather than putting them into the chart; or split them into multiple charts. Limitation: Any design that puts large files into a chart stores a copy in every revision.

Case 2: etcd database bloated by Helm history

Problem: CI deploys a preview environment every 10 minutes, with --history-max 0 (unlimited), and after a few months there are tens of thousands of release Secrets. Approach: Restore the default of 10 or lower; a cleanup script deletes old revisions beyond N (keeping deployed); after use, preview environments are helm uninstall.

Case 3: Audit requirements to keep all release records

Problem: Compliance requires that every release be traceable, but there is no wish to bloat etcd. Approach: Evaluate the SQL driver (PostgreSQL): everyone (CI, on-call, GitOps tools) must use the same driver and connection string, otherwise they will see different “worlds”; or keep the default driver and archive the output of helm get all to object storage. Limitation: Support for the SQL driver in GitOps tools (Argo CD does not use release records; Flux helm-controller uses the Helm SDK and its storage configuration) follows each tool's own documentation.

Common errors and fixes

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

Diagnosis:tar -tzvf Find the large files; decode the previous revision and see how much chart/manifest/config each takes. Fix: exclude with .helmignore, split the chart, and move large configuration out of the chart. Prevention: In CI, check the packaged size against the Secret size of the previous revision.

ConfigMap "sh.helm.release.v1.x.vN" is invalid: []: Too long: must have at most 1048576 bytes

Similar errors when using the configmap driver are handled the same way.

Error: unable to instantiate SQL driver: …

Cause:HELM_DRIVER=sql but the connection string is missing or the database is unreachable. Fix: Set HELM_DRIVER_SQL_CONNECTION_STRING; check network and permissions (the first use runs table migrations).

helm list cannot see the release, but the resources are all there

Cause: The current HELM_DRIVER is different from when it was installed (secret ↔ configmap ↔ sql), or the namespace is wrong. Diagnosis:kubectl get secret,cm -A -l owner=helm | grep NAME,helm env.

Error: INSTALLATION FAILED: cannot reuse a name that is still in use (--keep-history was used before)

Fix:helm install --replace,helm rollback to restore, or helm uninstall (without keep-history) to delete the history completely.

Command-line exercises
1. Count the number of Helm release Secrets in each namespace of the cluster.
kubectl get secret -A -l owner=helm --no-headers | awk '{print $1}' | sort | uniq -c | sort -rn
2. Decode the latest revision of fb and list the chart file names it contains.
V=$(helm history fb -n faults -o json | jq '.[-1].revision')
kubectl -n faults get secret sh.helm.release.v1.fb.v$V -o jsonpath='{.data.release}' \
  | base64 -d | base64 -d | gunzip | jq -r '.chart.files[]?.name, .chart.templates[].name'
Scenario analysis
The team wants to switch the release driver to configmap, “because the number of Secrets hurts the readability of kubectl get secret”. Your opinion?

Object. The configmap driver does not change the size limit, but it lets anyone with ConfigMap read permission decode the passwords in values (RBAC is usually stricter for Secrets, and encryption at rest is often configured only for Secrets). Solve the readability problem with label filtering: kubectl get secret --field-selector type!=helm.sh/release.v1.

Verified instructional videos

No verified video specifically explaining Helm release storage and the 1 MiB limit was found. The introductory video below covers the concept of release records:

▶
What is Helm? | Helm Concepts Explained | KodeKloud — KodeKloud
English · Concepts of release, revision and Secret storage

Official documentation

Video storyboard (about 80 seconds)

Shot 1 · 0–25s
Visual: one revision is split into the chart, values and manifest blocks, which pass in turn through the JSON, gzip and base64 stages.
Narration: each revision is a complete snapshot; after compression and encoding it is stored in one Secret.
Shot 2 · 25–55s
Visual: a random binary file passes through gzip and barely shrinks; the Secret capacity bar turns red and “Too long” pops up.
Narration: a file that is already compressed cannot be compressed again, so it easily exceeds the one-megabyte limit.
Shot 3 · 55–80s
Visual: .helmignore blocks the large file; on the timeline old revisions are pruned, while the card for the deployed one is always kept.
Narration: use helmignore to control the size of a single revision, and history-max to control the total number.
or score ≥ 70% in the “Quiz”

Module 7 · Migrating from Helm 3 to Helm 4

43:00 – 52:00 · Charts don't need to change, but scripts do: parameter renames, --wait replaced by kstatus, post-renderers become plugins, plugins verify signatures by default, and new installs default to SSA
9 minutesHelm 4.3.2Helm 3 security fixes until 2027-02-10★★★★★
Learning Objectives
  • List the Helm 4 changes that affect CI scripts: --atomic→--rollback-on-failure,--force→--force-replace (old names still work with a warning),--wait becomes strategy-based (hookOnly/watcher/legacy),--dry-run accepted values,helm template --validate is deprecated, post-renderer must be a plugin,helm registry login registry login only accepts domain names, and plugin installation verifies signatures by default.
  • Understand the Helm 4 plugin system: plugin types cli/v1,getter/v1,postrenderer/v1, runtime subprocess and Wasm (extism/v1); legacy-format plugins still load.
  • Check compatibility for CI and GitOps tools (Argo CD, Flux, Ansible kubernetes.core, Terraform helm provider), and produce a migration checklist and timeline (Helm 3's last feature release, 3.22, on 2026-09-09; security fixes until 2027-02-10).
Prerequisites: SSA from Module 4. Importance:★★★★★

What: change overview (verified against the v4.3.2 source and the helm.sh Helm 4 Overview)

AreaHelm 3Helm 4.3Impact on scripts
Rollback on failure--atomic--rollback-on-failure; --atomic still works, printing Flag --atomic has been deprecated, use --rollback-on-failure insteadworks; renaming is recommended; note that it implicitly --wait=watcher
force replace--force--force-replace (--force is deprecated); new --force-conflicts (SSA), mutually exclusive withstill runs; semantics unchanged (delete and recreate)
Wait--wait boolean; legacy readiness check--wait = watcher (kstatus); --wait=hookOnly (default when omitted); --wait=legacy; --wait=true/false is deprecated with a warningReadiness criteria changed: CRD resources that have standard conditions are also waited on
Apply methodClient-side three-way mergeNew installs default to SSA; existing releases follow their record (auto)New conflict errors may appear (Module 4)
dry-run--dry-run (= client),--dry-run=servernone|client|server; without a value, it is treated as client with a warningexplicitly write the value
template validationhelm template --validatedeprecated, suggests using --dry-run=serverreplace
post-renderer--post-renderer ./kustomize.sh (executable path)--post-renderer <plugin name>, plugin type postrenderer/v1; --post-renderer-args argument passingbreaking: old scripts fail outright
Pluginplugin.yaml + executableNew plugin format (apiVersion: v1,type,runtime: subprocess|extism/v1); old format still loads; helm plugin install default --verify=trueInstalling a plugin from a Git repository URL requires --verify=false
registry logina full URL can be writtenonly accepts domain names (host[:port])remove oci:// and the path
helm status--show-resources,--show-descv4.3.2's helm status defines only --revision (and common output parameters); DESCRIPTION always showsdelete these two parameters (based on helm status --help )
installation scripts / SDKget-helm-3; helm.sh/helm/v3get-helm-4; Go module helm.sh/helm/v4update images and dependencies
ChartapiVersion v2apiVersion v2 is unchanged (v3 still needs HELM_EXPERIMENTAL_CHART_V3)The chart does not need to change

Why: why migrate now

Helm official blog (Helm 3 End of Life): Helm 3's bug fixes end with its last feature release 3.22 (2026-09-09) ends; security fixes continue until 2027-02-10 (extended from the originally planned 2026-11). After that, Helm 3 gets no CVE fixes. Today (2026-11) is about 3 months before the cutoff, and the following must be completed: tool image upgrades, script parameter corrections, post-renderer plugin conversion, GitOps tool compatibility confirmation, and (optionally) migration of existing releases to SSA.

How: the three strategies of --wait

FormStrategyBehavior
Not writtenhookOnlywaits only for hooks (same as Helm 3 when --wait is not written)
--wait or --wait=watcherkstatus observationjudges Current based on the resource's status/conditions; error messages include the resource and status
--wait=legacyHelm 3 readiness checkFor transition use; behavior matches Helm 3's --wait closely.
--rollback-on-failureDefaults to watcher when --wait is not specifiedOn failure, rolls back to the most recent deployed/superseded revision (for install, uninstalls)

When: post-renderer plugin conversion example

apiVersion: v1
type: postrenderer/v1
name: kustomize-pr
version: 0.1.0
runtime: subprocess
runtimeConfig:
  platformCommand:
    - command: "${HELM_PLUGIN_DIR}/run.sh"
#!/usr/bin/env sh
# Read the rendered output from stdin and output the modified manifests
cat > "$HELM_PLUGIN_DIR/all.yaml"
kubectl kustomize "$HELM_PLUGIN_DIR"

The plugin directory location follows helm env HELM_PLUGINS ; it can also be placed in any directory, then helm plugin install ./kustomize-pr (installation from a local directory is treated as development mode, and signatures are not verified). For field details, follow Migrate v3 Plugins to Helm 4 and HIP-0026.

Common misconceptions① “Helm 4 requires rewriting all charts” — chart API v2 is unchanged. ② “Renamed parameters also work in Helm 3.22” —--rollback-on-failure,--force-replace are Helm 4 parameters; a script that must support both versions needs version branching. ③ “Upgrading the helm binary automatically switches releases to SSA” — no (Module 4). ④ “Wasm plugins are required” — old subprocess plugins keep working; Wasm is an optional runtime.

Migration roadmap

① Inventoryscripts / plugins / toolshow releases are applied ② Fix scriptsparameter renames, --waitexplicit values for --dry-run ③ Pluginspost-rendererplugin signature verification policy ④ Dual-run verificationhelm3 vs helm4diff of template output ⑤ Cut overCI images switch to Helm 4optional: SSA migration 2025-11 Helm 4.0 2026-09-09 Helm 3.22 (last feature release) 2026-11-13 Helm 4.3.2 2027-02-10 Helm 3 security-fix cutoff Timeline not to scale
Figure 7-1: five-step migration and key dates

Interactive: CI script migration scanner

Paste your Helm 3-era CI scripts (or use the example) and click scan. The scanner gives each line a risk level and modification suggestion based on the v4.3.2 parameter definitions (a regex-based teaching tool; it cannot replace actually running under Helm 4).

Core commands

Helm 3 syntaxHelm 4.3 syntax
helm upgrade --install x c --atomic --timeout 10mhelm upgrade --install x c --rollback-on-failure --wait=watcher --timeout 10m
helm upgrade x c --forcehelm upgrade x c --force-replace (or when SSA conflicts --force-conflicts)
helm upgrade x c --wait=truehelm upgrade x c --wait (= watcher), or during the transition period --wait=legacy
helm install x c --dry-runhelm install x c --dry-run=client or =server
helm template x c --validatehelm install x c --dry-run=server
--post-renderer ./kustomize.sh--post-renderer kustomize-pr (plugin name)
helm registry login oci://reg.example.com/chartshelm registry login reg.example.com
helm plugin install https://github.com/databus23/helm-diffsame as above, and add --verify=false (Git sources do not support signature verification), or switch to a tarball / OCI source with a .prov file
helm status x --show-resourceshelm status x (for resources use kubectl get all -l app.kubernetes.io/instance=x)
curl … get-helm-3 | bashcurl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-4 | bash
# Wrapper function compatible with two major versions (for use during the transition)
helm_deploy() {
  local major; major=$(helm version --template '{{.Version}}' | sed -E 's/^v([0-9]+).*/\1/')
  if [ "$major" -ge 4 ]; then
    helm upgrade --install "$@" --rollback-on-failure --wait=watcher
  else
    helm upgrade --install "$@" --atomic --wait
  fi
}
helm_deploy fb ./faultbox -n faults --timeout 5m

Lab 7: Side-by-side comparison of Helm 3 and Helm 4 (about 7 minutes)

Parameter warnings:
cd ~/helm-lab
helm upgrade fb ./faultbox -n faults --atomic --timeout 2m 2>&1 | head -3
helm upgrade fb ./faultbox -n faults --force --dry-run=server 2>&1 | head -2
helm upgrade fb ./faultbox -n faults --wait=true --timeout 2m 2>&1 | grep -i deprecated
helm install x ./faultbox --dry-run 2>&1 | grep -i deprecated
Flag --atomic has been deprecated, use --rollback-on-failure instead
Release "fb" has been upgraded. Happy Helming!
...
Flag --force has been deprecated, use --force-replace instead
... level=WARN msg="--wait=true is deprecated (boolean value) and can be replaced with --wait=watcher"
... level=WARN msg="--dry-run is deprecated and should be replaced with '--dry-run=client'"
post-renderer: old syntax fails:
printf '#!/bin/sh\ncat\n' > /tmp/pr.sh && chmod +x /tmp/pr.sh
helm template fb ./faultbox --post-renderer /tmp/pr.sh >/dev/null
Error: invalid argument "/tmp/pr.sh" for "--post-renderer" flag: plugin: {Name:/tmp/pr.sh Type:postrenderer/v1} not found

The exact error format follows the actual output; the key point is that Helm 4 looks up the argument as a plugin name.

post-renderer: plugin syntax (adds a label to all resources):
mkdir -p /tmp/add-label
cat > /tmp/add-label/plugin.yaml <<'EOF'
apiVersion: v1
type: postrenderer/v1
name: add-label
version: 0.1.0
runtime: subprocess
runtimeConfig:
  platformCommand:
    - command: "${HELM_PLUGIN_DIR}/run.sh"
EOF
cat > /tmp/add-label/run.sh <<'EOF'
#!/bin/sh
sed 's/^  labels:$/  labels:\n    migrated-by: helm4-post-renderer/'
EOF
chmod +x /tmp/add-label/run.sh
helm plugin install /tmp/add-label
helm plugin list
helm template fb ./faultbox --post-renderer add-label | grep -c migrated-by
Installing plugin from local directory (development mode)
Installed plugin: add-label
NAME       VERSION  TYPE              APIVERSION  PROVENANCE  SOURCE
add-label  0.1.0    postrenderer/v1   v1          ...         ...
4

helm plugin list 's columns follow the actual output. The sed \n substitution requires GNU sed.

Plugin signature verification:
helm plugin install https://github.com/databus23/helm-diff
Error: plugin source does not support verification. Use --verify=false to skip verification

Decide whether to trust the source before using it --verify=false; the compatibility of this plugin with Helm 4 follows its release notes.

(Optional) Helm 3 vs Helm 4 rendering and SSA comparison:
~/bin/helm3 template fb ./faultbox > /tmp/h3.yaml
helm template fb ./faultbox > /tmp/h4.yaml
diff /tmp/h3.yaml /tmp/h4.yaml && echo "Rendered output is identical"
~/bin/helm3 install h3rel ./faultbox -n faults
helm get metadata h3rel -n faults | grep APPLY_METHOD
helm upgrade h3rel ./faultbox -n faults --server-side=true
helm get metadata h3rel -n faults | grep APPLY_METHOD
helm uninstall h3rel -n faults
Rendered output is identical
APPLY_METHOD: client-side apply (defaulted)
APPLY_METHOD: server-side apply

If rendering differs, the common cause is a change in Sprig functions (Helm 4 removed env/expandenv) or .Capabilities different default values.

Case 1: Helm versions in GitOps tools

Problem: The team upgraded CI to Helm 4, but Argo CD (v3.6.1) and Flux (v2.10.0) each embed their own Helm library, independent of the CLI version. Approach: Check the release notes of Argo CD and Flux helm-controller separately to confirm their Helm library version, post-renderer support, and SSA behavior (Argo CD uses helm template to render and then applies on its own, without reading or writing Helm release records; Flux uses the Helm SDK and maintains release records). Limitation: This lesson has not verified the specific Helm version built into each; refer to their own documentation.

Case 2: Ansible and Terraform

Problem: In an Ansible playbook, kubernetes.core.helm uses atomic: true. Approach: kubernetes.core 6.6.0, on detecting Helm 4, maps atomic to --rollback-on-failure (already verified in other lessons of this repository); the Terraform helm provider uses the embedded Helm SDK, and whether it has switched to the Helm 4 SDK follows the provider's release notes.

Case 3: Conflict wave on migration day

Problem: To “unify”, all releases were switched at once with --server-side=true, and on Monday morning there were a large number of conflicts. Approach: Separate the binary upgrade from the SSA migration: first upgrade Helm (releases remain CSA, behavior unchanged); once stable, use --dry-run=server --server-side=true to rehearse each application before migrating it.

Common errors and fixes

Error: invalid argument "./kustomize.sh" for "--post-renderer" flag: plugin: … not found

Cause: Helm 4 only accepts plugin names. Fix: Wrap the script as a postrenderer/v1 plugin and install it.

Error: plugin source does not support verification. Use --verify=false to skip verification

Cause:helm plugin install Verification is on by default, but Git repositories and non-tarball HTTP sources are not supported. Fix: Use a tarball with provenance or an OCI source; once you have confirmed it is trusted, --verify=false.

Error: unknown flag: --show-resources

Cause: v4.3.2's helm status does not have this flag. Fix: Delete the flag and use kubectl to query resources by app.kubernetes.io/instance label.

Error: invalid wait input "yes". Valid inputs are watcher, hookOnly, and legacy

Cause:--wait It is now a strategy string (true/false are still compatible but emit a warning). Fix: Use --wait or --wait=watcher.

Under Helm 4, upgrading “waits” longer than Helm 3 or fails early

Cause: kstatus judges resources differently from legacy (for example, it considers the conditions of more resource types). Diagnosis: The resource and status in the error message. Fix: Correct the resource status; during the transition period you can --wait=legacy compare.

Error: login attempt to https://reg.example.com/charts failed …(registry login included a path)

Fix:helm registry login reg.example.com, write only the domain (a port may be included).

Command-line exercises
1. Find all Helm 3 syntax that needs to change in every script in the repository.
grep -rnE -- '--atomic|--force( |$)|--wait=(true|false)|--dry-run( |$)|--validate|--post-renderer +[./]|--show-resources|--show-desc|get-helm-3' \
  .github/ .gitlab-ci.yml ci/ scripts/ 2>/dev/null
2. Confirm the major Helm version in the current CI image, and print the types of all installed plugins.
helm version --template '{{.Version}}{{"\n"}}'
helm plugin list
Scenario analysis
You are responsible for migrating 40 microservices from Helm 3 to Helm 4, with a deadline before 2027-02-10. Write out your phased plan and rollback plan.

Phase 1 (inventory, 1 week): scan script parameters, post-renderers, plugins, GitOps tool versions, and SDK users; count each release's APPLY_METHOD. Phase 2 (dual run, 2 weeks): run helm3 and helm4 in parallel in CI for the template and diff them; modify scripts (version-branching wrapper functions); convert post-renderers to plugins. Phase 3 (cut over, in batches by service): switch the CI image to Helm 4 and keep releases on CSA; observe for 2 weeks. Phase 4 (optional SSA migration): migrate one by one after --dry-run=server --server-side=true rehearsal and resolving conflicts. Rollback: Helm 4 does not change the release storage format (it is still helm.sh/release.v1), and the Helm 3 binary can continue to read it; but a release already migrated to SSA, when rolled back to Helm 3, will be updated with CSA, so field ownership must be watched.

Verified instructional videos

▶
GitOps Guide to the Galaxy (Ep 111) | A belated look at Helm 4 — Red Hat
English · Live discussion of Helm 4 changes
▶
Helm 4: What’s New in the Open Source Kubernetes Package Manager? — The New Stack
English · Maintainer interview
▶
Learn About Helm And Its Ecosystem - Andrew Block & Karena Angell, Matt Farina, Scott Rigby — CNCF [Cloud Native Computing Foundation]
English · Maintainer introduction to the Helm ecosystem (recorded before or around the time of Helm 4; this lesson prevails on details)

Official documentation

Video storyboard (about 90 seconds)

Shot 1 · 0–20s
Visual: timeline showing the last feature release, Helm 3.22, and the security-fix cutoff on February 10, 2027, with a red countdown.
Narration: Helm 3's security fixes end on February 10, 2027.
Shot 2 · 20–50s
Visual: in the CI script, --atomic and --force are crossed out and replaced with --rollback-on-failure and --force-replace, with a yellow warning appearing beside them.
Narration: the old parameters still work but emit warnings; it is advisable to rename them now.
Shot 3 · 50–75s
Visual: the post-renderer's sh script is packed into a plugin box labeled postrenderer/v1.
Narration: post-renderers must become plugins; this is the most common breaking change.
Shot 4 · 75–90s
Visual: checklist items are ticked off one by one.
Narration: inventory, update scripts, convert to plugins, dual-run verification, cut over in batches.
or score ≥ 70% in the “Quiz”

Module 8 · Mixed Fault Blind Box

52:00 – 60:00 · 8 real faults injected at random: look only at the symptoms, then locate, fix and review using the seven-layer model and this lesson's tools
8 minutesfault-box.shInteractive troubleshooting tree★★★★★
Learning Objectives
  • Without knowing the fault type in advance, complete the diagnosis following “symptom → layer → evidence → root cause → fix → prevention”.
  • Cover 8 faults: stuck releases, failed hooks, SSA conflicts, selector changes, CRDs not updated, oversized releases, unexpected values merging, and Helm 3 parameter differences under Helm 4.
  • After each fix, be able to state one preventive measure (a CI check, chart convention or process).
Prerequisites: Modules 1–7. Importance:★★★★★

What: overview of the 8 faults

#FaultFirst symptomLayerKey evidenceFixPrevention
1Stuck releaseanother operation (install/upgrade/rollback) is in progress⑦helm history Last line pending-upgraderollback to the last deployedCI timeout > Helm timeout; serialize
2Failed hook (no evidence)pre-upgrade hooks failed, the Job no longer exists⑤helm get hooks in hook-failed policy; eventsadd output-log-policy and rerun, fix the scriptdefault before-hook-creation,hook-succeeded
3SSA conflictApply failed with 1 conflict: conflict with "ops-hotfix"⑤managedFieldswrite back to values, or --force-conflictsban manual edits; HPA fields are not rendered
4Selector changespec.selector: Invalid value … field is immutable⑤helm get manifest before/after diffrevert the selector change; when it must change, --force-replace (interrupt) or blue-green with a new nameselector helper is never modified
5CRD not updatednew CR field reports unknown field or is pruned④kubectl get crd -o yaml and crds/ comparedkubectl apply --server-side -f crds/ , then upgrademanage CRDs independently
6Oversized releasedata: Too long: must have at most 1048576 bytes⑦tar -tzvf largest file.helmignorecheck package size in CI
7Unexpected values mergeupgrade “succeeds”, but replica count and annotations revert to defaults②helm get values --revision before/after comparisonalways pass the complete -f; or --reset-then-reuse-valueskeep the values files in Git; forbid using only --set
8Helm 3 parameter differencesdeprecation warning + --post-renderer plugin not found①③stderr warning, scriptrename + convert to plugininclude the migration scan in CI

Why: the mechanism of fault 7 (the easiest to overlook)

v4.3.2 Upgrade.reuseValues: if this does not provide any values (without -f, no --set), Helm automatically reuses the user values from the previous revision; as soon as any one of --set is provided, the previous user values are no longer used at all; rendering uses the chart defaults plus this run's parameters. --reuse-values will reuse the previous values, but at the same time replace the chart defaults with those of the old chart (defaults newly added in the new chart version will not take effect); --reset-then-reuse-values Using the new chart defaults and overlaying the previous user values is usually the intended semantics.

How: diagnostic cadence (≤ 3 minutes per fault)

  1. Read the full error message and determine the layer (Module 1).
  2. helm history + helm get metadata: what state is the release in?
  3. Gather evidence: events / managedFields / get values / get manifest / tar listing.
  4. Fix and verify: helm history The last line is deployed, and the resources match expectations.
  5. Write one line of prevention.
Common misconceptions① “Fault 4 is fixed just by using --force-replace just”—it deletes and recreates the Deployment, which causes a brief outage and makes all Pods restart at the same time. ② “Fault 7 is a Helm bug” — it is a documented behavior. ③ “Fault 5 can be fixed by reinstalling to update the CRD” — CRDs already present in crds/ are skipped even on install.

Where the 8 faults sit in the seven-layer model

① Fetch ② values ③ Render ④ API validation ⑤ Apply ⑥ Wait ⑦ Record #8 parameters/scripts #7 unexpected values #8 post-renderer #5 CRD not updated #2 hook · #3 SSA#4 selector (the trigger for #1) #1 pending#6 Too long Has the cluster been modified? #1, #3 (partially), #4 (no, rejected), #7 (yes, and “succeeds”) — answer this question before taking any action#2 pre hook failure: unchanged; #5: rejected; #6: fails when creating the pending record, unchanged; #8: depends on which step fails
Figure 8-1: fault distribution and “whether the cluster has been modified”

Interactive: in-browser fault blind box simulator

Click “Draw a fault”; you will only see the symptoms that appear in the CI log. Select diagnostic commands to view their output, then judge the root cause; a correct answer reveals the fix steps. Scores are saved in this browser.

$ ./deploy.sh # click the button above to start

fault-box.sh: inject faults randomly on kind

Save as ~/helm-lab/fault-box.sh,chmod +x. Requires Module 0 to be completed (faultbox chart, release fb, namespace faults). The script modifies ~/helm-lab/faultbox, and on first run backs it up to faultbox.orig.

#!/usr/bin/env bash
# Lesson 7 mixed fault blind box: ./fault-box.sh random | N | reveal | reset
set -uo pipefail
NS=faults; REL=fb; LAB=~/helm-lab; CH=$LAB/faultbox; ANS=$LAB/.faultbox-answer
[ -d "$LAB/faultbox.orig" ] || cp -r "$CH" "$LAB/faultbox.orig"

restore_chart() { rm -rf "$CH" && cp -r "$LAB/faultbox.orig" "$CH"; }
base() {
  restore_chart
  LAST=$(helm history $REL -n $NS -o json 2>/dev/null | jq -r '[.[]|select(.status=="deployed")][-1].revision // empty')
  if helm history $REL -n $NS --max 1 2>/dev/null | grep -q pending; then helm rollback $REL "$LAST" -n $NS --wait >/dev/null; fi
  helm upgrade --install $REL "$CH" -n $NS --reset-values --force-conflicts --wait --timeout 3m >/dev/null
  kubectl -n $NS delete job -l app.kubernetes.io/instance=$REL --ignore-not-found >/dev/null
  kubectl -n $NS delete widget --all --ignore-not-found >/dev/null 2>&1
}

f1() { # Stuck release: SIGKILLed while waiting
  helm upgrade $REL "$CH" -n $NS --set image.tag=does-not-exist --wait --timeout 10m >/dev/null 2>&1 &
  local p=$!; sleep 8; kill -9 $p 2>/dev/null; wait $p 2>/dev/null
  echo 'helm upgrade fb ~/helm-lab/faultbox -n faults --set replicaCount=2' > $LAB/next.sh; }
f2() { # Failed hook, deletion policy hook-failed
  cat > $LAB/next.sh <<'EOF'
helm upgrade fb ~/helm-lab/faultbox -n faults --set hook.enabled=true,hook.fail=true,hook.deletePolicy=hook-failed --timeout 90s
EOF
}
f3() { # SSA conflict
  kubectl -n $NS patch deploy $REL-faultbox --field-manager=ops-hotfix --type=merge -p '{"spec":{"replicas":3}}' >/dev/null
  echo 'helm upgrade fb ~/helm-lab/faultbox -n faults' > $LAB/next.sh; }
f4() { # Selector change
  sed -i '/define "faultbox.selectorLabels"/a tier: web' "$CH/templates/_helpers.tpl"
  echo 'helm upgrade fb ~/helm-lab/faultbox -n faults' > $LAB/next.sh; }
f5() { # CRD not updated: the chart's crds/ added a color field, and the templates start using it
  sed -i 's/size: {type: integer}/size: {type: integer}\n                color: {type: string}/' "$CH/crds/widgets.yaml"
  echo 'helm upgrade fb ~/helm-lab/faultbox -n faults --set widget.enabled=true,widget.color=blue' > $LAB/next.sh; }
f6() { # Oversized release
  mkdir -p "$CH/files" && head -c 1500000 /dev/urandom > "$CH/files/archive.dat"
  echo 'helm upgrade fb ~/helm-lab/faultbox -n faults' > $LAB/next.sh; }
f7() { # Unexpected values merge: production values were installed with -f, and later someone upgraded with only --set
  printf 'replicaCount: 3\npodAnnotations:\n  team: payments\n' > $LAB/prod-values.yaml
  helm upgrade $REL "$CH" -n $NS -f $LAB/prod-values.yaml --wait >/dev/null
  echo 'helm upgrade fb ~/helm-lab/faultbox -n faults --set image.tag=1.16.0 --wait' > $LAB/next.sh; }
f8() { # Deployment script from the Helm 3 era
  printf '#!/bin/sh\ncat\n' > $LAB/add-label.sh; chmod +x $LAB/add-label.sh
  echo 'helm upgrade fb ~/helm-lab/faultbox -n faults --atomic --force --wait=true --timeout 2m --post-renderer ~/helm-lab/add-label.sh' > $LAB/next.sh; }

case "${1:-random}" in
  reset)  base; rm -f $ANS $LAB/next.sh; echo "Reset to clean baseline";;
  reveal) echo "Injected fault number this round: $(cat $ANS 2>/dev/null || echo none)";;
  random|[1-8])
    base
    n=${1:-random}; [ "$n" = random ] && n=$(( RANDOM % 8 + 1 ))
    echo $n > $ANS; f$n
    echo "Fault injected. Run the deploy command below and start diagnosing:"; cat $LAB/next.sh;;
  *) echo "Usage: $0 random|1..8|reveal|reset"; exit 1;;
esac

The script uses GNU sed and jq. reset Restores the chart, clears pending, forcibly takes back fields and deletes the hook Job. After fault 5 is injected, even after reset the CRD in the cluster may still keep the color field (adding an optional field is harmless).

Lab 8: Blind box drill (about 3 minutes per round, at least 4 rounds)

Draw and run the deploy command:
cd ~/helm-lab && chmod +x fault-box.sh
./fault-box.sh random
bash next.sh
Fault injected. Run the deploy command below and start diagnosing:
helm upgrade fb ~/helm-lab/faultbox -n faults
Error: UPGRADE FAILED: ...
Standard diagnostic kit (run this set first in every round):
helm history fb -n faults --max 4
helm get metadata fb -n faults | grep -E 'STATUS|APPLY_METHOD'
kubectl -n faults get events --sort-by=.lastTimestamp | tail -5
kubectl -n faults get deploy,job,widget 2>/dev/null
Dig deeper as needed:
helm get values fb -n faults --revision $(( $(helm history fb -n faults -o json | jq '.[-1].revision') - 1 ))
kubectl -n faults get deploy fb-faultbox -o json | jq -r '.metadata.managedFields[] | "\(.manager) \(.operation)"'
helm get hooks fb -n faults | grep -E 'hook|policy'
kubectl get crd widgets.lab.example.com -o jsonpath='{.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties}{"\n"}'
helm package faultbox -d /tmp >/dev/null 2>&1; tar -tzvf /tmp/faultbox-0.1.0.tgz | sort -k3 -n | tail -2
Fix, verify, reset: write down your judgment, then run ./fault-box.sh reveal verify the number, follow the fix column on the Theory page, and confirm helm history the last line is deployed, then ./fault-box.sh reset move on to the next round.
Record table (copy into your notes):
Round | Symptom (one sentence) | Layer identified | Key evidence command | Root cause | Fix | Prevention | Time spent
1    |               |          |              |      |      |      |
2    |               |          |              |      |      |      |

Case 1: One release stacked three faults

Problem: A release that changed the selector label (#4) was run under --wait --timeout 20m , and the CI job hit the 15-minute timeout and was force-killed (#1); the on-call engineer used --set to retry with only the image changed (#7). Approach: First unlock (roll back to the last deployed), then use the complete values file to revert the selector change. Lesson: When multiple faults stack, handle them layer by layer from the bottom up (⑦ → ⑤ → ②).

Case 2: The selector “must” change

Problem: Compliance requires a unified labeling scheme, so the Deployment selector must be changed. Approach: Do not change it on the original release; deploy a new Deployment under a new fullname (with the new selector), let the Service selector temporarily match both the old and new labels during the transition, and delete the old Deployment after traffic is switched. Limitation: Requires the chart to support fullnameOverride, and temporarily doubles resources.

Case 3: Turning the blind box into new-hire training

Approach: The platform team randomly injects one fault per week in a shared kind environment; new members diagnose within a time limit, and post-mortem records are accumulated into a question bank for Lesson 8. Effect: The average time to “locate the layer” during real incidents was noticeably reduced (self-reported by the team, not quantitatively verified).

Interactive troubleshooting tree: deep Helm faults

Choose step by step starting from the symptom you see; leaf nodes give the diagnostic commands and fixes.

Command-line exercises
1. Compare the user values of the last two revisions of fb, and determine whether an “unexpected values merge” occurred.
N=$(helm history fb -n faults -o json | jq '.[-1].revision')
diff <(helm get values fb -n faults --revision $((N-1))) <(helm get values fb -n faults --revision $N)
2. Before upgrading, check whether the CRDs match the chart's crds/.
kubectl diff --server-side -f ~/helm-lab/faultbox/crds/
Scenario analysis
The upgrade reports spec.selector field is immutable. A colleague says “just add --force-replace”. Evaluate this and give your plan.

--force-replace It deletes and recreates the Deployment: all old Pods are deleted, new Pods start from zero, and the service is unavailable in the meantime (a PDB does not protect against deleting the whole Deployment). First confirm why the selector changed (most often a helper was changed by mistake or a label changed due to a chart upgrade), and revert it if possible. If it truly must change, use a new name with parallel deployment and Service cutover, or accept the downtime within a maintenance window and then use force-replace.

Verified instructional videos

▶
helm upgrade won't update your CRDs: kube-prometheus-stack 93.0.0 #shorts — Relnx
English short video · corresponds to fault 5 (CRD not updated)
▶
You will never forget HELM after watching this. — Abhishek.Veeramalla
English · Comprehensive Helm overview, useful for review

Official documentation

Video storyboard (about 90 seconds)

Shot 1 · 0–15s
Visual: a blind box opens, 8 fault cards spin and stop on one, and its face shows only the error message.
Narration: look only at the symptoms, not the answer.
Shot 2 · 15–60s
Visual: the terminal runs helm history, get metadata and kubectl events in turn; the evidence cards are flipped over one by one.
Narration: first determine the layer, then collect evidence with the standard diagnostic kit.
Shot 3 · 60–90s
Visual: after the fix, the last line of history turns green, and the notebook table gets one line of prevention written in it.
Narration: every fix must leave one preventive measure behind.
or score ≥ 70% in the “Quiz”

Command cheat sheet

Common commands for deep troubleshooting, SSA, storage and the Helm 4 migration (Helm v4.3.2)
Layered diagnosis
helm upgrade REL CHART -n NS --debug 2>debug.log
helm template REL CHART --debug -s templates/x.yaml
helm upgrade REL CHART -n NS --dry-run=server --hide-secret
helm get all REL -n NS --revision N
helm get values REL -n NS --all
helm get metadata REL -n NS        # STATUS / APPLY_METHOD
kubectl -n NS get events --sort-by=.lastTimestamp
Stuck release
helm list -A --pending
helm history REL -n NS
kubectl -n NS get secret -l owner=helm,name=REL -L status,version,createdAt
helm rollback REL <last deployed> -n NS --wait
helm uninstall REL -n NS          # only for v1 pending-install
# Last resort (back up first):
kubectl -n NS get secret sh.helm.release.v1.REL.vN -o yaml > bak.yaml
Hooks
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "0"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-output-log-policy": hook-failed
helm get hooks REL -n NS
kubectl -n NS logs job/HOOKJOB
helm upgrade … --timeout 10m        # per operation / per hook
helm upgrade … --no-hooks           # risk: skips migrations
SSA and field ownership
kubectl get deploy X -o yaml --show-managed-fields
kubectl get deploy X -o json | jq '.metadata.managedFields[]|{manager,operation,subresource}'
helm upgrade … --force-conflicts      # take over conflicting fields
helm upgrade … --server-side=true     # CSA → SSA migration
helm upgrade … --server-side=false    # explicit CSA
helm upgrade … --force-replace        # delete and recreate (mutually exclusive with --force-conflicts)
Template debugging and performance
{{ required "x is required" .Values.x }}
{{ fail (toYaml .) }}            # dump context
# DEBUG {{ $v | toJson }}
{{ printf "%T" .Values.n }}      # int64 / float64 / string
helm template … --output-dir out/
time helm template …
HELM_PPROF_CPU_PROFILE=cpu.out helm template … ; go tool pprof -top cpu.out
Storage and cleanup
kubectl -n NS get secret sh.helm.release.v1.REL.vN -o jsonpath='{.data.release}' \
  | base64 -d | base64 -d | gunzip | jq 'keys'
helm upgrade … --history-max 5          # default 10 (HELM_MAX_HISTORY)
HELM_DRIVER=sql HELM_DRIVER_SQL_CONNECTION_STRING=postgresql://… helm list
helm uninstall REL -n NS --keep-history
helm list -n NS --uninstalled
Helm 3 → 4 comparison
Helm 3Helm 4.3
--atomic--rollback-on-failure
--force--force-replace
--wait (boolean)--wait[=watcher|hookOnly|legacy]
--dry-run--dry-run=client|server
template --validate--dry-run=server
--post-renderer ./x.sh--post-renderer PLUGIN
registry login oci://h/pregistry login h
status --show-resources(removed)
get-helm-3get-helm-4
values semantics
FormPrevious user valueschart defaults
Pass no valuesreusenew chart
--set / -fdiscardnew chart
--reuse-valuesreuseold chart
--reset-then-reuse-valuesreusenew chart
--reset-valuesdiscardnew chart

Comprehensive lab + final quiz

Inject the 8 faults one by one on kind, diagnose and fix them, and output a Helm 3 → 4 migration checklist
About 60–90 minutesLocal kind · zero cost
Scenario

You are the on-call engineer for the platform team. The company plans to migrate all release pipelines from Helm 3 to Helm 4 before 2027-02-10, and wants on-call staff to handle common Helm faults within 10 minutes. Please, in the kind cluster lab 's faults namespace, using fault-box.sh inject faults 1–8 in turn; for each fault, complete “diagnose → fix → prevent”, and finally submit two deliverables: fault diagnosis record table and Helm 3 → 4 migration checklist.

Prep: complete Module 0; save the script from the Command page of Module 8 as ~/helm-lab/fault-box.sh.
cd ~/helm-lab && chmod +x fault-box.sh && ./fault-box.sh reset
helm history fb -n faults --max 1
Faults 1–2 (release records and hooks):
./fault-box.sh 1 && bash next.sh       # expected: another operation … in progress
# Diagnose + fix: history → rollback to last deployed → re-run next.sh successfully
./fault-box.sh 2 && bash next.sh       # expected: pre-upgrade hooks failed, Job no longer exists
# Fix: add --set hook.outputLogPolicy=hook-failed and rerun to get the logs → hook.fail=false
Faults 3–4 (application layer):
./fault-box.sh 3 && bash next.sh       # expected: conflict with "ops-hotfix" … .spec.replicas
./fault-box.sh 4 && bash next.sh       # expected: spec.selector … field is immutable
# Fix 4: revert the changes to _helpers.tpl (diff -r faultbox faultbox.orig)
Faults 5–6 (CRD and size):
./fault-box.sh 5 && bash next.sh       # expected: unknown field "spec.color" (or the field is pruned)
kubectl apply --server-side -f ~/helm-lab/faultbox/crds/ && bash next.sh
kubectl -n faults get widget fb-faultbox -o jsonpath='{.spec.color}{"\n"}'   # blue
./fault-box.sh 6 && bash next.sh       # expected: data: Too long
Faults 7–8 (values and migration):
./fault-box.sh 7 && bash next.sh       # expected: succeeds, but the replica count reverts to 1 and annotations disappear
kubectl -n faults get deploy fb-faultbox -o jsonpath='{.spec.replicas}{"\n"}'
helm upgrade fb ~/helm-lab/faultbox -n faults -f ~/helm-lab/prod-values.yaml --set image.tag=1.16.0 --wait
./fault-box.sh 8 && bash next.sh       # expected: deprecation warning + post-renderer plugin not found
Output: migration checklist (copy the checklist below into the team document and fill it in item by item for your repositories):
# Helm 3 → 4 Migration Checklist (deadline: 2027-02-10, end of Helm 3 security fixes)
## A. Tools and images
- [ ] Upgrade helm in the CI image / runner to v4.3.x (get-helm-4 or package manager); record the version
- [ ] Upgrade developer machines and ops jump hosts in sync; keep the helm3 binary only for comparison
- [ ] Go programs depending on helm.sh/helm/v3 → evaluate helm.sh/helm/v4
## B. Script parameters
- [ ] --atomic → --rollback-on-failure (note that it implicitly sets --wait=watcher)
- [ ] --force → --force-replace; confirm whether delete-and-recreate is really needed
- [ ] --wait=true/false → --wait / --wait=hookOnly; evaluate kstatus judgment differences (use --wait=legacy as a transition if necessary)
- [ ] Bare --dry-run → --dry-run=client or --dry-run=server
- [ ] helm template --validate → helm install/upgrade --dry-run=server
- [ ] helm status --show-resources/--show-desc → remove
- [ ] helm registry login: write only the domain
## C. Plugins
- [ ] --post-renderer executable → postrenderer/v1 plugin (pass arguments with --post-renderer-args)
- [ ] helm plugin install: confirm whether the source supports signature verification; Git sources need --verify=false, and trust must be evaluated
- [ ] Helm 4-compatible versions of third-party plugins (diff, secrets, etc.)
## D. Apply method (SSA)
- [ ] Inventory APPLY_METHOD of all releases (helm get metadata)
- [ ] New installs default to SSA: check whether the chart still renders replicas when HPA is enabled
- [ ] Migration plan for existing releases: rehearse with --dry-run=server --server-side=true → resolve conflicts → migrate
- [ ] On-call manual: handling SSA conflicts (write back to values / --force-conflicts)
## E. GitOps and IaC tools
- [ ] Helm version bundled in Argo CD (currently v3.6.1) and post-renderer support
- [ ] Helm SDK version and SSA behavior of the Flux (currently v2.10.0) helm-controller
- [ ] Ansible kubernetes.core ≥ 6.6.0 (atomic maps to --rollback-on-failure)
- [ ] Helm SDK version used by the Terraform helm provider
## F. Operations safeguards
- [ ] CI job timeout > Helm --timeout (including hooks); serialize releases for the same release
- [ ] On the failure branch, automatically collect helm history / get all / kubectl events
- [ ] Use before-hook-creation,hook-succeeded and hook-output-log-policy: hook-failed uniformly for hooks
- [ ] Unify --history-max settings; monitor the number and size of release Secrets
- [ ] Dual run: the diff of template output between helm3 and helm4 is empty (or the differences are explained)
Cleanup:
./fault-box.sh reset
helm uninstall fb -n faults
kubectl delete namespace faults
kubectl delete crd widgets.lab.example.com
helm plugin uninstall add-label 2>/dev/null; rm -rf ~/helm-lab/faultbox.orig
Acceptance checklist

Open-ended self-test

1. Why can't Helm automatically clear the pending state?

Helm has no persistent server-side component, so it cannot tell whether the “lock-holding process” is alive or dead; automatic clearing could conflict with an upgrade that is still running. Recovery must therefore be performed by a person (or by CI that guarantees serialization) after confirming there is no concurrency, by running rollback.

2. Between SSA conflicts and CSA's “silent overwrite”, which is safer? Why do some people still find SSA troublesome?

SSA is safer: it exposes the fact that multiple managers declare the same field at the same time. It feels troublesome because drift that CSA used to hide is exposed all at once during migration, and that needs one round of governance.

3. In what situations does helm upgrade report an error even though the cluster has already been modified? Give two examples.

A post-upgrade hook fails (resources have already been applied); --wait times out (resources have been applied but are not yet ready); while SSA applies multiple resources, one conflicts partway through (earlier resources have already been updated). In these cases the revision is failed, and you must decide whether to roll back or to fix and upgrade again.

4. How can you detect an “oversized release” early in CI?

Check the .tgz size and the largest files after packaging. The memory driver or dry-run cannot detect the Secret limit, so in a pre-production environment you can decode the previous revision, compute the base64 size, and set a threshold (for example, alert at 700 KiB).

5. Which Helm 4 defaults would you write into the team standard?

explicit --wait=watcher and reasonable --timeout; --rollback-on-failure depending on the scenario; --history-max; --dry-run=server for merge-request checks; a hook annotation combination; forbid using only --set to upgrade production.

6. In a GitOps environment, which faults from this lesson will not appear, and which will appear in a different form?

Argo CD does not use release records, so there are no pending locks or 1 MiB Secret problems, but an empty lookup, hook semantic mapping and field conflicts (with other managers) still occur. The Flux helm-controller uses the Helm SDK and release records, so pending, hook and size problems can all occur, appearing as conditions on the HelmRelease status.

Sources and Version Notes

Verification basis for the technical facts in this lesson (verified on 2026-11-15 / 16)
TopicVerified conclusionSource (verification date)
Helm versionCurrently v4.3.2 (2026-11-13); Helm 4.0 was released on 2025-11-12 during KubeConCourse standard · Helm 4 Released(2026-11-15)
Helm 3 lifecycleThe last feature release is 3.22 (2026-09-09), after which bug fixes end; security fixes run until 2027-02-10 (extended from 2026-11)Helm 3 End of Life(2026-11-16)
Helm 4 changesNew installs default to SSA, Helm 3 releases default to CSA; Wasm plugin runtime; post-renderer converted to plugins (breaking); kstatus; --atomic/--force renames; helm registry login accepts only domain names; template --hide-notes/--render-subchart-notes deprecatedHelm 4 Overview(2026-11-16)
Parameter definitions--rollback-on-failure,--atomic (deprecated),--force-replace,--force (deprecated),--force-conflicts (mutually exclusive with the former two), install --server-side default true; upgrade/rollback --server-side default auto; --take-ownership,--timeout default 300s,--history-max default 10,--wait strategy watcher/hookOnly/legacy (hookOnly when omitted),--dry-run none/client/server,template --validate deprecated,helm status only --revisionHelm v4.3.2 source code pkg/cmd/{install,upgrade,rollback,template,status,flags,helpers}.go (2026-11-16)
release state machinefull set of states; errPending original text; upgrade first writes pending-upgrade ("Preparing upgrade"); SIGINT/SIGTERM handling marks the revision as failed; rollback does not check pending, and after success marks all deployed revisions as superseded; without a revision the target is current − 1; --rollback-on-failure rolls back to the most recent deployed/supersededsource pkg/action/{action,upgrade,rollback,install,uninstall}.go,pkg/release/common/status.go
hooksthree deletion policies; helm.sh/hook-output-log-policy (hook-succeeded / hook-failed), for Jobs (by the job-name label) and Pods output logs to stderr, executed before the deletion policy; hook creation under SSA is an apply patchsource pkg/release/v1/hook.go,pkg/action/hooks.go,pkg/kube/client.go;Chart Hooks
SSAfield manager helm; APPLY_METHOD shown; CSA→SSA upgrades the client field manager; conflicts report errors conflict occurred while applying object …; conflict rulessource cmd/helm/helm.go,pkg/kube/client.go,pkg/cmd/get_metadata.go;Kubernetes SSA
storagedrivers secret/configmap/memory/sql; SQL only supports postgres, tables releases_v1/custom_labels_v1,HELM_DRIVER_SQL_CONNECTION_STRING; Secret type helm.sh/release.v1, labels name/owner/status/version/createdAt/modifiedAt; JSON → gzip BestCompression → base64; history pruning keeps the last deployed; error prefix create: failed to create:source pkg/storage/driver/*.go,pkg/storage/storage.go,pkg/action/action.go,pkg/cli/environment.go
1 MiBa single Secret is at most 1 MiB; exceeding it reports data: Too long: must have at most 1048576 bytesKubernetes Secrets
values reusewithout any new values, reuses the previous user values; --reuse-values uses the old chart defaults; --reset-then-reuse-values uses the new chart defaultssource pkg/action/upgrade.go reuseValues
template engineexecution error at (…) format; include recursion limit 1000; required does not fail in lint mode; DNS disabled by default; HELM_PPROF_CPU_PROFILE/HELM_PPROF_MEM_PROFILEsource pkg/engine/engine.go,pkg/cmd/profiling.go
pluginstypes cli/v1, getter/v1, postrenderer/v1; runtimes subprocess and extism/v1 (Wasm); --post-renderer looked up by plugin name; plugin install --verify default true; only tarball/OCI sources support verification, and local directories are treated as development modesource internal/plugin/*,pkg/postrenderer,pkg/cmd/plugin_install.go;Migrate v3 Plugins
EnvironmentKubernetes v1.37.1; kind v0.33.0 (kindest/node:v1.37.0); Argo CD v3.6.1; Flux v2.10.0; kubernetes.core 6.6.0 atomic mappingCourse standard (verified in other lessons of this repository, 2026-11-15)

Video verification notes

All of the videos below had their titles and channels checked via the YouTube oEmbed endpoint (https://www.youtube.com/oembed?url=…&format=json, 2026-11-15): DevOps Hint “How to use helm lint, helm –debug –dry run, and helm template | How to Troubleshoot Errors in Helm” (5tHWBVbNmq0); SP Nexa DevOps “Helm Charts Kubernetes Release Lifecycle: Upgrade, Rollback & Dependencies | Part 6” (5XnEK_aPl-U); Rahul Wagh “Helm Upgrade Command | How to use Helm Upgrade Command - Part 12” (6ua2LBzPfxo); Anton Putra “Helm Chart Hooks Tutorial: pre-install VS post-install” (405uPOSwldU); mkdev “How to use Helm Hooks for Fun and Profit” (3GwZGpme4u0); CNCF “Adopting Server Side Apply in Knative - a Case Study - Dave Protasowski, VMware” (1rlTPjQ9dco); The New Stack “Helm 4: What’s New in the Open Source Kubernetes Package Manager?” (7kaLRHmPYNM); Rahul Wagh “Complete Helm Chart Tutorial: From Beginner to Expert Guide” (DQk8HOVlumI); KodeKloud “What is Helm? | Helm Concepts Explained | KodeKloud” (kJscDZfHXrQ); Red Hat “GitOps Guide to the Galaxy (Ep 111) | A belated look at Helm 4” (0UwvPaAvjS8); CNCF “Learn About Helm And Its Ecosystem - Andrew Block & Karena Angell, Matt Farina, Scott Rigby” (8g8K7afFBP8); Relnx “helm upgrade won't update your CRDs: kube-prometheus-stack 93.0.0 #shorts” (2dAykj5LuJQ); Abhishek.Veeramalla “You will never forget HELM after watching this.” (7A5cH8iqgHU). Durations, upload dates and content details were not checked one by one. No dedicated video was found for the two topics of pending-upgrade recovery and release storage size limits, so only storyboard scripts are provided for them. All videos are in English, most were recorded in the Helm 3 era, and for details, follow this lesson and the official documentation.

Audio narration notes

The “Audio” page uses the browser's Web Speech API (en-US) to read the lecture script aloud, with English terms pronounced in en-US; the result depends on the operating system's voice packs. The environment that generated this courseware cannot call a TTS service, so no MP3 is embedded; the lecture script can be passed directly to a TTS tool to generate audio.

Known limitations

  • All commands in this lesson were written against the Helm v4.3.2 source code and official documentation, and were not actually run against a kind cluster in the environment that generated this courseware. The revision numbers, times, hashes, resource name suffixes and durations in the “expected output” are examples.
  • Error messages for kstatus wait failures and hook Job failures Message part (the message field) varies with resource type and version, so the courseware shows it as “…” or as examples.
  • Whether a new CRD field is reported at upgrade time as unknown field (strict field validation) or silently pruned by the API Server depends on the validation settings and on whether --disable-openapi-validation is used; the courseware lists both.
  • The default field manager names of each kubectl subcommand (for example kubectl-edit) and the manager name shown when HPA writes the scale subresource should follow what the cluster's managedFields actually shows; in the labs, the uniform name --field-manager=ops-hotfix is used so results are reproducible.
  • helm plugin list 's columns,--post-renderer the error format when a plugin is not found follows the actual output. Helm 3's helm status --show-resources/--show-desc does not exist in the v4.3.2 source code; please refer to helm status --help for the authoritative version.
  • The built-in Helm library versions of Argo CD, Flux and the Terraform helm provider have not been verified; the courseware only gives directions for checking them. The specific patch number of Helm 3.22 has not been verified; the example uses v3.22.0.
  • The numbers in the cases (times, counts) are illustrative and not benchmarks. Lesson 8 was written in parallel with this lesson; cross-lesson references follow the final content of each lesson.