Skip to main content

Containers and Kubernetes · Intermediate · 22 min

Install, upgrade and roll back third-party apps with Helm

By Padding · Updated 18 Nov 2026
Ubuntu 26.04 · Helm 4.3.2 · helm-diff 3.15.15 · kubeconform 0.8.0 · Kubernetes 1.37 on kind 0.33

You will install metrics-server on a kind cluster from a pinned Helm chart with a short values file of your own, preview and apply an upgrade, watch Helm 4 undo a failed one, and roll back by hand.

On this page

Most of what runs in a cluster was written by someone else: metrics collectors, certificate managers, gateways, databases. Their maintainers usually ship a Helm chart, and installing one is a single command. The work is in what comes after. Which version did you install? Which settings did you change from the defaults, and why? What will the next version change, and how do you get back if it breaks?

This tutorial treats a third-party chart the way you would treat a dependency in code. You install metrics-server, the component that feeds kubectl top and the Horizontal Pod Autoscaler, from its official chart. You pin the chart version, keep your changes in a short values file, check the rendered YAML against the Kubernetes 1.37 schemas, preview an upgrade with the helm-diff plugin, let Helm 4 undo an upgrade that fails, and roll back by hand. The last step covers charts that ship CustomResourceDefinitions, which Helm handles differently.

Everything lives in ~/helm-apps-demo. The cluster steps need the kind cluster from the prerequisites; the rest works offline once the charts and schemas are downloaded.

Step 1 · Install Helm and kubeconform

Helm 4.3.2 is the current release. kubeconform 0.8.0 checks rendered YAML against the official Kubernetes API schemas without a cluster. If you followed /tutorials/package-an-app-as-a-helm-chart you already have both and can skip to the check.

The commands work on Linux and macOS, on Intel or Arm. They download each archive and its published checksum, check the archive before unpacking it, and install the binaries in /usr/local/bin:

Bash
cd "$(mktemp -d)"
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
case "$(uname -m)" in
  x86_64) ARCH=amd64 ;;
  aarch64|arm64) ARCH=arm64 ;;
  *) echo "No release for CPU type $(uname -m)"; false ;;
esac
if command -v sha256sum >/dev/null; then SUM="sha256sum"; else SUM="shasum -a 256"; fi

HELM=4.3.2
curl -fsSLO "https://get.helm.sh/helm-v${HELM}-${OS}-${ARCH}.tar.gz"
curl -fsSLO "https://get.helm.sh/helm-v${HELM}-${OS}-${ARCH}.tar.gz.sha256sum"
$SUM -c "helm-v${HELM}-${OS}-${ARCH}.tar.gz.sha256sum"

KUBECONFORM=0.8.0
curl -fsSLO "https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM}/kubeconform-${OS}-${ARCH}.tar.gz"
curl -fsSLO "https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM}/CHECKSUMS"
grep " kubeconform-${OS}-${ARCH}.tar.gz$" CHECKSUMS | $SUM -c

tar xzf "helm-v${HELM}-${OS}-${ARCH}.tar.gz"
tar xzf "kubeconform-${OS}-${ARCH}.tar.gz"
sudo install -m 0755 "${OS}-${ARCH}/helm" kubeconform /usr/local/bin/

Both checksum lines end in OK. If one prints FAILED, do not install that file; download it again. Binaries installed this way get no updates from apt, so to upgrade, run the same commands with new numbers in HELM= and KUBECONFORM=.

Check it worked

Bash
helm version --short | grep '^v4\.3\.2'
kubeconform -v
mkdir -p ~/helm-apps-demo

You see something like v4.3.2+g... and v0.8.0.

Step 2 · Find the chart and pin a version

Two places hold most public charts:

  • Artifact Hub (artifacthub.io) is a search index. It does not host charts; it points at the repositories that do, and marks verified publishers and official charts. Prefer a chart published by the project itself over a repackaged copy, and check that its source link goes to the project's own repository.
  • OCI registries such as ghcr.io, quay.io or Docker Hub store charts next to container images. You refer to them by oci:// address and never run helm repo add.

You can search Artifact Hub from the terminal:

Bash
helm search hub metrics-server

The metrics-server project publishes its chart in a classic HTTP repository. Add it, refresh the index, and list the versions it offers:

Bash
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
helm repo update metrics-server
helm search repo metrics-server/metrics-server --versions

Each row has two version columns. CHART VERSION is the version of the chart's templates and defaults. APP VERSION is the metrics-server release those defaults run. They move separately: a chart release can fix a template without changing the app, and you pin the chart version, because that decides everything Helm sends to the cluster.

