Only registred users can make comments
Aleksandro Matejic

The Helm CheatSheet: Maximizing Kubernetes Deployments

Helm Cheatsheet

Helm v3 Cheat Sheet

Helm is the package manager for Kubernetes. Official Documentation: helm.sh/docs

Core Concepts

  • Chart: A package of pre-configured Kubernetes resources.

  • Release: A specific instance of a chart deployed to the cluster.

  • Repository: A collection of charts.

Common Workflow (The Happy Path)

Most users will stick to these commands for daily usage.

# 1. Add a repository
helm repo add bitnami [https://charts.bitnami.com/bitnami](https://charts.bitnami.com/bitnami)

# 2. Update your local cache
helm repo update

# 3. Search for a chart
helm search repo wordpress

# 4. Install a chart (creates a release)
helm install my-release bitnami/wordpress

# 5. List running releases
helm list

# 6. Uninstall a release
helm uninstall my-release

Repository Management

Manage the locations where you download charts from.

Command

Description

helm repo add <name> <url>

Add a chart repository.

helm repo list

List added chart repositories.

helm repo update

Update local cache of available charts from all added repos.

helm repo remove <name>

Remove a repository.

helm repo index <dir>

Generate an index.yaml file for a directory containing packaged charts (for hosting your own repo).

Searching

Find charts in your configured repositories or the artifact hub.

Command

Description

helm search repo <keyword>

Search for charts in your added repositories (displays the latest stable version by default).

helm search hub <keyword>

Search for charts on Artifact Hub (online).

helm search repo <keyword> --versions

List all available versions of a specific chart.

helm search repo <keyword> --devel

Search including development/latest versions (alpha, beta, rc).

Release Management

Manage the lifecycle of applications deployed to your cluster.

Install & Upgrade

Command

Description

helm install <name> <chart>

Install a chart.

helm install <name> <chart> --namespace <ns> --create-namespace

Install into a specific namespace, creating it if needed.

helm install <name> <chart> --values values.yaml

Install using a custom values file.

helm install <name> <chart> --set key=value

Install and override specific values on the CLI.

helm upgrade <release> <chart>

Upgrade an existing release.

helm upgrade <release> <chart> --install

Pro Tip: Upgrades a release, or installs it if it doesn't exist (idempotent).

helm upgrade <release> <chart> --atomic --cleanup-on-fail

Upgrade and rollback automatically if it fails.

List & Delete

Command

Description

helm list

List releases in the current namespace.

helm list --all-namespaces

List releases across all namespaces (alias: helm list -A).

helm list --filter 'arelease.*'

List releases matching a regex filter.

helm uninstall <release>

Remove a release (deletes all k8s resources).

helm uninstall <release> --keep-history

Remove a release but keep the history (allows viewing old logs/rollback).

Rollback & History

Command

Description

helm history <release>

Show revision history for a release.

helm rollback <release> <revision>

Roll back a release to a specific revision number.

helm status <release>

Show the status of a specific release.

Information & Debugging

Inspect charts and troubleshoot deployments.

Command

Description

helm get all <release>

Print all information (manifests, values, notes) for a release.

helm get manifest <release>

Print the actual Kubernetes YAML running in the cluster for a release.

helm get values <release>

Print the user-supplied values for a release.

helm show chart <chart>

Show the Chart.yaml content (metadata).

helm show values <chart>

Show the default values.yaml for a chart.

helm show readme <chart>

Show the chart's README.

helm template <name> <chart>

Render the chart templates locally without installing (good for debugging).

helm install ... --dry-run --debug

Simulate an install and print the generated manifests.

helm test <release>

Run tests defined within the chart.

Chart Development

Commands for creating and working on your own charts.

Command

Description

helm create <name>

Create a new chart directory with the recommended structure.

helm lint <path>

Check a chart for potential issues.

helm package <path>

Package a chart directory into a .tgz archive.

helm dependency list <path>

List dependencies for a chart.

helm dependency update <path>

Update dependencies based on Chart.yaml (downloads .tgz to charts/).

helm dependency build <path>

Rebuild the charts/ directory based on the lock file.

Creating & Templating Example

1. Scaffolding Run helm create mychart. This generates the standard directory structure:

  • Chart.yaml: Metadata (name, version).

  • values.yaml: Default configuration values.

  • templates/: Directory for K8s YAML files combined with Go template logic.

  • templates/_helpers.tpl: Place for reusable template snippets.

2. Using Values (values.yaml) Values allow you to separate configuration from code.

  • values.yaml:

    replicaCount: 3
    image:
      repository: nginx
      tag: latest
    
  • templates/deployment.yaml:

    replicas: {{ .Values.replicaCount }}
    image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"

3. Using Helpers (_helpers.tpl) Helpers (defined with define) prevent code duplication for things like resource names and labels.

  • templates/_helpers.tpl:

    {{- define "mychart.fullname" -}}
    {{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
    {{- end -}}
    
  • templates/service.yaml:

    metadata:
      name: {{ include "mychart.fullname" . }}

OCI Registries (Helm 3.8+)

Using container registries (like Docker Hub, ECR, GCR) to store charts.

Command

Description

helm registry login <host>

Log in to a registry (e.g., helm registry login ghcr.io).

helm push <chart>.tgz oci://<host>/<org>

Push a packaged chart to an OCI registry.

helm pull oci://<host>/<org>/<chart>

Pull a chart from an OCI registry.

helm pull oci://.../chart --untar

Pull and unpack (untar) the chart content to a local directory.

Example OCI Usage

# Package the chart
helm package mychart/

# Push to registry
helm push mychart-0.1.0.tgz oci://ghcr.io/myuser/charts

# Install from registry
helm install my-release oci://ghcr.io/myuser/charts/mychart --version 0.1.0

Plugins

Plugins are tools that "plug in" to Helm to add new features that aren't built-in. Think of them like browser extensions; they add extra capabilities like better diffing, simplified pushing to S3, or secrets management.

Real World Example: helm-diff

The diff plugin shows you exactly what will change in the YAML before you upgrade, which is safer than just running an upgrade blindly.

# 1. Install the plugin
helm plugin install [https://github.com/databus23/helm-diff](https://github.com/databus23/helm-diff)

# 2. See what would change if you upgraded
helm diff upgrade my-release bitnami/wordpress
 

Plugin Commands

Command

Description

helm plugin list

List installed plugins.

helm plugin install <url>

Install a plugin from a URL.

helm plugin uninstall <name>

Remove a plugin.

helm plugin update <name>

Update a plugin to the latest version.

Comments 0

No comments yet. Be the first.