When you deploy applications on Kubernetes, you need to install charts, update releases, roll back when something goes wrong and debug your deployments. helm is the package manager for Kubernetes: a single command covers all of it.
What you will learn
- Install Helm 4 and verify the checksum of the archive
- Install and update applications with
helm installandhelm upgrade - Manage the full lifecycle: rollback, history, removal
- Debug with
helm template,helm lintandhelm get - Manage repositories and search for charts
- Choose the options that matter in production:
--wait,--rollback-on-failureand--dry-run=server - Spot what Helm 4 changes in your existing scripts
Prerequisites
You need Helm 4 (the next section installs it) and, for the commands that query the cluster, access through kubectl. The template, lint, package and show commands work without a cluster. search repo, and show on a chart named after its repository (podinfo/podinfo), need a declared repository, which the section on helm repo takes care of; search hub, and show on a local or OCI chart, do not.
How do you install Helm 4?
To install Helm v4.3.2 on Linux x86_64, download the official archive from get.helm.sh, check its SHA-256 checksum against the .sha256sum file published next to it, then copy the helm binary into a directory on your PATH. The checksum check catches an archive corrupted during the download before you run anything.
VERSION=v4.3.2curl -fsSLO "https://get.helm.sh/helm-${VERSION}-linux-amd64.tar.gz"curl -fsSLO "https://get.helm.sh/helm-${VERSION}-linux-amd64.tar.gz.sha256sum"sha256sum -c "helm-${VERSION}-linux-amd64.tar.gz.sha256sum"tar -xzf "helm-${VERSION}-linux-amd64.tar.gz"sudo install -m 0755 linux-amd64/helm /usr/local/bin/helmsha256sum -c must answer OK for the archive: any other answer means the file does not match the checksum, and you must download it again without installing it. The .sha256sum file comes from the same server as the archive. It therefore protects against corruption, not against substitution: for that second risk, compare the checksum with the one given in the Helm release notes on GitHub.
Then check that the binary responds:
helm versionThe output must mention version v4.3.2. For another system or architecture, replace linux-amd64 with the matching combination from the download page of the Helm installation documentation.
Where does the helm command fit in the Kubernetes ecosystem?
helm is one of the Kubernetes deployment tools. It does not replace kubectl: it generates manifests from a chart (a package of parameterizable templates) and then sends them to the cluster API, keeping track of every deployment as a versioned release. That memory of revisions is what makes rollback possible, and it is what the other tools in the table do not do in the same way.
Helm is an imperative tool: it acts at the moment you run the command. Keeping the cluster continuously in sync with Git is a GitOps job, so a job for argocd or flux, and no helm subcommand does it.
Each tool has its own specialty:
| Tool | Specialty | When to use it |
|---|---|---|
helm | Manage packages (charts) | Reproducible, versioned deployments |
kubectl | Talk to the K8s API | Direct commands, debugging, inspection |
kustomize | Customize manifests | Overlays without templating |
argocd | Continuous GitOps | Automatic synchronization from Git |
flux | Continuous GitOps | Alternative to ArgoCD |
Common combinations:
# helm + kubectl: check the deploymenthelm install myapp ./chart && kubectl get pods -w
# helm template + kubectl diff: preview the changeshelm template myapp ./chart -n prod | kubectl diff -n prod -f -
# helm + grep: filter the releaseshelm list -A | grep -i nginxWhat does Helm v4 change for existing scripts?
Helm 4 keeps most of the way Helm works, but four things change in existing scripts. Almost none of them shows up in interactive use: you find them in continuous integration rather than on a workstation.
| What changes | In Helm v3 | In Helm v4 |
|---|---|---|
| Automatic rollback | --atomic | --rollback-on-failure |
| Forced replacement | --force | --force-replace |
| Post-renderer | a binary passed as a parameter | a declared plugin |
| OCI login | URL or full reference | the domain only, ghcr.io |
The first two are the least disruptive: the old names (--atomic, --force) are still accepted, with a deprecation warning on every run. The last two block: a post-renderer passed as a plain binary is no longer recognized and must become a declared plugin, and helm registry login rejects a repository path such as ghcr.io/org/charts (invalid reference: invalid registry), it wants the domain only. Before you switch, replay your pipelines on upgrade --install, --wait, --dry-run and post-rendering, which concentrate these differences.
How does the helm command work in 2 minutes?
Four words keep coming back in helm messages: repository, chart, release and values. Mixing them up quickly leads to errors, because the same command changes meaning depending on the object you give it. The definitions below are enough to read every command on this page.
General syntax
All subcommands follow the same order: the verb, the positional arguments, then the options. The order of the arguments matters, the order of the options does not, which is why you can move a -n without breaking anything.
helm [command] [arguments] [flags]Three of the global options are used all the time: every subcommand accepts them, helm create included. -n sets the namespace, --kubeconfig the configuration file that gives access to the cluster, and --kube-context the context to target (the kubeconfig entry that ties a cluster to a user).
The last one avoids a risky habit: switching the current context with kubectl config use-context before deploying. That change stays in place after the command, and the next one goes to the wrong cluster. With helm upgrade --install myapp ./chart --kube-context prod-eu, the target exists only for the duration of the command, and the script can be replayed without any preparation.
One detail that costs a lot on a first install: with no current context set and no --kube-context, Helm does not complain about a missing setting, it tries localhost:8080 and returns a terse cluster unreachable.
The five basic commands:
| Command | What it does | Example |
|---|---|---|
helm install | Deploy a chart | helm install myapp podinfo/podinfo --version 6.14.1 |
helm upgrade | Update a release | helm upgrade myapp podinfo/podinfo --version 6.14.1 |
helm list | List the releases | helm list -n prod |
helm uninstall | Remove a release | helm uninstall myapp |
helm template | Generate the manifests (debug) | helm template myapp ./chart |
The 3 key objects to understand
The same chart can be installed several times in the cluster. The release name tells the instances apart, and it is what upgrade, rollback and uninstall expect. The chart carries the default values, and the release records the ones you supplied. On an upgrade, the rule is this: if you pass no value at all, Helm reuses the old ones; as soon as you pass one (-f or --set), Helm starts again from the chart defaults, and your earlier overrides disappear unless you add --reuse-values.
| Object | Question | Examples |
|---|---|---|
| Chart | Which package to install? | podinfo/podinfo, ./my-chart/ |
| Release | What name to give the instance? | myapp, nginx-prod |
| Values | How to customize it? | -f values.yaml, --set replicas=3 |
Installing and deploying
Three commands cover the lifecycle of an application: install creates it, upgrade makes it evolve, uninstall removes it. They share most of their options, including --namespace, --values and --wait. Above all, remember that helm install fails if the name already exists: as it stands, it cannot be replayed in an automated pipeline.
helm install, deploy a chart
The release name you choose here follows you for the whole life of the application: it is the key to every other command and cannot be changed afterwards. The only remedy would be to uninstall and reinstall, and so lose the history.
helm install <release-name> <chart> [flags]Main options:
| Option | Description | Example |
|---|---|---|
-n, --namespace | Target namespace | -n production |
-f, --values | Values file | -f values-prod.yaml |
--set | Inline override | --set image.tag=v2.0 |
--create-namespace | Create the namespace | --create-namespace |
--dry-run | Simulate without applying (client or server) | --dry-run=client |
--wait | Wait until everything is ready | --wait --timeout 5m |
--rollback-on-failure | Automatic rollback on failure | --rollback-on-failure |
Common forms:
# From a repository (pinned version)helm install myapp podinfo/podinfo --version 6.14.1
# From a local charthelm install myapp ./my-chart/
# From an OCI registryhelm install myapp oci://ghcr.io/org/charts/myapp --version 1.2.3
# With customizationhelm install myapp podinfo/podinfo --version 6.14.1 \ -n production --create-namespace \ -f values-prod.yaml \ --set replicaCount=3
# Safe mode (automatic rollback on failure)helm install myapp ./chart \ --rollback-on-failure \ --timeout 5m \ --waithelm upgrade, update a release
Every successful upgrade creates a new revision in the history, even when nothing changes in the generated manifests. That increment is what makes rollback possible. Helm caps the history at 10 revisions by default: --history-max (or the HELM_MAX_HISTORY variable) changes that limit, and the value 0 removes it.
helm upgrade <release-name> <chart> [flags]Options specific to upgrade:
| Option | Description | Example |
|---|---|---|
--install | Create if it does not exist | --install (idempotent) |
--reuse-values | Keep the old values | --reuse-values |
--reset-values | Go back to the defaults | --reset-values |
--force-replace | Replace the resources instead of patching them | --force-replace |
CI/CD pattern (idempotent):
# Works whether the release exists or nothelm upgrade --install myapp ./chart \ -n production \ -f values-prod.yaml \ --rollback-on-failure \ --waitThe --reuse-values option calls for caution: it takes the values of the last release, default values of the old chart included. When you upgrade to a new chart version, the options that the new chart adds therefore do not get their default, and the options whose default it changed keep the old one.
The --reset-then-reuse-values option fixes this flaw: Helm starts again from the default values of the new chart, then reapplies those of the release and your overrides. In every case, prefer supplying your values files explicitly: they state the target state instead of deriving it from the previous one. The lesson Helm values covers how to carry values over during a version upgrade.
helm uninstall, remove a release
The operation is irreversible: without --keep-history, the revision history disappears with the release and no rollback is possible any more. The persistent volumes created by a StatefulSet, on the other hand, survive the removal and have to be cleaned up by hand.
helm uninstall <release-name> [flags]Options:
| Option | Description | Example |
|---|---|---|
-n, --namespace | Namespace of the release | -n production |
--keep-history | Keep the history | --keep-history |
--dry-run | Simulate the removal | --dry-run |
# Simple removalhelm uninstall myapp -n production
# Keep the history (allows a later rollback)helm uninstall myapp --keep-historyManaging the lifecycle
Helm stores the state of every release in Secrets of the namespace concerned, one per revision. The commands in this section read those objects: they answer "what is running", "what has changed" and "how do I go back" without ever looking at your source files. That is why they work even if you have lost the original chart.
helm list, list the releases
Without a namespace option, the command shows only the releases of the current namespace of your kubeconfig, often default. A release missing from the list is almost always somewhere else, not gone: this is a very common cause of "release not found". Since Helm 4, helm list shows releases whatever their status, and the -a (--all) option of Helm 3 no longer exists: helm list -a answers Error: unknown shorthand flag: 'a' in -a, and --all answers Error: unknown flag: --all.
helm list [flags]Filtering options:
| Option | Description | Example |
|---|---|---|
-A, --all-namespaces | All namespaces | -A |
-n, --namespace | A specific namespace | -n prod |
--deployed | Deployed releases only | --deployed |
--failed | Failed releases only | --failed |
--pending | Pending releases only | --pending |
--superseded | Superseded revisions only | --superseded |
--uninstalled | Only releases uninstalled with --keep-history | --uninstalled |
--uninstalling | Only releases being uninstalled | --uninstalling |
-o, --output | Output format | -o json |
# All the releases of the clusterhelm list -A
# Failed releaseshelm list -A --failed
# JSON format (scripting)helm list -n prod -o json | jq '.[].name'helm history, history of a release
The REVISION column gives the number to pass to helm rollback, and the superseded status simply means a revision replaced by a more recent one. Note that a rollback does not rewrite the past: it adds one more revision, which keeps an auditable trace of the operation.
helm history <release-name> [flags]# Show the historyhelm history myapp -n productionThe output is a table with six columns: REVISION, UPDATED (date of the operation), STATUS, CHART (name and version of the chart), APP VERSION and DESCRIPTION. Each line describes one revision, from the oldest to the most recent. Read STATUS first: deployed marks the active revision, superseded a replaced revision, failed an operation that failed. The DESCRIPTION column says what created the revision, for example Install complete, Upgrade complete or Rollback to 2.
helm rollback, go back
The revision number is optional: if omitted, Helm targets revision number N-1, where N is the last revision in the history, even if that one failed. It is therefore not "the last successful revision": if revisions 6 and 7 failed, a rollback without a number targets 6, which itself failed. The rollback restores the manifests and values of the target revision, but it does not roll images back to older tags if your chart uses a moving tag such as latest, since the manifest itself has not changed.
helm rollback <release-name> [REVISION] [flags]Options:
| Option | Description | Example |
|---|---|---|
--force-replace | Replace the resources instead of patching them | --force-replace |
--wait | Wait for stabilization | --wait |
--timeout | Maximum delay | --timeout 5m |
# Roll back to revision 2helm rollback myapp 2 -n production
# Roll back and waithelm rollback myapp 1 --wait --timeout 3mDebugging and validation
When a deployment goes wrong, the first question to settle is: does the problem come from the rendering of the templates, or from what Kubernetes does with them afterwards? The commands in this section answer on both sides of that boundary. template and lint work offline on the sources; get and status query the release recorded in the cluster.
helm template, generate the manifests
This is the first debugging reflex: helm template generates the Kubernetes manifests without deploying them. Give it the same -f and --set as the deployment command you are targeting: a single difference makes the preview misleading.
helm template <release-name> <chart> [flags]# See what Helm will generatehelm template myapp ./chart -f values.yaml
# Filter on a resource typehelm template myapp ./chart | grep -A 50 "kind: Deployment"
# Save for inspectionhelm template myapp ./chart -f values-prod.yaml > manifests.yaml
# Reading the cluster (version, APIs, lookup, existing resources), without creating anythinghelm template myapp ./chart --dry-run=serverhelm template works entirely on the client side: it does not contact the API, creates nothing and works without a reachable cluster. In return, it sees neither the cluster APIs, nor lookup, nor existing objects, so it can detect neither a field that the API will reject nor a conflict with what already exists. With --dry-run=server, Helm 4.3.2 checks that the cluster responds, reads its version and its APIs for the rendering, lets lookup work, and looks for conflicts with existing resources. It creates no object: an admission or quota rejection stays invisible.
Be careful: --dry-run=server does not validate the schema of the objects. With Helm v4.3.2, on a chart whose Deployment carries replicaz: 2 (unknown field) or replicas: "two" (wrong type), helm install --dry-run=server and --dry-run=client return code 0 and display the faulty manifest. To catch these faults, send the rendering to the API with helm template ./chart | kubectl apply --dry-run=server -f -: the exit code is 1, with strict decoding error: unknown field "spec.replicaz" for the unknown field and cannot unmarshal string into Go struct field DeploymentSpec.spec.replicas of type int32 for the wrong type. kubectl apply --dry-run=client catches nothing.
The real installation, on the other hand, fails. Helm then sends the objects with server-side apply, a mode in which the Kubernetes API itself checks their content. The error is .spec.replicaz: field not declared in schema, and the release stays in failed.
helm lint, validate a chart
helm lint checks the structure of the chart and the rendering of the templates with the values supplied. By default it exits successfully despite warnings: without --strict, a validation pipeline therefore lets dubious charts through without anyone noticing.
helm lint <chart-path> [flags]# Basic linthelm lint ./my-chart
# Strict mode (warnings = errors)helm lint ./my-chart --strict
# With specific valueshelm lint ./my-chart -f values-test.yamlMessage levels:
| Level | Meaning | Action |
|---|---|---|
[INFO] | Recommendation | Optional |
[WARNING] | Potential problem | To investigate |
[ERROR] | Blocking error | Must be fixed |
helm get, inspect a release
This is the command that answers "what was actually applied", as opposed to what your local files describe today. A difference between helm get manifest and helm template points to a release older than your working chart.
helm get <subcommand> <release-name> [flags]Subcommands:
| Subcommand | What it returns | Use |
|---|---|---|
manifest | Deployed manifests | See what is running |
values | Values used | Understand the config |
notes | Post-install notes | Access instructions |
hooks | Hooks run by the release | Know what ran before or after the deployment |
metadata | Release metadata (chart, version, revision, status) | Identify what is deployed |
all | Everything combined | Full debug |
# Manifests currently deployedhelm get manifest myapp -n production
# Values used (overrides only)helm get values myapp -n production
# All the values (defaults + overrides)helm get values myapp -n production --all
# Installation noteshelm get notes myapp -n productionhelm test, check that a release works
helm test is the Helm command that checks that the application works, and not merely that it is deployed. It runs the chart resources annotated helm.sh/hook: test, usually a Pod that queries the service, then returns a verdict based on their Kubernetes phase.
helm test mon-api -n demoOn success, helm test first prints the state of the release (NAME, NAMESPACE, STATUS, REVISION), then one TEST SUITE block per test run. That block gives the name of the test, Last Started, Last Completed and Phase, which is Succeeded.
On failure, the phase becomes Failed, the command returns an error and its exit code is 1, which lets you use it as a gate in a deployment pipeline. Read the Phase line of the TEST SUITE block to find out which test failed. On the demo release of the podinfo chart (tests grpc, jwt and service) whose Deployment is scaled to zero replicas, helm test --timeout 60s prints Phase: Failed for the grpc test, then Error: resource Pod/helm-demo/demo-podinfo-grpc-test-7uuul not ready. status: Failed, message: pod demo-podinfo-grpc-test-7uuul failed. Helm stops at the first failed test: the blocks of the other two tests show the results of the previous run, they are not run again.
The test Pod is not deleted after a failure, and that is intentional: its logs are the only trace of what did not work. The --logs flag saves you from fetching them by hand:
helm test mon-api -n demo --logsWith --logs, Helm adds after the report a POD LOGS: <pod> (<container>) line for every container of every test Pod, followed by what that container wrote.
helm status, state of a release
The status returned describes the Helm operation, not the health of the application: a deployed release whose pods restart in a loop stays deployed. A pending-upgrade status that no longer moves gives away an interrupted operation, and it blocks the following ones.
helm status <release-name> [flags]# Current statehelm status myapp -n production
# JSON format (scripting)helm status myapp -o json | jq '.info.status'With Helm v4.3.2, helm status shows by default a RESOURCES block (the Service, the Deployment and the related Pods of the release): the --show-resources flag no longer exists and answers Error: unknown flag: --show-resources. As long as no helm test has run, the output contains no TEST SUITE line. After a helm test, it adds a TEST SUITE block, Last Started, Last Completed, Phase for each test, placed before the NOTES.
Managing repositories
A Helm repository is nothing more than an HTTP server exposing an index.yaml that lists the charts and their versions. Helm keeps a local copy in your profile, and every search runs on that copy. These commands are used to declare the sources, refresh that cache and inspect a chart before installing it.
helm repo, manage chart sources
Repositories are specific to your workstation: they live in your local Helm configuration, not in the cluster. A continuous integration agent that does not declare them fails on a chart that is nevertheless available from your machine.
helm env shows the paths Helm uses: HELM_REPOSITORY_CONFIG for the list of repositories, HELM_CACHE_HOME for the downloaded indexes, HELM_PLUGINS for the plugins. All of them depend on the user: on Linux, the configuration and the cache are by default under ~/.config/helm and ~/.cache/helm. That is why a repository added on your workstation remains unknown to the agent.
helm repo <subcommand> [flags]Subcommands:
| Subcommand | What it does | Example |
|---|---|---|
add | Add a repo | helm repo add podinfo https://... |
list | List the repos | helm repo list |
update | Update the index | helm repo update |
remove | Remove a repo | helm repo remove podinfo |
# Add common reposhelm repo add podinfo https://stefanprodan.github.io/podinfohelm repo add prometheus-community https://prometheus-community.github.io/helm-chartshelm repo add traefik https://traefik.github.io/charts
# Update the local indexhelm repo update
# List the configured reposhelm repo listhelm search, search for charts
helm search repo reads only the local index: if the version you expect does not appear, run helm repo update first. By default the search hides development versions, which --devel brings back.
helm search <subcommand> <keyword> [flags]Two search modes:
| Mode | What it searches | Example |
|---|---|---|
repo | In your local repos | helm search repo podinfo |
hub | On Artifact Hub | helm search hub postgresql |
# In the configured reposhelm search repo podinfo
# All available versions, from newest to oldesthelm search repo podinfo --versions
# On Artifact Hub (internet)helm search hub postgresql --max-col-width 50helm show, inspect a chart
helm show values shows the keys a chart actually accepts: read it before writing your values file, because a misspelled key is silently ignored, without the slightest error.
helm show <subcommand> <chart> [flags]Subcommands:
| Subcommand | What it shows | Example |
|---|---|---|
chart | Metadata (Chart.yaml) | helm show chart podinfo/podinfo |
values | Default values | helm show values podinfo/podinfo |
readme | Documentation | helm show readme podinfo/podinfo |
all | Everything | helm show all podinfo/podinfo |
# See the default values BEFORE installinghelm show values podinfo/podinfo --version 6.14.1 > podinfo-defaults.yaml
# Check the application versionhelm show chart podinfo/podinfo --version 6.14.1 | grep appVersionPackaging and distribution
Distributing a chart of your own takes three steps: archive it, publish it, then let others fetch it. Since Helm 3.8, the recommended format is the OCI registry, the very one that hosts your container images: one registry, one authentication, the same access rules.
helm package, create a package
The archive produced is named name-version.tgz, from the name and version fields of Chart.yaml: that file is the authority, not the name of the directory. Without -d, the archive lands in the current directory.
helm package <chart-path> [flags]# Package a charthelm package ./my-chart
# With a specific versionhelm package ./my-chart --version 1.2.3
# Into a specific directoryhelm package ./my-chart -d ./releases/helm push, publish to an OCI registry
The command expects an already built .tgz archive, never a chart directory: helm package is therefore a mandatory prerequisite. The destination URL designates the parent repository, since Helm itself appends the name and the version of the chart.
helm push <chart.tgz> <registry-url># Log in to the registryhelm registry login ghcr.io
# Push the charthelm push my-chart-1.2.3.tgz oci://ghcr.io/myorg/chartshelm pull, download a chart
Fetching the chart locally is the useful reflex to audit what a publisher is going to deploy on your side, or to pin a version in your own Git repository. Without --version, Helm takes the latest stable version published, which can change from one day to the next.
helm pull <chart> [flags]# Download the .tgzhelm pull podinfo/podinfo --version 6.14.1
# Download and extracthelm pull podinfo/podinfo --version 6.14.1 --untar
# Latest stable version published (changes from one day to the next)helm pull podinfo/podinfo --untarTo check the signature of a downloaded archive, helm verify compares it with its .prov provenance file. The lesson Helm trust and provenance (in French) details the approach.
Common patterns
The five combinations below cover most of the daily work: deploy without intervention, check before acting, understand a failure, roll back and manage several environments. Each one assembles commands already described: the value lies in the order and in the choice of options.
Pattern 1, idempotent CI/CD deployment
A pipeline must produce the same result whether it runs for the first or the hundredth time, and never leave a half-applied release behind. The four options below are there for exactly that.
helm upgrade --install myapp ./chart \ -n production \ --create-namespace \ -f values-prod.yaml \ --rollback-on-failure \ --wait \ --timeout 5mWhy this pattern?
--install: creates the release if it does not exist (idempotent)--rollback-on-failure: automatic rollback on failure--wait: waits until the pods are Ready--timeout: avoids infinite hangs
Pattern 2, preview before an upgrade
Comparing the deployed state with the upcoming state avoids unpleasant surprises on a sensitive resource such as a Service or a PersistentVolumeClaim. The form below relies only on kubectl and works everywhere. The helm diff plugin from the databus23/helm-diff project makes the same comparison, but it is installed separately and Helm 4 checks the provenance of plugins by default: follow the dedicated section of its README before adding it to a pipeline.
helm template myapp ./chart -n prod -f values.yaml | kubectl diff -n prod -f -Pass -n on both sides of the pipe: without metadata.namespace in the manifests, kubectl diff compares against the current namespace of the kubeconfig, and a wrong namespace gives a false comparison. An empty output only means that no difference appears on the objects the rendering contains: an object that the new rendering has removed does not appear.
To have the API judge the manifests (schema, admission), send the rendering to kubectl apply --dry-run=server:
helm template myapp ./chart -n prod -f values.yaml | kubectl apply --dry-run=server -n prod -f -This command assumes that the prod namespace and the CRDs your resources depend on already exist in the cluster. On a first installation, it fails until you have created them. It complements helm upgrade --dry-run=server, which only reads the cluster (available APIs, lookup, existing objects) and runs no manifest through schema validation, admission or quotas.
Pattern 3, debug a failed installation
The order of the four steps is not arbitrary: it goes from the most local to the most remote, from the syntax of the chart to the cluster events. Stop as soon as a step fails: the following ones will only repeat the same symptom.
# 1. Lint the charthelm lint ./chart --strict
# 2. Check the generated manifestshelm template myapp ./chart -n production -f values.yaml > /tmp/manifests.yaml
# 3. Simulate against the cluster (reads only: no schema, no admission, no quotas)helm install myapp ./chart -n production --dry-run=server --debug
# 4. If already installed, inspecthelm status myapp -n productionhelm get manifest myapp -n productionkubectl get events -n production --sort-by='.lastTimestamp'Pattern 4, emergency rollback
During an incident, the temptation is to rerun a fixed upgrade. The rollback is safer, because it restores a combination of manifests and values already proven in production. In helm history, the revision to target is the last successful revision. After a failed upgrade, that is the previous revision, which stays deployed (the failed revision is failed, and the older ones are superseded). Avoid failed revisions. A rollback without a number targets revision N-1, which is fine when a single revision has failed in a row; otherwise, give the number.
# See the historyhelm history myapp -n production
# Roll back to the last successful revision (the one marked deployed before the failure)helm rollback myapp <revision> -n production --wait
# Checkhelm status myapp -n productionkubectl get pods -n productionPattern 5, multiple environments
Values files stack in the order you pass them: the last -f wins, key by key. A shared base file followed by one file per environment avoids duplicating the shared configuration while keeping the differences visible in Git.
# Devhelm upgrade --install myapp ./chart \ -n dev -f values-base.yaml -f values-dev.yaml
# Staginghelm upgrade --install myapp ./chart \ -n staging -f values-base.yaml -f values-staging.yaml
# Productionhelm upgrade --install myapp ./chart \ -n production -f values-base.yaml -f values-prod.yaml \ --rollback-on-failure --waitCommon pitfalls
Most Helm error messages point to a symptom, not to the cause. Two deserve particular attention: another operation in progress reveals a release stuck in pending status, to unblock before any other command; values not applied produce no error at all, only a deployment that does not look like what you expected.
| Error | Cause | Solution |
|---|---|---|
cannot reuse a name | The release already exists | Use helm upgrade --install |
release not found | Wrong namespace | Add -n namespace |
cluster unreachable (Helm tries localhost:8080) | No current context set and no --kube-context | Pass --kube-context <context> to the command |
UPGRADE FAILED: another operation in progress | Release stuck in pending-install | helm uninstall (no previous revision to go back to) |
UPGRADE FAILED: another operation in progress | Release stuck in pending-upgrade or pending-rollback | helm rollback (only wait if the operation is still running) |
| Values not applied | --reuse-values used | Supply -f values.yaml explicitly |
nil pointer evaluating | Missing value in the template | Add the value or a default in the template |
| Timeout exceeded | Pods do not start | Check kubectl describe pod |
Cheatsheet
This summary repeats the commands of the guide in a copyable form. The ones that act on a release carry an explicit -n: without it, Helm works on the current namespace of the kubeconfig, which causes errors as soon as you juggle several environments.
Deployment
upgrade --install alone covers both installation and update, and remains the form to favor in a script, since it does not assume the starting state. It is the only one of the four commands below that works whether the release exists or not.
helm install myapp ./chart -n prod -f values.yaml # Installhelm upgrade --install myapp ./chart -n prod -f values.yaml # Idempotent install/upgradehelm upgrade myapp ./chart -n prod -f values.yaml # Updatehelm uninstall myapp -n prod # RemoveInspection
These five commands change nothing: they are safe, including in production, and are the right starting point before any intervention. Running them takes a few seconds and often avoids a diagnostic mistake.
helm list -A # All the releaseshelm status myapp -n prod # State of a releasehelm history myapp -n prod # Historyhelm get values myapp -n prod --all # Values usedhelm get manifest myapp -n prod # Deployed manifestsDebug
The first two lines run without a cluster. The third, with --dry-run=server, queries the cluster (available APIs, lookup, existing objects) without sending it the manifests, and --debug also prints the computed values, which answers "where does this value come from".
helm lint ./chart --strict # Validate the charthelm template myapp ./chart -f values.yaml # Generate manifestshelm install myapp ./chart -n prod --dry-run=server --debug # Simulate with debugRepositories
This is the sequence to replay on any new machine or any new continuous integration agent, since repositories are stored locally and not in the cluster. Forgetting it produces a baffling failure on a chart that works on your machine.
helm repo add podinfo https://stefanprodan.github.io/podinfohelm repo updatehelm search repo podinfohelm show values podinfo/podinfo --version 6.14.1 > defaults.yamlRollback
Always check the history before choosing a number: helm rollback accepts any existing revision, including a revision that had failed.
helm history myapp -n prod # See the revisionshelm rollback myapp 2 -n prod --wait # Go back to revision 2Hands-on practice
The lab gives you a vitrine release (podinfo chart) whose last version upgrades failed. You first look, with helm search repo, for the latest version of the 6.14 series of the chart. You then note the number of each failed revision from the release history. Finally you go back to the last healthy revision with helm rollback, then you run the chart tests with helm test.
The validation runs helm search repo and helm history itself, compares their results with your answer files, then reads the history and the status of the release: the last revision must be a rollback deployed to the healthy revision, the application must be available and the chart tests must have succeeded.
Key takeaways
| Command | Main use |
|---|---|
helm upgrade --install | Idempotent CI/CD deployment |
helm template | Debug the generated manifests |
helm lint --strict | Validate a chart before deployment |
helm get values --all | Understand the config of a release |
helm rollback | Go back when something goes wrong |
helm template ... -n <ns> | kubectl diff -n <ns> -f - | Preview the changes |
Before every helm upgrade in production, take these four steps in this order:
helm template -n <namespace>with the same values, followed bykubectl diff -n <namespace> -f -, to see what is going to change.- The same rendering sent to
kubectl apply --dry-run=server -n <namespace> -f -, to have the API judge the manifests. The namespace and the CRDs must already exist. helm upgrade --dry-run=server, which checks that the cluster can render the chart (API,lookup, existing objects). This step validates neither the schema, nor admission, nor quotas.- Only then, the real
helm upgrade.
Knowledge check
Five questions drawn at random from the bank of this page. They check that you can read a helm command and pick the right subcommand for a given need.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Helm install: deploy and manage your releases
A new full quiz with random questions
Work again only on the questions you missed