Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Mastering the Helm command: complete reference

By updated

Improve this page

Logo Helm

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 install and helm upgrade
  • Manage the full lifecycle: rollback, history, removal
  • Debug with helm template, helm lint and helm get
  • Manage repositories and search for charts
  • Choose the options that matter in production: --wait, --rollback-on-failure and --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.

Terminal window
VERSION=v4.3.2
curl -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/helm

sha256sum -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:

Terminal window
helm version

The 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:

ToolSpecialtyWhen to use it
helmManage packages (charts)Reproducible, versioned deployments
kubectlTalk to the K8s APIDirect commands, debugging, inspection
kustomizeCustomize manifestsOverlays without templating
argocdContinuous GitOpsAutomatic synchronization from Git
fluxContinuous GitOpsAlternative to ArgoCD

Common combinations:

Terminal window
# helm + kubectl: check the deployment
helm install myapp ./chart && kubectl get pods -w
# helm template + kubectl diff: preview the changes
helm template myapp ./chart -n prod | kubectl diff -n prod -f -
# helm + grep: filter the releases
helm list -A | grep -i nginx

What 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 changesIn Helm v3In Helm v4
Automatic rollback--atomic--rollback-on-failure
Forced replacement--force--force-replace
Post-renderera binary passed as a parametera declared plugin
OCI loginURL or full referencethe 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.

Terminal window
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:

CommandWhat it doesExample
helm installDeploy a charthelm install myapp podinfo/podinfo --version 6.14.1
helm upgradeUpdate a releasehelm upgrade myapp podinfo/podinfo --version 6.14.1
helm listList the releaseshelm list -n prod
helm uninstallRemove a releasehelm uninstall myapp
helm templateGenerate 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.

ObjectQuestionExamples
ChartWhich package to install?podinfo/podinfo, ./my-chart/
ReleaseWhat name to give the instance?myapp, nginx-prod
ValuesHow 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.

Terminal window
helm install <release-name> <chart> [flags]

Main options:

OptionDescriptionExample
-n, --namespaceTarget namespace-n production
-f, --valuesValues file-f values-prod.yaml
--setInline override--set image.tag=v2.0
--create-namespaceCreate the namespace--create-namespace
--dry-runSimulate without applying (client or server)--dry-run=client
--waitWait until everything is ready--wait --timeout 5m
--rollback-on-failureAutomatic rollback on failure--rollback-on-failure

Common forms:

Terminal window
# From a repository (pinned version)
helm install myapp podinfo/podinfo --version 6.14.1
# From a local chart
helm install myapp ./my-chart/
# From an OCI registry
helm install myapp oci://ghcr.io/org/charts/myapp --version 1.2.3
# With customization
helm 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 \
--wait

helm 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.

Terminal window
helm upgrade <release-name> <chart> [flags]

Options specific to upgrade:

OptionDescriptionExample
--installCreate if it does not exist--install (idempotent)
--reuse-valuesKeep the old values--reuse-values
--reset-valuesGo back to the defaults--reset-values
--force-replaceReplace the resources instead of patching them--force-replace

CI/CD pattern (idempotent):

Terminal window
# Works whether the release exists or not
helm upgrade --install myapp ./chart \
-n production \
-f values-prod.yaml \
--rollback-on-failure \
--wait

The --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.

Terminal window
helm uninstall <release-name> [flags]

Options:

OptionDescriptionExample
-n, --namespaceNamespace of the release-n production
--keep-historyKeep the history--keep-history
--dry-runSimulate the removal--dry-run
Terminal window
# Simple removal
helm uninstall myapp -n production
# Keep the history (allows a later rollback)
helm uninstall myapp --keep-history

Managing 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.

Terminal window
helm list [flags]

Filtering options:

OptionDescriptionExample
-A, --all-namespacesAll namespaces-A
-n, --namespaceA specific namespace-n prod
--deployedDeployed releases only--deployed
--failedFailed releases only--failed
--pendingPending releases only--pending
--supersededSuperseded revisions only--superseded
--uninstalledOnly releases uninstalled with --keep-history--uninstalled
--uninstallingOnly releases being uninstalled--uninstalling
-o, --outputOutput format-o json
Terminal window
# All the releases of the cluster
helm list -A
# Failed releases
helm 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.

