---
title: "Helm"
lang: "en"
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/helm
---

[Home](/)›[Cheatsheets](/cheatsheets)

Cheatsheets

# Helm

Helm is the package manager for Kubernetes that simplifies deploying, managing, and upgrading applications through reusable charts. This cheatsheet covers the core Helm CLI commands and workflows.

8 Categories22 Sections58 ExamplesPublished: 01 Jan 2023Updated: 28 Feb 2025

HelmKubernetesPackage ManagerChartsReleasesK8sContainer OrchestrationApplication Management

[Markdown for AI(opens in a new tab)](/helm/index.md "Open the plain-Markdown version of this page, for pasting into an AI tool")

Series

[Containers & Kubernetes](/series/containers--kubernetes)2/7

[PreviousDocker](/cheatsheets/docker)[NextKubernetes](/cheatsheets/kubernetes)

All posts in this series (7)

Cheatsheets7

1.  [Docker](/cheatsheets/docker)
2.  [HelmYou are here](/cheatsheets/helm)
3.  [Kubernetes](/cheatsheets/kubernetes)
4.  [Docker Compose](/cheatsheets/docker-compose)
5.  [Dockerfile](/cheatsheets/dockerfile)
6.  [Docker Swarm](/cheatsheets/docker-swarm)
7.  [kubectl](/cheatsheets/kubectl)

Helm is the package manager for Kubernetes that simplifies the deployment, management, and upgrade of applications. It uses charts, which are templated Kubernetes manifests, to build reusable, configurable application packages.

## [Benefits](#benefits)

-   Deploy an entire application stack with a single command.
-   Share and reuse charts across projects and teams.
-   Override values without editing templates.
-   Track revisions and roll back to a previous release.
-   Include and manage chart dependencies automatically.
-   Deploy several instances with different configurations.

## [Quick start](#quick-start)

**Install Helm**: Follow the Installation Setup section.

**Add a repository**: `helm repo add bitnami https://charts.bitnami.com/bitnami`

**Search for charts**: `helm search repo nginx`

**Install a chart**: `helm install my-web bitnami/nginx --create-namespace`

**Check status**: `helm status my-web`

## [Common workflows](#common-workflows)

1.  **First Deploy**: Add repository, search chart, install with values
2.  **Configuration**: Customize with values files and flag overrides
3.  **Upgrades**: Update releases with new chart versions and configuration changes
4.  **Rollback**: Revert to previous versions if issues occur
5.  **Chart Development**: Create custom charts for your applications
6.  **Production**: Manage multiple environments with versioned, auditable deployments

The sections above cover Helm from basic commands through production deployment practices.