This tutorial installs chart 3.13.1 (metrics-server 0.8.1) first so that you have something to upgrade to 3.14.0 (metrics-server 0.9.0). Pull the pinned chart into your demo folder and read its metadata:

Bash
cd ~/helm-apps-demo
helm pull metrics-server/metrics-server --version 3.13.1
helm show chart metrics-server-3.13.1.tgz

The local .tgz is worth keeping. On a metered or prepaid mobile connection you can render, check and install from it as often as you like without downloading the chart again.

An OCI chart works the same way, with the address in place of repo/chart. cert-manager, for example, publishes its chart on quay.io:

Bash
helm show chart oci://quay.io/jetstack/charts/cert-manager --version v1.21.3

Check it worked

Bash
cd ~/helm-apps-demo
helm search repo metrics-server/metrics-server --versions | grep -E '3\.14\.0|3\.13\.1'
ls metrics-server-3.13.1.tgz
helm show chart metrics-server-3.13.1.tgz | grep -E '^(version|appVersion):'

The search lists both 3.14.0 and 3.13.1, the file is in the folder, and helm show chart prints version: 3.13.1 and appVersion: 0.8.1. The cert-manager command printed a Chart.yaml with name: cert-manager and version: v1.21.3, pulled straight from the registry.

Step 3 · Start a short values file

Every chart has a values.yaml of defaults. A common mistake is to copy all of it into your own file and edit a line or two. The result is hundreds of lines in which nobody can tell your two changes from the chart's defaults, and it silently pins old defaults the next time the chart improves them. Look at the defaults, and write down only what you change:

Bash
cd ~/helm-apps-demo
helm show values metrics-server-3.13.1.tgz | wc -l
helm show values metrics-server-3.13.1.tgz | grep -n -A6 -E '^(defaultArgs|args|resources):'

The chart already passes sensible flags in defaultArgs and leaves args empty for you. On kind you need one extra flag. Each kubelet serves its stats over HTTPS with a self-signed certificate that the cluster CA did not sign, so metrics-server refuses to connect until you add --kubelet-insecure-tls. That is acceptable on a cluster that lives on your laptop and never on a shared or production one, where the fix is kubelet serving certificates signed by the cluster CA. Write the values file, with a comment on every line that would surprise the next reader:

Bash
cd ~/helm-apps-demo
cat > values-kind.yaml <<'YAML'
# metrics-server on a local kind cluster.
# Only what differs from the chart defaults. Chart version is pinned on the command line.

# kind's kubelets use self-signed serving certificates. Local clusters only.
args:
  - --kubelet-insecure-tls

# Smaller than the chart's 100m / 200Mi request, to fit a laptop cluster.
resources:
  requests:
    cpu: 50m
    memory: 64Mi
  limits:
    memory: 256Mi
YAML

Keep this file in Git next to your other cluster configuration. It is the record of what you changed and why.

Check it worked

The wc -l count shows the full defaults run to a couple of hundred lines; your file is about a dozen. Confirm the chart accepts it and merges it the way you expect:

Bash
cd ~/helm-apps-demo
helm template metrics-server metrics-server-3.13.1.tgz -n metrics-server -f values-kind.yaml \
  | grep -E -- '--kubelet-insecure-tls|--metric-resolution|cpu: 50m'

You see your --kubelet-insecure-tls next to the chart's own --metric-resolution=15s, which shows args was added to the defaults rather than replacing them, and the cpu: 50m request.

Step 4 · Render and check the release offline

Before anything reaches a cluster, render exactly what Helm would send and validate it. helm template runs the chart's templates locally. Pass --kube-version so templates that check the cluster version render as they will on Kubernetes 1.37:

Bash
mkdir -p ~/.cache/kubeconform
cd ~/helm-apps-demo
helm template metrics-server metrics-server-3.13.1.tgz -n metrics-server \
  -f values-kind.yaml --kube-version 1.37.3 > rendered-3.13.1.yaml
grep -E '^kind:' rendered-3.13.1.yaml | sort | uniq -c
kubeconform -strict -summary -kubernetes-version 1.37.3 -cache ~/.cache/kubeconform rendered-3.13.1.yaml

-strict rejects any field the API does not define, and -cache keeps the downloaded schemas so repeat runs stay off the network.

Check it worked

The kind list shows a ServiceAccount, ClusterRoles and their bindings, a RoleBinding, a Service, a Deployment and an APIService, the object that registers the metrics.k8s.io API with the API server. kubeconform ends with a summary line containing Invalid: 0, Errors: 0. Confirm the image is the one this chart version promises:

Bash
cd ~/helm-apps-demo
grep 'image:' rendered-3.13.1.yaml
if grep -q 'registry.k8s.io/metrics-server/metrics-server:v0.8.1' rendered-3.13.1.yaml; then
  echo "image matches appVersion 0.8.1"
else
  echo "unexpected image"; false
fi

Step 5 · Install metrics-server into its own namespace

Make sure kubectl points at your kind cluster and not at anything shared:

Bash
kubectl config current-context

The answer starts with kind-. Now install. Use helm upgrade --install rather than helm install: it installs the release the first time and upgrades it every time after, so the same command works in a script or CI job whether or not the release exists:

Bash
cd ~/helm-apps-demo
helm upgrade --install metrics-server metrics-server/metrics-server \
  --version 3.13.1 \
  --namespace metrics-server --create-namespace \
  -f values-kind.yaml \
  --rollback-on-failure --timeout 3m
kubectl rollout status deployment/metrics-server -n metrics-server --timeout=120s

What each flag buys you:

  • --version 3.13.1 pins the chart. Without it Helm takes the newest version in the repository, so the same command can install something different next week.
  • --namespace metrics-server --create-namespace gives the app its own namespace, so helm list -n metrics-server and kubectl get all -n metrics-server show only this release.
  • --rollback-on-failure is Helm 4's name for what Helm 3 called --atomic. The old flag still works but prints a deprecation warning. It makes Helm wait for the release to become ready, and if it does not within --timeout, undo it: an install is removed, an upgrade is rolled back to the last good revision.

Helm 4 also installs new releases with server-side apply, so the API server records Helm as the owner of every field it sets. If someone later changes one of those fields with kubectl edit, the next upgrade reports a conflict instead of quietly overwriting it.

metrics-server needs about a minute to collect its first samples. Then ask for figures:

Bash
kubectl top nodes
kubectl top pods -A

Check it worked

Bash
helm list -n metrics-server
helm get values metrics-server -n metrics-server

helm list shows the release with REVISION 1, STATUS deployed, CHART metrics-server-3.13.1 and APP VERSION 0.8.1. helm get values prints only your values file, which is a quick way to see what someone changed on a release you did not install. kubectl top nodes prints CPU in millicores and memory for each node. If it says Metrics API not available after two minutes, kubectl logs -n metrics-server deployment/metrics-server usually shows an x509 error, which means --kubelet-insecure-tls did not reach the pod.

Step 6 · Preview the upgrade before you run it

Chart 3.14.0 is out. Before you upgrade, find out what it will change. Start offline, by rendering the new version with the same values and comparing it to what you rendered for 3.13.1:

Bash
cd ~/helm-apps-demo
helm pull metrics-server/metrics-server --version 3.14.0
helm template metrics-server metrics-server-3.14.0.tgz -n metrics-server \
  -f values-kind.yaml --kube-version 1.37.3 > rendered-3.14.0.yaml
kubeconform -strict -summary -kubernetes-version 1.37.3 -cache ~/.cache/kubeconform rendered-3.14.0.yaml
diff -u rendered-3.13.1.yaml rendered-3.14.0.yaml > upgrade.diff || true
grep -E '^[-+] ' upgrade.diff

diff exits with status 1 when the files differ, which is the expected result here, hence the || true. Read the chart's changelog too (helm show readme or the project's release notes): a rendered diff shows what changes, the changelog says why, and either can mention a value that was renamed or a step you must take first.

The offline diff compares the chart with itself. The helm-diff plugin compares the new version with what is actually in your cluster, so it also catches drift. Helm 4 checks a plugin's signature before installing it, so first fetch the helm-diff maintainer's public key and check its fingerprint against the one published in the project's README and release notes. On Ubuntu, install GnuPG first; on macOS, brew install gnupg:

Bash
sudo apt-get install -y gnupg
cd ~/helm-apps-demo
curl -fsSL https://github.com/databus23.gpg | gpg --import
if gpg --with-colons --fingerprint EA17A2A206AFF8CD | grep -q '^fpr:*C5645EF47482257A1F806D2BEA17A2A206AFF8CD:'; then
  echo "fingerprint matches C5645EF4 7482257A 1F806D2B EA17A2A2 06AFF8CD"
else
  echo "fingerprint does not match: do not install the plugin"; false
fi
gpg --export EA17A2A206AFF8CD > helm-diff-signing-key.gpg