Terminal window
helm history <release-name> [flags]
Terminal window
# Show the history
helm history myapp -n production

The 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.

Terminal window
helm rollback <release-name> [REVISION] [flags]

Options:

OptionDescriptionExample
--force-replaceReplace the resources instead of patching them--force-replace
--waitWait for stabilization--wait
--timeoutMaximum delay--timeout 5m
Terminal window
# Roll back to revision 2
helm rollback myapp 2 -n production
# Roll back and wait
helm rollback myapp 1 --wait --timeout 3m

Debugging 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.

Terminal window
helm template <release-name> <chart> [flags]
Terminal window
# See what Helm will generate
helm template myapp ./chart -f values.yaml
# Filter on a resource type
helm template myapp ./chart | grep -A 50 "kind: Deployment"
# Save for inspection
helm template myapp ./chart -f values-prod.yaml > manifests.yaml
# Reading the cluster (version, APIs, lookup, existing resources), without creating anything
helm template myapp ./chart --dry-run=server

helm 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.

Terminal window
helm lint <chart-path> [flags]
Terminal window
# Basic lint
helm lint ./my-chart
# Strict mode (warnings = errors)
helm lint ./my-chart --strict
# With specific values
helm lint ./my-chart -f values-test.yaml

Message levels:

LevelMeaningAction
[INFO]RecommendationOptional
[WARNING]Potential problemTo investigate
[ERROR]Blocking errorMust 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.

Terminal window
helm get <subcommand> <release-name> [flags]

Subcommands:

SubcommandWhat it returnsUse
manifestDeployed manifestsSee what is running
valuesValues usedUnderstand the config
notesPost-install notesAccess instructions
hooksHooks run by the releaseKnow what ran before or after the deployment
metadataRelease metadata (chart, version, revision, status)Identify what is deployed
allEverything combinedFull debug
Terminal window
# Manifests currently deployed
helm 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 notes
helm get notes myapp -n production

helm 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.

Terminal window
helm test mon-api -n demo

On 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:

Terminal window
helm test mon-api -n demo --logs

With --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.

Terminal window
helm status <release-name> [flags]
Terminal window
# Current state
helm 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.

Terminal window
helm repo <subcommand> [flags]

Subcommands:

SubcommandWhat it doesExample
addAdd a repohelm repo add podinfo https://...
listList the reposhelm repo list
updateUpdate the indexhelm repo update
removeRemove a repohelm repo remove podinfo
Terminal window
# Add common repos
helm repo add podinfo https://stefanprodan.github.io/podinfo
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add traefik https://traefik.github.io/charts
# Update the local index
helm repo update
# List the configured repos
helm repo list

helm 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.

Terminal window
helm search <subcommand> <keyword> [flags]

Two search modes:

ModeWhat it searchesExample
repoIn your local reposhelm search repo podinfo
hubOn Artifact Hubhelm search hub postgresql
Terminal window
# In the configured repos
helm search repo podinfo
# All available versions, from newest to oldest
helm search repo podinfo --versions
# On Artifact Hub (internet)
helm search hub postgresql --max-col-width 50

helm 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.

Terminal window
helm show <subcommand> <chart> [flags]

Subcommands:

SubcommandWhat it showsExample
chartMetadata (Chart.yaml)helm show chart podinfo/podinfo
valuesDefault valueshelm show values podinfo/podinfo
readmeDocumentationhelm show readme podinfo/podinfo
allEverythinghelm show all podinfo/podinfo
Terminal window
# See the default values BEFORE installing
helm show values podinfo/podinfo --version 6.14.1 > podinfo-defaults.yaml
# Check the application version
helm show chart podinfo/podinfo --version 6.14.1 | grep appVersion

Packaging 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.