[Getting Started](#category-getting-started)

-   [What is Helm](#section-what-is-helm)
-   [Installation Setup](#section-installation)
-   [Version and Health Check](#section-helm-version-check)

[Repository Management](#category-repository-management)

-   [Add and Search Repositories](#section-add-search-repos)
-   [Update and Remove Repositories](#section-update-remove-repos)
-   [Repository Index and Information](#section-repository-index-info)

[Installing Charts](#category-installing-charts)

-   [Basic Chart Installation](#section-basic-install)
-   [Values Configuration](#section-values-configuration)
-   [Namespace Management](#section-namespace-management)

[Upgrading & Rollback](#category-upgrading-rollback)

-   [Upgrading Releases](#section-upgrading-releases)
-   [Rollback and Revision Management](#section-rollback-releases)
-   [Version and Release Control](#section-version-management)

[Release Management](#category-release-management)

-   [List and Find Releases](#section-list-releases)
-   [Release Status and History](#section-status-history)
-   [Get Release Information and Testing](#section-release-info)

[Chart Development](#category-chart-development)

-   [Create and Structure Charts](#section-create-charts)
-   [Chart Templating and Variables](#section-templating)
-   [Chart Structure and Best Practices](#section-chart-structure)

[Advanced Features](#category-advanced-features)

-   [Plugins and Extensions](#section-plugins-extensions)
-   [Hooks and Dependencies](#section-hooks-dependencies)

[Best Practices](#category-best-practices)

-   [Configuration Management](#section-config-management)
-   [Production Guidelines and Monitoring](#section-production-guidelines)

No commands found

Try adjusting your search term

## Getting Started

Fundamental Helm concepts and basic setup for beginners.

### What is Helm

Introduction to Helm and its role in Kubernetes package management.

#### Accessibility

Conceptual explanations are clear and include real-world analogies.

#### Best Practices

-   Understand charts and releases before deploying to production.
-   Always review chart values before deployment.

#### Common Errors

-   **Release not found:** Check the release name and confirm it exists in the cluster.

#### Keywords

helmpackage-managerkuberneteschartsapplication-deployment

[Learn more](https://helm.sh/docs/intro/)

#### Helm overview and key concepts

Helm organizes Kubernetes manifests into reusable, configurable packages called charts.

Code

Terminal window

```
# Helm is a package manager for Kubernetes that simplifies app deployment# Key concepts:# - Chart: A Helm package containing all resources needed (templates, values, metadata)# - Release: A running instance of a chart in a Kubernetes cluster# - Repository: Storage for charts (similar to package registries)# - Values: Configuration files that customize chart behavior
# Chart structure is similar to application packages in Linux:# Helm Chart ≈ .deb or .rpm package# Release ≈ Installed package in system# Repository ≈ Package repository (apt, yum)
```

Execution

Terminal window

```
helm version
```

Output

Terminal window

```
version.BuildInfo{Version:"v3.13.0", GitCommit:"efc1de...", GitTreeState:"clean", GoVersion:"go1.21"}
```

-   Charts are collections of templated Kubernetes YAML files.
-   Releases are instances of charts deployed in clusters.
-   Values allow parameterization without editing templates.

#### Helm vs kubectl comparison

Shows advantages of using Helm for application deployment versus manual kubectl management.

Code

Terminal window

```
# kubectl approach: Deploy individual YAML fileskubectl apply -f deployment.yamlkubectl apply -f service.yamlkubectl apply -f configmap.yaml
# Helm approach: Deploy packaged charthelm install my-app stable/nginx
# Helm benefits:# - Single command deploys entire application stack# - Reusable across projects# - Easy configuration through values# - Built-in upgrade and rollback capabilities
```

Execution

Terminal window

```
helm list
```

Output

Terminal window

```
NAME     NAMESPACE  REVISION  UPDATED                 STATUS   CHARTmy-app   default    2         2025-02-27 10:30:00     deployed nginx-1.0.0
```

-   Helm wraps multiple kubectl operations.
-   Provides templating, versioning, and rollback features.

#### The Helm ecosystem

Describes the complete Helm ecosystem and typical workflow.

Code

Terminal window

```
# Helm ecosystem components:# 1. Helm CLI: Command-line tool for managing charts and releases# 2. Helm Hub: Central repository for discovering public charts# 3. Repositories: Helm chart repositories (Bitnami, Jetstack, etc.)# 4. Charts: Packaged Kubernetes applications# 5. Kubeconfig: Determines which cluster Helm deploys to
# Example workflow:helm repo add bitnami https://charts.bitnami.com/bitnami  # Add repohelm search repo nginx                                     # Find charthelm install web bitnami/nginx                             # Deploy charthelm upgrade web bitnami/nginx                             # Update release
```

Execution

Terminal window

```
helm repo list
```

Output

Terminal window

```
NAME        URLbitnami     https://charts.bitnami.com/bitnamistable      https://charts.helm.sh/stable
```

-   Multiple repositories can be added and searched simultaneously.
-   Helm respects the KUBECONFIG environment variable for cluster selection.

### Installation Setup

Installing Helm and verifying the installation.

#### Accessibility

Provide clear step-by-step installation instructions for different platforms.

#### Best Practices

-   Keep Helm updated to the latest stable version.
-   Verify cluster connection before attempting deployments.

#### Common Errors

-   **helm: command not found:** Check that the install location is on your PATH, or reinstall with your platform's package manager.

#### Keywords

installsetupverifyversionenvironment

[Learn more](https://helm.sh/docs/intro/install/)

#### Install Helm on Linux

Installation steps for Helm on Linux systems (Ubuntu/Debian).

Code

Terminal window

```
# Download and install Helm binarycurl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# Or using package manager (Ubuntu/Debian)curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/nullecho "deb [arch=amd64 signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.listsudo apt-get updatesudo apt-get install helm
# Verify installationhelm version
```

Execution

Terminal window

```
helm version
```

Output

Terminal window

```
version.BuildInfo{Version:"v3.13.0", GitCommit:"efc1de...", GoVersion:"go1.21"}
```

-   The install script is the recommended method for latest versions.
-   Requires curl and basic Linux tools.

#### Install Helm on macOS and Windows

Installation instructions for macOS and Windows systems.

Code

Terminal window

```
# macOS: Install using Homebrewbrew install helm
# macOS: Install from sourcetar -zxvf helm-v3.13.0-darwin-amd64.tar.gzsudo mv darwin-amd64/helm /usr/local/bin/helm
# Windows: Using Chocolateychoco install kubernetes-helm
# Windows: Using Scoopscoop install helm
# Verify across platformshelm version
```

Execution

Terminal window

```
helm version && helm env
```

Output

Terminal window

```
version.BuildInfo{Version:"v3.13.0", GitCommit:"efc1de..."}HELM_HOME=/Users/username/.helm
```

-   Homebrew is the easiest method on macOS.
-   Chocolatey and Scoop are popular on Windows.

#### Verify Helm setup and cluster connection

Verifies the Helm installation and Kubernetes connectivity.

Code

Terminal window

```
# Check Helm version and build infohelm version
# Check Helm environmenthelm env
# Verify Kubernetes cluster connectionhelm version --shortkubectl cluster-info
# List any existing releaseshelm list --all-namespaces
```

Execution

Terminal window

```
helm version --short && helm list -A
```

Output

Terminal window

```
v3.13.0+gca8fb9e7NAME     NAMESPACE  REVISION  STATUS   CHART
```

-   Requires valid kubeconfig and Kubernetes cluster access.
-   helm list -A shows releases across all namespaces.

### Version and Health Check

Checking Helm version and cluster readiness.

#### Accessibility

Clear examples of diagnostic commands for troubleshooting.

#### Best Practices

-   Check compatibility before major version upgrades.
-   Keep environment paths organized and backed up.

#### Common Errors

-   **connection refused:** Verify kubectl access and cluster availability with \`kubectl cluster-info\`.

#### Keywords

versionhealth-checkstatusclusterdiagnostics

[Learn more](https://helm.sh/docs/helm/helm_version/)

#### Check Helm and Kubernetes versions

Retrieves detailed version information for both Helm and Kubernetes.

Code

Terminal window

```
# Get detailed Helm version informationhelm version
# Get short version formathelm version --short
# Check Kubernetes server versionkubectl version --short
# Check both in one gohelm version --short && echo "---" && kubectl version --short
```

Execution

Terminal window

```
helm version && kubectl version --short
```

Output

Terminal window

```
version.BuildInfo{Version:"v3.13.0", GitCommit:"ca8fb9e7", GitTreeState:"clean", GoVersion:"go1.21.3"}Client Version: v1.28.0Server Version: v1.28.0
```

-   Client and server must be within one minor version.
-   Version mismatch can cause compatibility issues.

#### Get Helm environment information

Shows important Helm environment paths and configuration locations.

Code

Terminal window

```
# Display all Helm environment variableshelm env
# Get specific environment valuehelm env HELM_HOMEhelm env HELM_CONFIG_HOME
# Common important paths:# HELM_HOME: Helm data directory# HELM_CONFIG_HOME: Helm configuration directory# HELM_CACHE_HOME: Chart cache location
```

Execution

Terminal window

```
helm env HELM_HOME HELM_CACHE_HOME
```

Output

Terminal window

```
/home/user/.helm/home/user/.cache/helm
```

-   Environment variables can be set to override defaults.
-   Cache directory stores downloaded charts.

## Repository Management

Managing Helm chart repositories and discovering available charts.

### Add and Search Repositories

Adding chart repositories and searching for available charts.

#### Accessibility

Clear examples of adding repos and finding charts.

#### Best Practices

-   Add trusted repositories (Bitnami, official) first.
-   Update repositories regularly with helm repo update.
-   Always search local cache before using hub search.

#### Common Errors

-   **no matching release found:** Add repository first with helm repo add and run helm repo update.

#### Keywords

repositoryaddsearchdiscovercharts

[Learn more](https://helm.sh/docs/helm/helm_search/)

#### Add popular Helm repositories

Demonstrates adding various Helm repositories for chart discovery.

Code

Terminal window

```
# Add Bitnami repository (popular for production charts)helm repo add bitnami https://charts.bitnami.com/bitnami
# Add Jetstack repository (for cert-manager)helm repo add jetstack https://charts.jetstack.io
# Add stable repositoryhelm repo add stable https://charts.helm.sh/stable
# Add custom private repositoryhelm repo add myrepo https://private.example.com/charts --username user --password pass
# Verify repository additionhelm repo list
```

Execution

Terminal window

```
helm repo add bitnami https://charts.bitnami.com/bitnami && helm repo list
```

Output

Terminal window

```
"bitnami" has been added to your repositoriesNAME        URLbitnami     https://charts.bitnami.com/bitnami
```

-   Bitnami maintains production-grade charts.
-   Username/password for private repos are optional.

#### Search for charts in repositories

Shows how to search and discover charts across repositories.

Code

Terminal window

```
# Search for a specific charthelm search repo nginx
# Search with version informationhelm search repo wordpress --versions
# Search across all added repositorieshelm search repo mysql
# Show detailed chart informationhelm search repo postgres -o yaml
# Get chart with specific versionhelm search repo bitnami/wordpress --version 18.0.0
```

Execution

Terminal window

```
helm search repo nginx
```

Output

Terminal window

```
NAME                     CHART VERSION   APP VERSION   DESCRIPTIONbitnami/nginx            15.1.2          1.25.3        NGINX Open Source is a web server...bitnami/nginx-ingress    9.8.1           1.8.1         NGINX Ingress Controller...
```

-   helm search finds charts in local cache.
-   Update repos first with helm repo update.
-   Version flag shows all available versions of a chart.

#### Search Helm Hub (ArtifactHub)

Searches the Artifact Hub for publicly available charts.

Code

Terminal window

```
# Search public charts on Artifact Hubhelm search hub nginx
# Search with max resultshelm search hub wordpress --max-col-width 80
# Get chart from ArtifactHub directlyhelm search hub mysql --output table
# Note: hub search requires internet and searches external registry# For faster searches, add repos locally and use: helm search repo
```

Execution

Terminal window

```
helm search hub nginx
```

Output

Terminal window

```
URL                                                CHART VERSION  APP VERSION  DESCRIPTIONhttps://artifacthub.io/packages/helm/bitnami/...  15.1.2         1.25.3       NGINX web server...
```

-   Artifact Hub is the new central registry (replaces Helm Hub).
-   Requires internet connection for hub search.

### Update and Remove Repositories

Keeping repositories current and managing repository lifecycle.

#### Accessibility

Clear examples for maintaining repositories.

#### Best Practices

-   Update repos before searching or installing.
-   Remove unused repositories to reduce clutter.
-   Prefer certificate-based auth over stored passwords.

#### Common Errors

-   **failed to fetch repository:** Check URL, network connectivity, and authentication credentials.

#### Keywords

updateremovedeleterefreshmaintenance

[Learn more](https://helm.sh/docs/helm/helm_repo/)

#### Update and refresh repository cache

Updates the local cache of charts from remote repositories.

Code

Terminal window

```
# Update index for a specific repositoryhelm repo update bitnami
# Update all repository cacheshelm repo update
# Update and show what changedhelm repo update --verbose
# Update at regular intervals (daily is common)# Added to crontab: 0 8 * * * /usr/local/bin/helm repo update
```

Execution

Terminal window

```
helm repo update
```

Output

Terminal window

```
Hang tight while we grab the latest from your chart repositories......Successfully got an update from the "bitnami" chart repository...Successfully got an update from the "stable" chart repository
```

-   Local cache is stored in HELM\_CACHE\_HOME.
-   Update before searching to find latest charts.
-   Useful in CI/CD pipelines before deployments.

#### Remove and replace repositories

Demonstrates removing and replacing repositories.

Code

Terminal window

```
# Remove a repositoryhelm repo remove bitnami
# Remove multiple repositorieshelm repo remove bitnami stable jetstack
# Replace/update a repository URLhelm repo remove old-repohelm repo add new-repo https://charts.example.com
# Verify removalhelm repo list
```

Execution

Terminal window

```
helm repo remove bitnami && helm repo list
```

Output

Terminal window

```
"bitnami" has been removed from your repositoriesNAME     URLstable   https://charts.helm.sh/stable
```

-   Removing a repo only removes local cache, not actual charts.
-   Does not affect existing releases from that repo.

#### Manage private repository authentication

Shows how to configure repositories with authentication.

Code

Terminal window

```
# Add private repo with credentialshelm repo add myrepo https://charts.mycompany.com \  --username myuser --password mypass
# Add with username only (will prompt for password)helm repo add myrepo https://charts.mycompany.com \  --username myuser
# Add with certificate authenticationhelm repo add secure https://charts.secure.com \  --ca-file ./ca.crt \  --cert-file ./client.crt \  --key-file ./client.key
# Update private repohelm repo update myrepo
```

Execution

Terminal window

```
helm repo add myrepo https://private.example.com --username user
```

Input

Terminal window

```
password
```

Output

Terminal window

```
"myrepo" has been added to your repositories
```

-   Credentials stored in ~/.helm/repositories.yaml.
-   For security, use environment variables instead of CLI args.

### Repository Index and Information

Getting information about repositories and their contents.

#### Accessibility

Clear examples of querying repository metadata.

#### Best Practices

-   Review chart values before any deployment.
-   Check chart README for installation prerequisites.
-   Compare values across versions when upgrading.

#### Common Errors

-   **chart not found:** Add the repository, then run \`helm repo update\`.

#### Keywords

indexinformationmetadatachart-detailsrepo-info

[Learn more](https://helm.sh/docs/helm/helm_show/)

#### Get chart information and default values

Retrieves metadata and documentation for a specific chart.

Code

Terminal window

```
# Show chart information (metadata, description)helm show chart bitnami/wordpress
# Show default values for a charthelm show values bitnami/wordpress
# Show all information (chart + values + readme)helm show all bitnami/wordpress
# Show README for charthelm show readme bitnami/wordpress
```

Execution

Terminal window

```
helm show chart bitnami/wordpress
```

Output

Terminal window

```
apiVersion: v2appVersion: 6.3.1description: WordPress is a free and open source blogging and website creation tool...name: wordpresstype: applicationversion: 18.0.0
```

-   Check this before installation to understand customization options.
-   helm show values is useful for learning chart configuration.

#### List and inspect chart versions

Shows how to discover and inspect different versions of charts.

Code

Terminal window

```
# List available versions of a charthelm search repo wordpress --versions
# Show specific version informationhelm show chart bitnami/wordpress --version 17.0.0
# Compare values between versionshelm show values bitnami/wordpress --version 18.0.0
# Get chart from specific versionhelm pull bitnami/wordpress --version 18.0.0 --untar
```

Execution

Terminal window

```
helm search repo wordpress --versions | head -10
```

Output

Terminal window

```
NAME                 CHART VERSION   APP VERSION   DESCRIPTIONbitnami/wordpress    18.0.0          6.3.1         WordPress is a free and...bitnami/wordpress    17.5.1          6.2.2         WordPress is a free and...bitnami/wordpress    17.0.0          6.2.0         WordPress is a free and...
```

-   Different versions may have breaking changes in default values.
-   Always review release notes before upgrading.

## Installing Charts

Deploying applications using Helm charts.

### Basic Chart Installation

Installing charts with minimal and standard configurations.

#### Accessibility

Provide step-by-step examples for first-time installations.

#### Best Practices

-   Always specify resource requests and limits.
-   Use --dry-run --debug to preview deployment.
-   Review chart README for required values.

#### Common Errors

-   **release already exists:** Use unique release names or delete previous release first.

#### Keywords

installdeployreleasebasicfirst-release

[Learn more](https://helm.sh/docs/helm/helm_install/)

#### Basic chart installation

Demonstrates basic chart installation and namespace management.

Code

Terminal window

```
# Install chart with default valueshelm install my-nginx bitnami/nginx
# Install with custom release namehelm install web-server bitnami/nginx
# Install in specific namespacehelm install my-nginx bitnami/nginx --namespace webapps
# Install and create namespace if it doesn't existhelm install my-nginx bitnami/nginx --namespace webapps --create-namespace
# Verify installationhelm list -n webapps
```

Execution

Terminal window

```
helm install my-nginx bitnami/nginx --create-namespace
```

Output

Terminal window

```
NAME: my-nginxLAST DEPLOYED: Wed Feb 27 14:30:00 UTC 2025NAMESPACE: defaultSTATUS: deployedREVISION: 1TEST SUITE: None
```

-   Helm auto-generates release name if not provided.
-   \--create-namespace creates namespace if missing.
-   Release name must be unique per namespace.

#### Install WordPress with persistent storage

Shows installing WordPress with custom configuration.

Code

Terminal window

```
# Install WordPress charthelm install my-blog bitnami/wordpress \  --set wordpressUsername=admin \  --set wordpressPassword='MySecurePass123' \  --set wordpressEmail=admin@example.com \  --set mariadb.auth.rootPassword='RootPass123'
# Install with persistent volumehelm install my-blog bitnami/wordpress \  --set persistence.enabled=true \  --set persistence.size=10Gi
# Check release statushelm status my-blog
```

Execution

Terminal window

```
helm install my-blog bitnami/wordpress --set wordpressUsername=admin
```

Output

Terminal window

```
NAME: my-blogSTATUS: deployedCHART: wordpress-18.0.0APP VERSION: 6.3.1
```

-   Set values override defaults without editing templates.
-   Multiple --set flags can be chained.
-   Sensitive values should use secrets file instead.

#### Install MySQL database with credentials

Demonstrates installing a production-grade MySQL database.

Code

Terminal window

```
# Install MySQL with custom root passwordhelm install mysql-db bitnami/mysql \  --set auth.rootPassword='RootPassword123' \  --set auth.database=myapp \  --set auth.username=appuser \  --set auth.password='AppPassword123'
# Install with specific MySQL versionhelm install mysql-db bitnami/mysql \  --set image.tag=8.0 \  --set primary.persistence.size=20Gi
# Verify deploymenthelm get values mysql-db
```

Execution

Terminal window

```
helm install mysql-db bitnami/mysql --set auth.rootPassword='Root123'
```

Output

Terminal window

```
NAME: mysql-dbSTATUS: deployedCHART: mysql-11.0.0APP VERSION: 8.0.35
```

-   Always use strong passwords for production.
-   Consider using --values flag with secret files.

### Values Configuration

Customizing chart installations with values files and flags.

#### Accessibility

Clear examples of configuration methods and best practices.

#### Best Practices

-   Keep base values file in git, secrets separate.
-   Use --dry-run to validate templates before deployment.
-   Document custom values and their purposes.

#### Common Errors

-   **failed to parse values:** Check the YAML syntax in the values file, including the indentation.

#### Keywords

valuesconfigurationcustomizeflagsoverride

[Learn more](https://helm.sh/docs/helm/helm_values/)

#### Using values files for configuration

Shows how to manage complex configurations with values files.

Code

Terminal window

```
# Create custom values filecat > my-values.yaml << 'EOF'nginx:  replicaCount: 3  image:    tag: "1.25"  resources:    requests:      cpu: 100m      memory: 128Mi    limits:      cpu: 500m      memory: 512Mi  service:    type: LoadBalancer    port: 8080EOF
# Install using values filehelm install my-nginx bitnami/nginx -f my-values.yaml
# Use multiple values files (later ones override earlier)helm install my-app bitnami/nginx \  -f base-values.yaml \  -f production-values.yaml
```

Execution

Terminal window

```
helm install my-nginx bitnami/nginx -f my-values.yaml --dry-run
```

Output

Terminal window

```
NAME: my-nginxNAMESPACE: defaultSTATUS: pending-install
```

-   Values files allow version control of configurations.
-   Multiple -f flags merge values (later overrides earlier).
-   \--dry-run previews changes without applying.

#### Override values with command-line flags

Demonstrates command-line overrides for quick customization.

Code

Terminal window

```
# Override single valuehelm install my-app bitnami/nginx --set replicaCount=5
# Override nested values using dot notationhelm install my-app bitnami/nginx --set image.tag=latest
# Set array valueshelm install my-app bitnami/nginx \  --set 'image.pullPolicy={IfNotPresent,Always}'
# Combine values file and command-line overrideshelm install my-app bitnami/nginx \  -f values.yaml \  --set replicaCount=3 \  --set image.tag=1.25.3
```

Execution

Terminal window

```
helm install my-app bitnami/nginx --set replicaCount=2 --dry-run
```

Output

Terminal window

```
NAME: my-appSTATUS: pending-install
```

-   Dot notation for nested values (e.g., image.tag).
-   \--set values override -f file values unless order matters.

#### Use secrets and environment variables in values

Shows secure practices for handling sensitive configuration.

Code

Terminal window

```
# Create secret values file (don't commit to git)cat > secrets.yaml << 'EOF'database:  user: admin  password: MySecurePass123!apiKey: sk_live_abc123def456EOF
# Install with secret valueshelm install my-app myrepo/app -f secrets.yaml
# Use environment variablesexport DB_PASSWORD=MySecurePass123helm install my-app myrepo/app \  --set database.password=$DB_PASSWORD
# Better: Use Kubernetes secretskubectl create secret generic app-secrets \  --from-literal=password=mypasshelm install my-app myrepo/app \  --set database.existingSecret=app-secrets
```

Execution

Terminal window

```
helm install my-app myrepo/app -f secrets.yaml --dry-run
```

Output

Terminal window

```
NAME: my-appSTATUS: pending-install
```

-   Never commit secret values to version control.
-   Kubernetes secrets are more secure than ConfigMaps.
-   Use existingSecret when available in chart.

### Namespace Management

Managing releases across namespaces and namespace organization.

#### Accessibility

Clear examples of namespace strategies.

#### Best Practices

-   Use separate namespaces for different environments.
-   Apply resource quotas per namespace.
-   Use namespace labels for organization.

#### Common Errors

-   **namespace not found:** Create namespace first or use --create-namespace flag.

#### Keywords

namespaceisolationmulti-tenantorganizationrbac

[Learn more](https://helm.sh/docs/helm/helm_install/)

#### Install releases in different namespaces

Demonstrates namespace isolation for different environments.

Code

Terminal window

```
# Create namespaceskubectl create namespace productionkubectl create namespace stagingkubectl create namespace development
# Install same chart in different namespaceshelm install my-app bitnami/nginx --namespace production --create-namespacehelm install my-app bitnami/nginx --namespace staging --create-namespacehelm install my-app bitnami/nginx --namespace development --create-namespace
# List releases across all namespaceshelm list --all-namespaces
# List releases in specific namespacehelm list --namespace production
```

Execution

Terminal window

```
helm list --all-namespaces
```

Output

Terminal window

```
NAME     NAMESPACE    STATUS   REVISION  CHARTmy-app   production   deployed 1         nginx-15.1.2my-app   staging      deployed 1         nginx-15.1.2my-app   development  deployed 1         nginx-15.1.2
```

-   Same release name can exist in different namespaces.
-   \--create-namespace creates namespace if missing.
-   Namespace isolation respects Kubernetes RBAC.

#### Organize applications by namespace

Shows logical organization of applications using namespaces.

Code

Terminal window

```
# Create namespace hierarchykubectl create namespace databaseskubectl create namespace monitoringkubectl create namespace ingress-system
# Install applications in logical namespaceshelm install postgres bitnami/postgresql --namespace databaseshelm install mysql bitnami/mysql --namespace databases
helm install prometheus bitnami/kube-prometheus --namespace monitoringhelm install grafana bitnami/grafana --namespace monitoring
helm install nginx-ingress bitnami/nginx-ingress-controller \  --namespace ingress-system
# View resources by namespacekubectl get all -n databaseskubectl get all -n monitoring
```

Execution

Terminal window

```
helm list --all-namespaces
```

Output

Terminal window

```
NAMESPACE         NAME              STATUS   CHARTdatabases         postgres          deployed postgresql-12.0.0databases         mysql             deployed mysql-11.0.0monitoring        prometheus        deployed kube-prometheus-40.0.0
```

-   Organize by function (databases, monitoring, network).
-   Can apply RBAC policies per namespace.

## Upgrading & Rollback

Managing release updates and rolling back to previous versions.

### Upgrading Releases

Updating releases to newer versions with zero downtime.

#### Accessibility

Clear explanation of upgrade process and options.

#### Best Practices

-   Always use --dry-run to preview changes.
-   Maintain release history for rollback capability.
-   Test upgrades in staging environment first.

#### Common Errors

-   **release not found:** Verify release name exists with \`helm list\`.

#### Keywords

upgradeupdatenew-versionchange-settingsrolling-update

[Learn more](https://helm.sh/docs/helm/helm_upgrade/)

#### Basic release upgrade

Shows basic upgrade workflow and preview options.

Code

Terminal window

```
# Upgrade release to newer chart versionhelm upgrade my-nginx bitnami/nginx
# Upgrade with new valueshelm upgrade my-nginx bitnami/nginx --set replicaCount=5
# Upgrade from values filehelm upgrade my-nginx bitnami/nginx -f new-values.yaml
# Preview upgrade without applyinghelm upgrade my-nginx bitnami/nginx --dry-run --debug
# Check upgrade historyhelm history my-nginx
```

Execution

Terminal window

```
helm upgrade my-nginx bitnami/nginx --set replicaCount=3 --dry-run
```

Output

Terminal window

```
Release "my-nginx" has been upgraded. Happy Helming!REVISION:       2RELEASED:       Wed Feb 27 15:00:00 UTC 2025
```

-   Upgrade applies changes to existing release.
-   New revision is created, previous kept for rollback.

#### Upgrade with strategy and rollout management

Shows advanced upgrade options for production deployments.

Code

Terminal window

```
# Upgrade with custom strategyhelm upgrade my-app bitnami/nginx \  --set image.tag=1.25.3 \  --set strategy.type=RollingUpdate \  --set strategy.rollingUpdate.maxUnavailable=1
# Upgrade without blocking (useful for CI/CD)helm upgrade my-app bitnami/nginx \  --set replicaCount=3 \  --wait=false
# Upgrade and wait for ready podshelm upgrade my-app bitnami/nginx \  --set replicaCount=3 \  --wait=true \  --timeout 5m
```

Execution

Terminal window

```
helm upgrade my-app bitnami/nginx --wait --timeout 5m --dry-run
```

Output

Terminal window

```
Release "my-app" has been upgraded. Happy Helming!
```

-   RollingUpdate avoids downtime for stateless apps.
-   \--wait blocks until all pods are ready.
-   \--timeout specifies max wait time.

#### Upgrade WordPress and dependencies

Demonstrates upgrading complex applications with dependencies.

Code

Terminal window

```
# Upgrade WordPress with database migrationhelm upgrade my-blog bitnami/wordpress \  --set image.tag=6.3.1 \  --set mariadb.image.tag=10.5
# Check current values before upgradehelm get values my-blog
# Upgrade and automatically install dependencieshelm upgrade my-blog bitnami/wordpress \  --dependency-update
# View upgrade statushelm status my-blog
```

Execution

Terminal window

```
helm upgrade my-blog bitnami/wordpress --dry-run
```

Output

Terminal window

```
Release "my-blog" has been upgraded. Happy Helming!
```

-   Dependencies are separate sub-charts.
-   Always backup data before major upgrades.

### Rollback and Revision Management

Rolling back to previous release versions and managing history.

#### Accessibility

Clear examples of rollback scenarios and safety measures.

#### Best Practices

-   Keep full release history for audit and rollback.
-   Test rollback manually in staging environment first.
-   Implement health checks after deployment.

#### Common Errors

-   **no revision to rollback to:** Check that a previous revision exists in the history.

#### Keywords

rollbackreverthistoryrevisionundo

[Learn more](https://helm.sh/docs/helm/helm_rollback/)

#### Rollback to previous release version

Demonstrates viewing history and performing rollbacks.

Code

Terminal window

```
# View release historyhelm history my-nginx
# Rollback to previous revision (immediately before current)helm rollback my-nginx
# Rollback to specific revision numberhelm rollback my-nginx 1
# Rollback and verifyhelm history my-nginx
# Check status after rollbackhelm status my-nginx
```

Execution

Terminal window

```
helm history my-nginx && helm rollback my-nginx
```

Output

Terminal window

```
REVISION  UPDATED                 STATUS      CHART           DESCRIPTION1         Wed Feb 27 14:30:00     superseded  nginx-15.1.2    Install complete2         Wed Feb 27 15:00:00     superseded  nginx-15.2.0    Upgrade complete3         Wed Feb 27 15:15:00     deployed    nginx-15.1.5    Upgrade completeRollback was a success! Happy Helming!
```

-   New rollback creates another revision.
-   All revisions are kept for audit trail.

#### Rollback with cleanup and force

Shows advanced rollback options for production scenarios.

Code

Terminal window

```
# Rollback with cleanup of the rollback revisionhelm rollback my-app --cleanup-on-fail
# Force rollback even if current deployment has issueshelm rollback my-app --force
# Rollback with custom timeouthelm rollback my-app --wait --timeout 5m
# Get detailed history with descriptionshelm history my-app --output json
```

Execution

Terminal window

```
helm rollback my-app --wait
```

Output

Terminal window

```
Rollback was a success! Happy Helming!
```

-   Force flag overrides safety checks.
-   cleanup-on-fail prevents orphaned resources.

#### Automated rollback strategy for CI/CD

Shows how to implement automated rollback in CI/CD pipelines.

Code

Terminal window

```
# In CI/CD pipeline, record old revision before upgradeOLD_REVISION=$(helm history my-app --output json | \  jq '.[-1].revision')
# Perform upgradehelm upgrade my-app bitnami/nginx --wait
# If upgrade fails or validation fails, rollbackif [ $? -ne 0 ]; then  echo "Upgrade failed, rolling back..."  helm rollback my-app $OLD_REVISIONfi
# Monitor after deployment for issueshelm status my-app
```

Execution

Terminal window

```
helm history my-app --max 5
```

Output

Terminal window

```
REVISION  UPDATED              STATUS      CHART1         Feb 27 14:30:00      superseded  app-1.02         Feb 27 15:00:00      superseded  app-2.0
```

-   Store revision numbers before upgrades for safety.
-   Combine with smoke tests and health checks.

### Version and Release Control

Managing chart versions and maintaining release consistency.

#### Accessibility

Clear examples of version control practices.

#### Best Practices

-   Use semantic versioning for chart selection.
-   Document chart version choices in your repo.
-   Test version upgrades in non-production first.

#### Common Errors

-   **chart version not found:** Use \`helm search repo --versions\` to list available versions.

#### Keywords

versionrelease-controlchart-versionconsistencypinning

[Learn more](https://helm.sh/docs/helm/helm_install/)

#### Pin chart versions for consistency

Shows how to pin chart versions for reproducible deployments.

Code

Terminal window

```
# Install specific chart versionhelm install my-app bitnami/nginx --version 15.1.2
# Check installed chart versionhelm list
# Show chart version informationhelm show chart bitnami/nginx --version 15.1.2
# Lock version in values filecat > my-values.yaml << 'EOF'# Chart version 15.1.2replicaCount: 3image:  tag: "1.25"EOF
helm install my-app bitnami/nginx --version 15.1.2 -f my-values.yaml
```

Execution

Terminal window

```
helm install my-app bitnami/nginx --version 15.1.2 --dry-run
```

Output

Terminal window

```
NAME: my-appCHART: nginx-15.1.2
```

-   Always specify chart version for production.
-   Prevents unexpected breaking changes.

#### Review breaking changes between versions

Demonstrates checking for breaking changes before upgrades.

Code

Terminal window

```
# Compare values between two versionshelm show values bitnami/nginx --version 15.0.0 > values-15-0.yamlhelm show values bitnami/nginx --version 15.1.2 > values-15-1.yamldiff values-15-0.yaml values-15-1.yaml
# Check chart API version compatibilityhelm show chart bitnami/nginx --version 15.0.0helm show chart bitnami/nginx --version 15.1.2
# Review release noteshelm show readme bitnami/nginx --version 15.1.2
```

Execution

Terminal window

```
helm show values bitnami/nginx --version 15.1.2 | head -20
```

Output

Terminal window

```
replicaCount: 1image:  registry: docker.io  repository: bitnami/nginx  tag: 1.25.3
```

-   Always review diffs in values files.
-   Check chart README for migration guides.

## Release Management

Managing, monitoring, and maintaining Helm releases.

### List and Find Releases

Discovering and listing deployed releases across the cluster.

#### Accessibility

Clear examples of filtering and finding releases.

#### Best Practices

-   Monitor releases regularly for drift.
-   Use labels and namespaces for organization.
-   Implement alerts on release status changes.

#### Common Errors

-   **release not found:** Check namespace with --all-namespaces flag.

#### Keywords

listreleasesfindfiltersearch

[Learn more](https://helm.sh/docs/helm/helm_list/)

#### List releases in different ways

Shows various ways to list and filter releases.

Code

Terminal window

```
# List all releases in current namespacehelm list
# List releases in specific namespacehelm list --namespace production
# List all releases across all namespaceshelm list --all-namespaces
# List with additional columnshelm list --all-namespaces --output wide
# Export as JSON for parsinghelm list --output json | jq '.[] | {name, namespace, status}'
```

Execution

Terminal window

```
helm list --all-namespaces
```

Output

Terminal window

```
NAME          NAMESPACE     STATUS    CHART              VERSIONmy-nginx      default       deployed  nginx-15.1.2       1.25.3my-wordpress  production    deployed  wordpress-18.0.0   6.3.1mysql-db      databases     deployed  mysql-11.0.0       8.0.35
```

-   \--all-namespaces searches all namespaces.
-   JSON output useful for automation and scripting.

#### Filter releases by status and properties

Shows filtering releases by status and properties.

Code

Terminal window

```
# List only deployed releaseshelm list --deployed
# List failed or superseded releaseshelm list --failedhelm list --superseded
# List releases updated after specific datehelm list --date --max 10
# Search for specific releasehelm list | grep nginx
# Get releases by labelhelm list --all-namespaces -o json | \  jq '.[] | select(.status=="deployed")'
```

Execution

Terminal window

```
helm list --deployed --all-namespaces
```

Output

Terminal window

```
NAME           NAMESPACE     STATUS    CHARTmy-nginx       default       deployed  nginx-15.1.2my-wordpress   production    deployed  wordpress-18.0.0
```

-   STATUS shows: deployed, superseded, failed, pending-install.
-   Useful for tracking deployment health.

#### Monitor releases with watch and get

Shows how to get detailed release information.

Code

Terminal window

```
# Watch releases in real-timewatch helm list --all-namespaces
# Get detailed release informationhelm get all my-nginx
# Get only manifesthelm get manifest my-nginx
# Get release valueshelm get values my-nginx
# Get release hookshelm get hooks my-nginx
```

Execution

Terminal window

```
helm get all my-nginx
```

Output

Terminal window

```
NAME: my-nginxLAST DEPLOYED: Wed Feb 27 14:30:00 UTC 2025NAMESPACE: defaultSTATUS: deployedREVISION: 1
```

-   helm get all combines chart, values, manifest.

### Release Status and History

Checking release status, history, and viewing release details.

#### Accessibility

Clear examples of checking release health and history.

#### Best Practices

-   Regularly check release status for drift.
-   Keep release history for audit trail.
-   Monitor revision count to clean up old revisions.

#### Common Errors

-   **no deployed release:** Verify release exists and is deployed with \`helm list\`.

#### Keywords

statushistoryrevisiontrackingdetails

[Learn more](https://helm.sh/docs/helm/helm_get/)

#### Check release status and health

Shows how to check release deployment status.

Code

Terminal window

```
# Check release statushelm status my-nginx
# Get release manifesthelm get manifest my-nginx
# Get release noteshelm get notes my-nginx
# Check status with JSON outputhelm status my-nginx --output json
# Verify Kubernetes resources are runningkubectl get pods -l app.kubernetes.io/instance=my-nginx
```

Execution

Terminal window

```
helm status my-nginx
```

Output

Terminal window

```
NAME: my-nginxLAST DEPLOYED: Wed Feb 27 14:30:00 UTC 2025NAMESPACE: defaultSTATUS: deployedREVISION: 1TEST SUITE: None
```

-   Status shows: deployed, superseded, failed, pending-install.
-   Always verify pods are running with kubectl.

#### View release history and revisions

Shows release revision history and change tracking.

Code

Terminal window

```
# View release revision historyhelm history my-nginx
# Show specific revision detailshelm get manifest my-nginx --revision 1
# Get values for specific revisionhelm get values my-nginx --revision 2
# Compare values between revisionsdiff <(helm get values my-nginx --revision 1) \     <(helm get values my-nginx --revision 2)
# Export revision historyhelm history my-nginx --output json
```

Execution

Terminal window

```
helm history my-nginx
```

Output

Terminal window

```
REVISION  UPDATED                 STATUS      CHART           DESCRIPTION1         Wed Feb 27 14:30:00     superseded  nginx-15.1.2    Install complete2         Wed Feb 27 15:00:00     deployed    nginx-15.1.5    Upgrade complete
```

-   Each revision represents a deployment action.
-   History useful for auditing and rollback.

#### Get detailed release information

Retrieves detailed release information.

Code

Terminal window

```
# Get all release information (chart, values, manifest)helm get all my-nginx
# Export release for backuphelm get all my-nginx > release-backup.yaml
# Get values in different formatshelm get values my-nginx --output jsonhelm get values my-nginx --output yaml
# Get release chart metadatahelm get manifest my-nginx | kubectl apply -f - --dry-run=client
# Get release size and resourceshelm get manifest my-nginx | wc -l
```

Execution

Terminal window

```
helm get all my-nginx
```

Output

Terminal window

```
NAME: my-nginxREVISION: 1RELEASED: Wed Feb 27 14:30:00 UTC 2025STATUS: deployedMANIFEST: [kubernetes resources...]
```

-   helm get all is combination of multiple subcommands.
-   Useful for debugging and documentation.

### Get Release Information and Testing

Extracting and analyzing detailed release information.

#### Accessibility

Clear examples of information retrieval and testing.

#### Best Practices

-   Always use helm test for validation.
-   Compare manifests before upgrades.
-   Save release information for audit trail.

#### Common Errors

-   **release has no hooks or tests:** Not all charts include tests; this is normal.

#### Keywords

informationdetailstestingvalidationdebugging

[Learn more](https://helm.sh/docs/helm/helm_test/)

#### Extract and analyze release information

Shows how to extract release notes and configuration.

Code

Terminal window

```
# Get release notes/instructionshelm get notes my-wordpress
# Get release configurationhelm get values my-wordpress > current-values.yaml
# Get generated Kubernetes manifestshelm get manifest my-wordpress > release-manifests.yaml
# Get rendered templateshelm template my-release bitnami/wordpress
# Validate release against schemahelm lint path/to/chart/
```

Execution

Terminal window

```
helm get notes my-wordpress
```

Output

Terminal window

```
WORDPRESS INSTALLATION NOTES...1. Access credentials...2. Get administrator password...3. Access WordPress at...
```

-   Release notes contain deployment instructions.
-   Manifests show actual Kubernetes resources deployed.

#### Test and validate release functionality

Shows how to run built-in chart tests.

Code

Terminal window

```
# List test suites defined in charthelm get hooks my-wordpress
# Run release testshelm test my-wordpress
# Test with cleanup after failurehelm test my-wordpress --cleanup
# List test podskubectl get pods -n default -l app.kubernetes.io/instance=my-wordpress
# View test logskubectl logs -n default -l helm.sh/hook=test
```

Execution

Terminal window

```
helm test my-wordpress
```

Output

Terminal window

```
Pod my-wordpress-test-connection succeeded
```

-   Not all charts include test suites.
-   Tests validate basic functionality after deployment.

#### Compare current and desired release states

Shows how to compare current and desired states.

Code

Terminal window

```
# Get current deployed manifesthelm get manifest my-app > current.yaml
# Generate what would be deployed with new valueshelm template my-app bitnami/nginx -f new-values.yaml > desired.yaml
# Compare differencesdiff current.yaml desired.yaml
# Dry-run to see exact changeshelm upgrade my-app bitnami/nginx -f new-values.yaml --dry-run
# Show files that would be created/modifiedhelm upgrade my-app bitnami/nginx -f new-values.yaml --dry-run --debug
```

Execution

Terminal window

```
helm get manifest my-app > current.yaml
```

Output

Terminal window

```
apiVersion: v1kind: Servicemetadata:  name: my-app-nginxspec:  ports:  - port: 80
```

-   Run a dry-run before production upgrades.

## Chart Development

Creating and publishing custom Helm charts.

### Create and Structure Charts

Scaffolding and structuring new Helm charts.

#### Accessibility

Step-by-step chart creation examples.

#### Best Practices

-   Use semantic versioning for charts.
-   Include a detailed README.md with the chart.
-   Test charts before publishing.

#### Common Errors

-   **apiVersion not recognized:** Use apiVersion: v2 for Helm 3 charts.

#### Keywords

createscaffoldstructuretemplatechart-layout

[Learn more](https://helm.sh/docs/topics/charts/)

#### Create new chart scaffold

Creates a new chart with standard structure and validates it.

Code

Terminal window

```
# Create new chart with helmhelm create my-app
# View chart structuretree my-app
# Chart directory structure created:# my-app/# ├── Chart.yaml              # Chart metadata# ├── values.yaml             # Default values# ├── templates/              # Template files# │   ├── deployment.yaml# │   ├── service.yaml# │   └── configmap.yaml# └── charts/                 # Dependencies
# Verify chart structurehelm lint my-app
```

Execution

Terminal window

```
helm create my-app && helm lint my-app
```

Output

Terminal window

```
[OK] my-app: Chart is well-formed
```

-   helm create generates basic templates.
-   Chart.yaml contains metadata.
-   Values provide default configuration.

#### Customize chart for your application

Customizes chart metadata and default values.

Code

Terminal window

```
cd my-app
# Edit Chart.yaml with app informationcat > Chart.yaml << 'EOF'apiVersion: v2name: my-appdescription: Custom application charttype: applicationversion: 1.0.0appVersion: 1.0.0maintainers:  - name: Your Name    email: you@example.comEOF
# Create custom valuescat > values.yaml << 'EOF'replicaCount: 2image:  repository: myrepo/my-app  tag: "1.0.0"service:  type: ClusterIP  port: 8080EOF
# Validatehelm lint
```

Execution

Terminal window

```
helm create my-app && cd my-app && helm lint
```

Output

Terminal window

```
[OK] my-app: Chart is well-formed
```

-   Chart.yaml must have apiVersion: v2 for Helm 3.
-   Version numbers follow semantic versioning.

#### Create chart with dependencies

Shows how to add and manage chart dependencies.

Code

Terminal window

```
# Create Chart.yaml with dependenciescat > Chart.yaml << 'EOF'apiVersion: v2name: my-full-appversion: 1.0.0dependencies:  - name: postgresql    version: "12.0"    repository: "https://charts.bitnami.com/bitnami"  - name: redis    version: "17.0"    repository: "https://charts.bitnami.com/bitnami"    condition: redis.enabledEOF
# Download dependencieshelm dependency update
# View dependenciesls -la charts/
# Package with dependencieshelm package my-full-app
```

Execution

Terminal window

```
helm dependency update my-full-app
```

Output

Terminal window

```
Saving 2 chartsDeleting outdated charts
```

-   Dependencies automatically included in package.
-   Condition allows optional dependencies.

### Chart Templating and Variables

Creating flexible templates with variables and conditionals.

#### Accessibility

Clear examples of template syntax and usage.

#### Best Practices

-   Use helper templates to reduce duplication.
-   Document template variables in values.yaml comments.
-   Validate templates with helm template before use.

#### Common Errors

-   **execution error at (deployment.yaml:5):** Check template syntax for proper {{ }} and conditionals.

#### Keywords

templatingvariablesconditionalsloopsfunctions

[Learn more](https://helm.sh/docs/chart_template_guide/)

#### Use template variables and values

Shows template variable substitution in Kubernetes manifests.

Code

Terminal window

```
# Create deployment template with variablescat > templates/deployment.yaml << 'EOF'apiVersion: apps/v1kind: Deploymentmetadata:  name: {{ .Release.Name }}-{{ .Chart.Name }}  namespace: {{ .Release.Namespace }}spec:  replicas: {{ .Values.replicaCount }}  template:    metadata:      labels:        app: {{ .Chart.Name }}    spec:      containers:      - name: {{ .Chart.Name }}        image: {{ .Values.image.repository }}:{{ .Values.image.tag }}        ports:        - containerPort: {{ .Values.service.port }}EOF
# Render template with valueshelm template my-release . -f values.yaml
# Test with different valueshelm template my-release . --set replicaCount=3
```

Execution

Terminal window

```
helm template my-app ./my-app --set replicaCount=2
```

Output

Terminal window

```
apiVersion: apps/v1kind: Deploymentmetadata:  name: my-app-my-app  namespace: defaultspec:  replicas: 2
```

-   {{ .Release.Name }} renders release name.
-   {{ .Values.\* }} accesses values.yaml entries.

#### Conditionals and loops in templates

Shows conditional and loop logic in templates.

Code

Terminal window

```
# Create template with conditionalscat > templates/service.yaml << 'EOF'apiVersion: v1kind: Servicemetadata:  name: {{ .Release.Name }}spec:  type: {{ .Values.service.type }}  {{- if eq .Values.service.type "LoadBalancer" }}  loadBalancerIP: {{ .Values.service.loadBalancerIP }}  {{- end }}  ports:  - port: {{ .Values.service.port }}EOF
# Loop through environment variablescat > templates/configmap.yaml << 'EOF'apiVersion: v1kind: ConfigMapdata:  {{- range $key, $val := .Values.env }}  {{ $key }}: {{ $val | quote }}  {{- end }}EOF
# Render and verifyhelm template my-app . -f values-prod.yaml
```

Execution

Terminal window

```
helm template my-app ./my-app
```

Output

Terminal window

```
apiVersion: v1kind: Servicemetadata:  name: my-appspec:  type: ClusterIP  ports:  - port: 8080
```

-   {{- removes whitespace before.
-   {{- end }} closes conditional/loop blocks.

#### Built-in functions and filters

Shows advanced templating with functions and helpers.

Code

Terminal window

```
# Use built-in template functionscat > templates/deployment.yaml << 'EOF'metadata:  name: {{ include "mychart.fullname" . }}  labels:    {{- include "mychart.labels" . | nindent 4 }}spec:  template:    metadata:      labels:        {{- include "mychart.selectorLabels" . | nindent 6 }}    spec:      containers:      - name: {{ .Chart.Name }}        image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"        env:        - name: APP_NAME          value: {{ .Values.appName | upper | quote }}EOF
# Create helper template filecat > templates/_helpers.tpl << 'EOF'{{- define "mychart.fullname" -}}{{- .Release.Name }}-{{ .Chart.Name }}{{- end }}
{{- define "mychart.labels" -}}app.kubernetes.io/name: {{ include "mychart.fullname" . }}app.kubernetes.io/version: {{ .Chart.AppVersion }}{{- end }}EOF
# Render with functionshelm template my-app .
```

Execution

Terminal window

```
helm template my-app ./my-app
```

Output

Terminal window

```
metadata:  name: my-app-my-app  labels:    app.kubernetes.io/name: my-app-my-app    app.kubernetes.io/version: 1.0
```

-   \_helpers.tpl contains reusable template definitions.
-   include includes other templates.
-   Filters like upper, quote transform values.

### Chart Structure and Best Practices

Organizing chart files and following best practices.

#### Accessibility

Clear examples of proper chart organization.

#### Best Practices

-   Always lint before distributing charts.
-   Include detailed documentation.
-   Version charts semantically.
-   Test with multiple values configurations.

#### Common Errors

-   **templates must be in 'templates' directory:** Move the template files into the templates/ subdirectory.

#### Keywords

structureorganizationbest-practicestestinglint

[Learn more](https://helm.sh/docs/topics/charts/)

#### Complete chart directory structure

Shows recommended chart directory structure.

Code

Terminal window

```
my-app/├── Chart.yaml              # Chart metadata├── README.md               # Chart documentation├── values.yaml             # Default values├── values-prod.yaml        # Production values (optional)├── charts/                 # Dependencies│   ├── postgresql/│   └── redis/├── templates/              # Kubernetes manifests│   ├── NOTES.txt           # Post-install notes│   ├── _helpers.tpl        # Helper definitions│   ├── deployment.yaml│   ├── service.yaml│   ├── configmap.yaml│   ├── secret.yaml│   ├── ingress.yaml│   └── tests/├── crds/                   # Custom Resource Definitions│   └── mycrd.yaml└── .helmignore             # Files to exclude from chart
# Create complete structurehelm create my-complete-app
```

Execution

Terminal window

```
find my-app -type f | head -15
```

Output

Terminal window

```
my-app/Chart.yamlmy-app/values.yamlmy-app/README.mdmy-app/templates/...
```

-   NOTES.txt provides post-install instructions.
-   \_helpers.tpl contains reusable helper templates.
-   .helmignore excludes files from packaging.

#### Lint and validate chart quality

Validates chart structure and follows best practices.

Code

Terminal window

```
# Lint chart for errors and best practiceshelm lint my-app
# Strict lintinghelm lint my-app --strict
# Lint with valueshelm lint my-app -f values-prod.yaml
# Lint multiple chartshelm lint ./charts/*
# Check chart with template renderinghelm template my-app . | kubectl apply -f - --dry-run=client
```

Execution

Terminal window

```
helm lint my-app --strict
```

Output

Terminal window

```
[OK] my-app: Chart is well-formed[WARNING] Chart appVersion not updated in Chart.yaml
```

-   helm lint checks for common issues.
-   Always lint before packaging for public release.

#### Package and publish chart

Shows how to package and distribute charts.

Code

Terminal window

```
# Package chart for distributionhelm package my-app
# Creates: my-app-1.0.0.tgz
# Package into specific directoryhelm package my-app --destination ./releases
# Create index for chart repositoryhelm repo index ./releases --url https://charts.example.com
# Generates index.yaml for hosting as chart repo
# Install from packaged charthelm install my-release ./my-app-1.0.0.tgz
# Install from remote repositoryhelm install my-release myrepo/my-app
```

Execution

Terminal window

```
helm package my-app
```

Output

Terminal window

```
Successfully packaged chart and saved it to: /path/to/my-app-1.0.0.tgz
```

-   Packages are tarballs with chart code.
-   index.yaml required for chart repositories.

## Advanced Features

Advanced Helm capabilities and integrations.

### Plugins and Extensions

Extending Helm with plugins and custom functionality.

#### Accessibility

Clear examples of plugin usage.

#### Best Practices

-   Use diff plugin to preview changes.
-   Use secrets plugin for encrypted values.
-   Keep plugins updated regularly.

#### Common Errors

-   **plugin not found:** Install plugin with helm plugin install followed by repo URL.

#### Keywords

pluginsextensionscustom-commandsintegrationthird-party

[Learn more](https://helm.sh/docs/topics/plugins/)

#### Install and use Helm plugins

Shows how to extend Helm with plugins.

Code

Terminal window

```
# List available pluginshelm plugin list
# Install Helm plugin for secrets managementhelm plugin install https://github.com/jkroepke/helm-secrets.git
# Install Helm diff plugin (shows release changes)helm plugin install https://github.com/databus23/helm-diff.git
# Use plugin to show differenceshelm diff upgrade my-app bitnami/nginx --values new-values.yaml
# Uninstall pluginhelm plugin uninstall diff
# Update pluginshelm plugin update
```

Execution

Terminal window

```
helm plugin list
```

Output

Terminal window

```
NAME    VERSION DESCRIPTIONdiff    3.8.1   A Helm plugin to show diffssecrets 4.2.2   Secrets plugin for Helm
```

-   Plugins add custom commands to Helm.
-   Popular: diff, secrets, chartmuseum, s3.

#### Popular Helm plugins for DevOps

Shows commonly used Helm plugins for DevOps workflows.

Code

Terminal window

```
# Install Helm Diff for preview upgradeshelm plugin install https://github.com/databus23/helm-diff.githelm diff upgrade my-app bitnami/nginx
# Install Helm Secrets for encrypted valueshelm plugin install https://github.com/jkroepke/helm-secrets.githelm secrets enc secrets.yaml
# Install ChartMuseum plugin to manage chart reposhelm plugin install https://github.com/chartmuseum/helm-push.githelm push my-app-1.0.0.tgz chartmuseum
# Install S3 plugin for AWS S3 chart reposhelm plugin install https://github.com/hypnoglow/helm-s3.githelm s3 init s3-repo --bucket my-charts-bucket
```

Execution

Terminal window

```
helm plugin list
```

Output

Terminal window

```
NAME           VERSION DESCRIPTIONdiff           3.8.1   Show differences in upgradessecrets        4.2.2   Manage secrets in charts
```

-   Plugins extend Helm functionality.
-   Install from GitHub repositories.

### Hooks and Dependencies

Using hooks for deployment lifecycle events and managing chart dependencies.

#### Accessibility

Clear examples of hook usage.

#### Best Practices

-   Use hooks for setup and cleanup tasks.
-   Keep dependency versions flexible with ranges.
-   Always test hooks before production use.

#### Common Errors

-   **hook not executing:** Verify annotation syntax as hooks rely on annotations.

#### Keywords

hooksdependencieslifecyclepre-installpost-install

[Learn more](https://helm.sh/docs/topics/charts_hooks/)

#### Add lifecycle hooks to templates

Shows how to add lifecycle hooks for setup and validation.

Code

Terminal window

```
# Create pre-install hook to setupcat > templates/pre-install-job.yaml << 'EOF'apiVersion: batch/v1kind: Jobmetadata:  name: {{ .Release.Name }}-pre-install  annotations:    "helm.sh/hook": pre-install    "helm.sh/hook-weight": "-5"spec:  template:    spec:      containers:      - name: setup        image: busybox        command: ["sh", "-c", "echo 'Setting up..."]      restartPolicy: NeverEOF
# Create post-install hook for validationcat > templates/post-install-job.yaml << 'EOF'apiVersion: batch/v1kind: Jobmetadata:  name: {{ .Release.Name }}-post-install  annotations:    "helm.sh/hook": post-install    "helm.sh/hook-delete-policy": before-hook-creationspec:  template:    spec:      containers:      - name: validate        image: busybox        command: ["sh", "-c", "echo 'Validation complete'"]      restartPolicy: NeverEOF
# Available hooks: pre-install, post-install, pre-upgrade, post-upgrade# pre-delete, post-delete, pre-rollback, post-rollback, test
```

Execution

Terminal window

```
helm install my-app . --dry-run
```

Output

Terminal window

```
apiVersion: batch/v1kind: Jobmetadata:  name: my-app-pre-install  annotations:    helm.sh/hook: pre-install
```

-   Hooks execute at specific lifecycle events.
-   hook-weight controls execution order.
-   hook-delete-policy determines cleanup behavior.

#### Manage chart dependencies

Shows how to manage chart dependencies.

Code

Terminal window

```
# Define dependencies in Chart.yamlcat > Chart.yaml << 'EOF'apiVersion: v2name: my-full-appdependencies:  - name: postgresql    version: "12.x.x"    repository: "@bitnami"    condition: postgresql.enabled  - name: redis    version: "17.x.x"    repository: "@bitnami"    tags:      - cache    alias: redis-cacheEOF
# Download dependencieshelm dependency update
# View dependency treehelm dependency list
# Build dependency requirementshelm dependency build
# Remove dependencieshelm dependency update --skip-refresh
```

Execution

Terminal window

```
helm dependency list my-app
```

Output

Terminal window

```
NAME         VERSION  REPOSITORY           STATUSpostgresql   12.1.6   @bitnami            okredis        17.3.0   @bitnami            ok
```

-   Dependencies are sub-charts included in main chart.
-   Condition allows optional dependencies.
-   Alias creates multiple instances of same chart.

## Best Practices

Production-ready Helm practices and patterns.

### Configuration Management

Managing configurations securely and consistently.

#### Accessibility

Clear examples of secure configuration practices.

#### Best Practices

-   Use Kubernetes secrets for sensitive data.
-   Version control only non-sensitive values.
-   Use separate values files per environment.
-   Encrypt secret files with helm-secrets.

#### Common Errors

-   **secret not found:** Create secret before deploying with kubectl create secret.

#### Keywords

configurationsecretsconfigmapsecuritybest-practice

[Learn more](https://helm.sh/docs/intro/using_helm/)

#### Secure secret management with Helm

Shows secure secret management in Helm deployments.

Code

Terminal window

```
# Store secrets in Kubernetes Secretkubectl create secret generic app-secrets \  --from-literal=db-password=secure123 \  --from-literal=api-key=sk_live_abc123
# Reference secret in valuescat > values.yaml << 'EOF'database:  existingSecret: app-secrets  existingSecretPasswordKey: db-passwordEOF
# Install using secret referencehelm install my-app myrepo/app -f values.yaml
# Never commit secrets to gitecho "secrets.yaml" >> .gitignore
# Use encrypted values fileshelm plugin install https://github.com/jkroepke/helm-secrets.githelm secrets enc secrets.yaml
```

Execution

Terminal window

```
kubectl create secret generic app-secrets --from-literal=password=secure
```

Output

Terminal window

```
secret/app-secrets created
```

-   Use Kubernetes secrets instead of plain values.
-   Encrypt secret files before committing.
-   Reference existing secrets in charts.

#### Environment-specific configurations

Shows managing environment-specific configurations.

Code

Terminal window

```
# Create base valuescat > values.yaml << 'EOF'env: developmentreplicaCount: 1image:  tag: latestresources:  requests:    memory: "128Mi"EOF
# Create production overridescat > values-prod.yaml << 'EOF'env: productionreplicaCount: 3image:  tag: v1.2.3resources:  requests:    memory: "512Mi"  limits:    memory: "1Gi"EOF
# Install with environment-specific valueshelm install my-app myrepo/app -f values.yaml -f values-prod.yaml
# For staginghelm install my-app myrepo/app -f values.yaml -f values-staging.yaml
```

Execution

Terminal window

```
helm template my-app myrepo/app -f values.yaml -f values-prod.yaml
```

Output

Terminal window

```
spec:  replicas: 3  template:    spec:      containers:      - name: app        image: app:v1.2.3
```

-   Later files override earlier ones.
-   Keep production values separate and secure.

### Production Guidelines and Monitoring

Best practices for production Helm deployments.

#### Accessibility

Clear examples of production-ready configurations.

#### Best Practices

-   Always test deployments before production.
-   Implement monitoring and alerting.
-   Backup releases regularly and test recovery.
-   Use GitOps for release management.
-   Implement gradual rollout strategies.
-   Monitor resource usage and metrics.

#### Common Errors

-   **pod not ready after deployment:** Check logs with kubectl logs and verify image availability.

#### Keywords

productionmonitoringhigh-availabilitydisaster-recoveryreliability

[Learn more](https://helm.sh/docs/intro/using_helm/)

#### Production-ready Helm checklist

Shows production-ready deployment configuration.

Code

Terminal window

```
# 1. Use specific chart versionshelm install my-app myrepo/app --version 1.2.3
# 2. Pin all image tags (no 'latest')cat > values.yaml << 'EOF'image:  repository: myrepo/my-app  tag: "v1.2.3"  pullPolicy: IfNotPresentreplicaCount: 3resources:  requests:    cpu: 250m    memory: 256Mi  limits:    cpu: 500m    memory: 512MilivenessProbe:  httpGet:    path: /health    port: 8080  initialDelaySeconds: 30  periodSeconds: 10EOF
# 3. Enable high availabilityhelm install my-app myrepo/app \  --set replicaCount=3 \  --set podDisruptionBudget.minAvailable=1
# 4. Test deploymenthelm test my-app
# 5. Monitor releasehelm status my-appkubectl get pods -l app=my-app
```

Execution

Terminal window

```
helm status my-app && kubectl get pods
```

Output

Terminal window

```
NAME: my-appSTATUS: deployedNAME                    READY   STATUSmy-app-xxx              1/1     Runningmy-app-yyy              1/1     Running
```

-   Pin versions for reproducibility.
-   Set resource requests/limits.
-   Enable health probes for automatic healing.

#### Backup and disaster recovery

Shows backup and recovery procedures.

Code

Terminal window

```
# Backup release configurationhelm get all my-app > backup-my-app.yaml
# Backup all releasesfor release in $(helm list -q); do  helm get all $release > backup-$release.yamldone
# Backup using Velero plugin# velero backup create my-app-backup
# Test restorationhelm delete my-apphelm install my-app -f backup-my-app.yaml
# Implement disaster recovery tests regularly# Schedule backups: kubectl apply -f schedule.yaml
```

Execution

Terminal window

```
helm get all my-app > release-backup.yaml
```

Output

Terminal window

```
NAME: my-appLAST DEPLOYED: Wed Feb 27 14:30:00 UTC 2025[Full release information backed up]
```

-   Back up critical releases regularly.
-   Test recovery procedures before disaster.
-   Use solutions like Velero for cluster-wide backup.

Was this useful?

## Tags

#Helm#Kubernetes#Package Manager#Charts#Releases#K8s#Container Orchestration#Application Management

## Share

[Facebook](https://facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fhelm "Share on Facebook")[Twitter](https://twitter.com/intent/tweet/?text=Helm&url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fhelm "Share on Twitter")[LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fhelm&title=Helm&summary=Helm%20is%20the%20package%20manager%20for%20Kubernetes%20that%20simplifies%20deploying%2C%20managing%2C%20and%20upgrading%20applications%20through%20reusable%20charts.%20This%20cheatsheet%20covers%20the%20core%20Helm%20CLI%20commands%20and%20workflows.&source=https://mkabumattar.com "Share on LinkedIn")[WhatsApp](https://wa.me/?text=Helm%20https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fhelm "Share on WhatsApp")[Telegram](https://t.me/share/url?url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fhelm&text=Helm "Share on Telegram")[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fhelm&title=Helm "Share on Reddit")[Hacker News](http://news.ycombinator.com/submitlink?u=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fhelm&t=Helm "Share on Hacker News")[Pinterest](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fhelm&media=&description=Helm%20is%20the%20package%20manager%20for%20Kubernetes%20that%20simplifies%20deploying%2C%20managing%2C%20and%20upgrading%20applications%20through%20reusable%20charts.%20This%20cheatsheet%20covers%20the%20core%20Helm%20CLI%20commands%20and%20workflows. "Share on Pinterest")[Email](<mailto:?subject=Helm&body=Check out this article: https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fhelm>)

## Comments

## You might also enjoy

More posts on similar topics

## [Kubernetes](/cheatsheets/kubernetes)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   DevOps
-   Kubernetes
-   Container Orchestration
-   Cloud Native
-   Cluster Management

Kubernetes is the de facto standard for container orchestration. It automates deployment, scaling, and management of containerized applications across clusters of machines. Configuration is declarativ

#Kubernetes#Kubectl#Containers+5 tags

[read more](/cheatsheets/kubernetes)

## [kubectl](/cheatsheets/kubectl)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   DevOps
-   Kubernetes
-   CLI
-   Container Orchestration
-   Cloud Native

kubectl is the command-line tool you use to talk to a Kubernetes cluster. Whatever you can do through a dashboard, you can do faster here: deploy apps, inspect resources, stream logs, run commands ins

#Kubectl#Kubernetes#K8s+5 tags

[read more](/cheatsheets/kubectl)

## [Docker](/cheatsheets/docker)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   DevOps
-   Docker
-   Containers
-   Deployment

Docker is a containerization platform that packages applications with their dependencies into isolated, portable environments called containers. It enables developers to build, ship, and run applicati

#Docker#Containers#Images+3 tags

[read more](/cheatsheets/docker)

## [Docker Swarm](/cheatsheets/docker-swarm)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   DevOps
-   Docker
-   Containers
-   Orchestration
-   Deployment

This cheatsheet is a reference for managing Docker Swarm clusters, services, and stacks. It covers the commands and best practices for scaling, updating, and monitoring your swarm applications.

#Docker Swarm#Orchestration#Containers+4 tags

[read more](/cheatsheets/docker-swarm)

## [Docker Compose](/cheatsheets/docker-compose)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   Reference

Docker Compose is a tool for defining and running multi-container Docker applications. It uses a YAML file to configure application services, networks, and volumes. This cheatsheet provides a quick re

[read more](/cheatsheets/docker-compose)

## [Dockerfile](/cheatsheets/dockerfile)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   Reference

This cheat sheet covers the core Dockerfile instructions, best practices, and common pitfalls for building small, secure Docker images. Each section pairs a Dockerfile snippet with the build output it

[read more](/cheatsheets/dockerfile)

6 related posts