If you see fingerprint does not match, stop: the key is not the one the project publishes. Otherwise, install the plugin from its pinned release tarball. Helm downloads the matching .prov signature file beside it and checks it against the key:

Bash
cd ~/helm-apps-demo
DIFF_OS="$(uname -s | tr '[:upper:]' '[:lower:]' | sed 's/darwin/macos/')"
case "$(uname -m)" in
  x86_64) ARCH=amd64 ;;
  aarch64|arm64) ARCH=arm64 ;;
esac
helm plugin install \
  "https://github.com/databus23/helm-diff/releases/download/v3.15.15/helm-diff-${DIFF_OS}-${ARCH}.tgz" \
  --keyring helm-diff-signing-key.gpg

Now ask it what the upgrade would do to the live release:

Bash
cd ~/helm-apps-demo
helm diff upgrade metrics-server metrics-server/metrics-server \
  --version 3.14.0 -n metrics-server -f values-kind.yaml

Check it worked

Bash
helm plugin list | grep diff
helm diff version | grep '3\.15\.15'
grep -E '^[-+] .*image: ' ~/helm-apps-demo/upgrade.diff

The plugin list has a diff entry and helm diff version prints 3.15.15. The offline diff shows the image moving from v0.8.1 to v0.9.0 and the helm.sh/chart and app.kubernetes.io/version labels changing to match. helm diff upgrade against the cluster prints the same changes as coloured, per-object hunks headed by the object's namespace, name and kind. If it also shows a change you did not expect, something in the cluster has drifted from the last release; find out what before you upgrade.

Step 7 · Upgrade, and let Helm undo a failure

Run the upgrade with the same command as the install, changing only the version. Pass your values file every time: the file, not the cluster, is the record of your settings.

Bash
cd ~/helm-apps-demo
helm upgrade --install metrics-server metrics-server/metrics-server \
  --version 3.14.0 \
  --namespace metrics-server \
  -f values-kind.yaml \
  --rollback-on-failure --timeout 3m

Now break one on purpose, to see --rollback-on-failure at work. This upgrade points the Deployment at an image tag that does not exist, so the new pod can never start. It uses a short timeout so you do not wait long:

Bash
helm upgrade --install metrics-server metrics-server/metrics-server \
  --version 3.14.0 \
  --namespace metrics-server \
  -f values-kind.yaml \
  --set image.tag=v0.0.0-does-not-exist \
  --rollback-on-failure --timeout 90s

While it waits, kubectl get pods -n metrics-server in a second terminal shows the new pod in ErrImagePull or ImagePullBackOff and the old pod still Running: a Deployment keeps the old pods until the new ones are ready, so metrics kept flowing. After 90 seconds Helm reports that the upgrade failed and that it rolled the release back.

Check it worked

Bash
helm history metrics-server -n metrics-server
kubectl get deployment metrics-server -n metrics-server -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'

The history has four revisions: 1 is the 3.13.1 install, 2 the 3.14.0 upgrade, 3 the broken upgrade with status failed, and 4 is deployed with the description Rollback to 2. The image is registry.k8s.io/metrics-server/metrics-server:v0.9.0 again. A rollback never rewrites history; it adds a new revision that copies an old one.

Step 8 · Roll back by hand

Sometimes an upgrade succeeds by Helm's measure, because every pod became ready, and is still wrong: a dashboard breaks, or memory use doubles. Then you roll back yourself. Pick the revision from helm history. With no revision number, or 0, helm rollback goes to the previous revision; here you go back to the 3.13.1 install:

Bash
helm rollback metrics-server 1 -n metrics-server --wait --timeout 3m
helm history metrics-server -n metrics-server

Two limits to know:

  • Helm keeps 10 revisions per release by default (--history-max on upgrade and rollback). Older ones are deleted, and you cannot roll back to a revision that is gone.
  • A rollback restores Kubernetes objects. It does not restore data an app wrote, or migrated, while the new version ran. For a database chart, a backup is the rollback plan; helm rollback is not.

To return to 3.14.0 later, run the upgrade command from the previous step again. Your values file and the pinned version make it the same release as before.

Check it worked

helm history now ends with revision 5, deployed, chart metrics-server-3.13.1, description Rollback to 1. helm list -n metrics-server shows APP VERSION 0.8.1, and kubectl top nodes still prints figures.

Step 9 · Upgrade charts that ship CRDs with care