Terminal window
helm package <chart-path> [flags]
Terminal window
# Package a chart
helm package ./my-chart
# With a specific version
helm package ./my-chart --version 1.2.3
# Into a specific directory
helm 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.

Terminal window
helm push <chart.tgz> <registry-url>
Terminal window
# Log in to the registry
helm registry login ghcr.io
# Push the chart
helm push my-chart-1.2.3.tgz oci://ghcr.io/myorg/charts

helm 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.

Terminal window
helm pull <chart> [flags]
Terminal window
# Download the .tgz
helm pull podinfo/podinfo --version 6.14.1
# Download and extract
helm pull podinfo/podinfo --version 6.14.1 --untar
# Latest stable version published (changes from one day to the next)
helm pull podinfo/podinfo --untar

To 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.

Terminal window
helm upgrade --install myapp ./chart \
-n production \
--create-namespace \
-f values-prod.yaml \
--rollback-on-failure \
--wait \
--timeout 5m

Why 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.

Terminal window
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:

Terminal window
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.

Terminal window
# 1. Lint the chart
helm lint ./chart --strict
# 2. Check the generated manifests
helm 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, inspect
helm status myapp -n production
helm get manifest myapp -n production
kubectl 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.

Terminal window
# See the history
helm 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
# Check
helm status myapp -n production
kubectl get pods -n production

Pattern 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.

Terminal window
# Dev
helm upgrade --install myapp ./chart \
-n dev -f values-base.yaml -f values-dev.yaml
# Staging
helm upgrade --install myapp ./chart \
-n staging -f values-base.yaml -f values-staging.yaml
# Production
helm upgrade --install myapp ./chart \
-n production -f values-base.yaml -f values-prod.yaml \
--rollback-on-failure --wait

Common 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.

ErrorCauseSolution
cannot reuse a nameThe release already existsUse helm upgrade --install
release not foundWrong namespaceAdd -n namespace
cluster unreachable (Helm tries localhost:8080)No current context set and no --kube-contextPass --kube-context <context> to the command
UPGRADE FAILED: another operation in progressRelease stuck in pending-installhelm uninstall (no previous revision to go back to)
UPGRADE FAILED: another operation in progressRelease stuck in pending-upgrade or pending-rollbackhelm rollback (only wait if the operation is still running)
Values not applied--reuse-values usedSupply -f values.yaml explicitly
nil pointer evaluatingMissing value in the templateAdd the value or a default in the template
Timeout exceededPods do not startCheck 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.

Terminal window
helm install myapp ./chart -n prod -f values.yaml # Install
helm upgrade --install myapp ./chart -n prod -f values.yaml # Idempotent install/upgrade
helm upgrade myapp ./chart -n prod -f values.yaml # Update
helm uninstall myapp -n prod # Remove

Inspection

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.

Terminal window
helm list -A # All the releases
helm status myapp -n prod # State of a release
helm history myapp -n prod # History
helm get values myapp -n prod --all # Values used
helm get manifest myapp -n prod # Deployed manifests

Debug

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".

Terminal window
helm lint ./chart --strict # Validate the chart
helm template myapp ./chart -f values.yaml # Generate manifests
helm install myapp ./chart -n prod --dry-run=server --debug # Simulate with debug

Repositories

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.

Terminal window
helm repo add podinfo https://stefanprodan.github.io/podinfo
helm repo update
helm search repo podinfo
helm show values podinfo/podinfo --version 6.14.1 > defaults.yaml

Rollback

Always check the history before choosing a number: helm rollback accepts any existing revision, including a revision that had failed.

Terminal window
helm history myapp -n prod # See the revisions
helm rollback myapp 2 -n prod --wait # Go back to revision 2

Hands-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

CommandMain use
helm upgrade --installIdempotent CI/CD deployment
helm templateDebug the generated manifests
helm lint --strictValidate a chart before deployment
helm get values --allUnderstand the config of a release
helm rollbackGo 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:

  1. helm template -n <namespace> with the same values, followed by kubectl diff -n <namespace> -f -, to see what is going to change.
  2. 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.
  3. 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.
  4. 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

5 questions
5 min
80% to pass

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