Helm: The Kubernetes Package Manager, Part 1
Helm is one of the most powerful tools for managing Kubernetes applications. If you’ve struggled with writing or maintaining large numbers of Kubernetes manifests (YAML files), Helm might help you.
In this comprehensive guide, we’ll explore:
What Helm is and why it’s used
How Helm works behind the scenes
Key Helm components like charts, repositories, and Artifact Hub
How to install Helm on various platforms
How to use Helm to deploy real applications with examples
What Is Helm?
At its core, Helm is a package manager for Kubernetes. Think of how apt works for Ubuntu, or yum for CentOS. Just like those tools manage software packages for operating systems, Helm manages Kubernetes applications.
A Helm chart is like a packaged app. It contains all the resource definitions necessary to run an app inside a Kubernetes cluster. Helm makes it easy to install, configure, and manage those charts, which may include complex apps like databases, web servers, or full microservice systems.
Why Use Helm?
Managing Kubernetes resources manually involves a lot of YAML files — Deployments, Services, ConfigMaps, etc. — and updating them can be tedious and error-prone.
Here’s why Helm is a game-changer:
Simplicity and Reusability
Helm uses templates to generate Kubernetes manifests. We can write the template once and reuse it by passing different values.
Versioning and Rollbacks
Helm keeps a version history of each release. If something breaks after an update, we can roll back with a single command.
Configuration Management
Pass custom values during installation or upgrades using --set YAML files. No need to hard-code config into manifests.
Repeatable Deployments
We can store, share, and reuse charts across environments like dev, staging, and production.
How Helm Works: Components and Architecture
Helm follows a client-side architecture since version 3 (no Tiller needed). It interacts directly with the Kubernetes API server.
Helm Architecture Overview
Helm CLI: The command-line tool used to manage charts.
Helm Chart: A directory that contains templates, configuration files, and metadata.
Helm Release: A deployed instance of a chart in a Kubernetes cluster.
Helm Repository: A collection of charts available for download.
Artifact Hub: A public web service to discover and share charts.
What Is a Helm Chart?
A Helm chart is a structured collection of files, like:
You can think of it as a Kubernetes app blueprint. Charts can be versioned and shared like packages in other ecosystems.
Artifact Hub and Repositories
Artifact Hub: https://artifacthub.io A public repository of Helm charts from thousands of publishers. You can search for charts like nginx, mongodb, etc.
Helm Repository: A URL (like a Git repo) where charts are hosted. You can add custom or public repos with helm repo add.
How to Install Helm
Helm works on Linux, macOS, and Windows. Here are the most popular installation methods:
From Installation Script (Cross-platform)
macOS: Homebrew
Windows (Choose One)
Using Chocolatey:
Using Scoop:
Using Winget:
Debian/Ubuntu: APT
Fedora/CentOS: DNF/YUM
For full installation instructions and troubleshooting, see helm.sh/docs/intro/install
Let’s Deploy A Helm Chart
Let’s put all this knowledge into practice. We’ll create a Kubernetes cluster with kind, then install a production-grade NGINX server using Helm.
Step 1: Create a Local Kubernetes Cluster (using Kind)
Create a file named kind-cluster-config.yaml:
Run the command:
Verify the cluster is running:
Step 2: Add a Helm Repository
Bitnami offers production-ready Helm charts.
Step 3: Install NGINX Using Helm
Check installation status:
List installed charts:
Step 4: Access the NGINX Web Server
Forward port 80 of the NGINX service:
Open a browser at http://localhost:8080.
Step 5: Uninstall and Track Helm Releases
To uninstall NGINX but keep history:
Now check the helm releases:
To view all releases, including the uninstalled releases, add -a flag:
Step 6: Upgrade and Rollback Helm Charts
Install again:
Upgrade to an older version:
View history:
Rollback to previous revision:
Step 7: View and Customize Chart Values
Before installing a chart, you can see its default values:
Override them using --set or create a custom-values.yaml.
Example:
Thanks for reading.
In the next part of this article, we will explore how to create and package our Helm chart from scratch, including using templates, values.yaml, in sha Allah.