metrics-server ships no CustomResourceDefinitions, but many charts do: cert-manager, gateways, operators and monitoring stacks. CRDs need extra care because deleting or narrowing one deletes or breaks every object of that type in the cluster, across all namespaces. Charts ship them in one of two ways, and Helm treats each differently.

  • In the chart's crds/ folder. Helm installs these on the first install only. It never upgrades them and never deletes them, even on helm uninstall. So after helm upgrade to a version with new CRD fields, the cluster still has the old CRDs. helm show crds prints them.
  • In templates/, behind a value. Helm then treats the CRDs as ordinary release objects: it upgrades them, and it would delete them on uninstall unless they carry the annotation helm.sh/resource-policy: keep. cert-manager works this way, with crds.enabled to include them and crds.keep, on by default, to add the annotation.

Check which kind your chart is before the first install. metrics-server has nothing in crds/ and nothing CRD-shaped in its templates:

Bash
cd ~/helm-apps-demo
if [ -z "$(helm show crds metrics-server-3.14.0.tgz)" ]; then
  echo "metrics-server 3.14.0: no crds/ folder"
else
  echo "metrics-server 3.14.0 ships CRDs"
fi
grep -c '^kind: CustomResourceDefinition$' rendered-3.14.0.yaml || true

cert-manager renders its CRDs from templates when you ask for them, each with the keep annotation:

Bash
cd ~/helm-apps-demo
helm template cert-manager oci://quay.io/jetstack/charts/cert-manager --version v1.21.3 \
  -n cert-manager --set crds.enabled=true --kube-version 1.37.3 > rendered-cert-manager.yaml
grep -c '^kind: CustomResourceDefinition$' rendered-cert-manager.yaml
grep -c 'helm.sh/resource-policy: keep' rendered-cert-manager.yaml

For a chart with a crds/ folder, upgrade the CRDs yourself, first, as a separate and reviewed step. Read the chart's upgrade notes, save the new CRDs, ask the API server what applying them would change, apply them, and only then run helm upgrade. Replace <repo/chart> and <new-version> with your chart's:

Bash
helm show crds <repo/chart> --version <new-version> > crds-new.yaml
kubectl diff --server-side -f crds-new.yaml
kubectl apply --server-side -f crds-new.yaml

Never fix a CRD upgrade problem by uninstalling and reinstalling the chart. With templated CRDs and no keep annotation, the uninstall deletes the CRDs, and every custom resource with them.

Check it worked

The metrics-server check prints metrics-server 3.14.0: no crds/ folder and a count of 0. The cert-manager render counts 6 CustomResourceDefinitions and 6 keep annotations, one per CRD. On a cluster where you have installed a CRD-shipping chart, kubectl get crd lists its CRDs, and kubectl get crd <name> -o jsonpath='{.metadata.annotations}' shows whether helm.sh/resource-policy: keep is set.

When you have finished with metrics-server, remove the release and its namespace. Do this even if you plan to follow /tutorials/scale-snip-with-a-horizontal-pod-autoscaler: that tutorial builds a fresh cluster and installs its own metrics-server, and two installs on one cluster would fight over the same cluster-wide objects.

Bash
helm uninstall metrics-server -n metrics-server
kubectl delete namespace metrics-server

Remove the chart repository entry and, if you no longer want it, the plugin:

Bash
helm repo remove metrics-server
helm plugin uninstall diff

The next command deletes the whole ~/helm-apps-demo folder, including values-kind.yaml. If you want to keep that file, copy it somewhere safe first, for example cp ~/helm-apps-demo/values-kind.yaml ~/. Then delete the folder and the cached schemas:

Bash
rm -rf ~/helm-apps-demo
rm -rf ~/.cache/kubeconform

Optionally, remove the helm-diff signing key from your GnuPG keyring. Keep it if you will reinstall helm-diff later:

Bash
gpg --batch --yes --delete-keys C5645EF47482257A1F806D2BEA17A2A206AFF8CD

Next steps

  • Write a chart of your own, with values, a schema and an optional route, in /tutorials/package-an-app-as-a-helm-chart.
  • See metrics-server feeding an autoscaler in /tutorials/scale-snip-with-a-horizontal-pod-autoscaler (part of the Snip series, which installs its own copy).
  • For metrics over time rather than the last minute, set up Prometheus in /tutorials/monitor-a-server-with-prometheus-and-node-exporter.
  • Need a fresh cluster to practise on? /tutorials/run-your-first-kubernetes-cluster-with-kind creates one in a couple of minutes.

Need this done for you?

Padding does this work for growing companies, from the first diagnosis to a system that keeps working.

Platform Engineering

Get new tutorials

New tutorials, about twice a month.