Helm is a tool for managing Kubernetes applications, simplifying the deployment, updating, and maintenance of complex applications that consist of multiple Kubernetes objects. Essentially, Helm can be compared to a package manager for Kubernetes, similar to apt
or yum
in Linux, but specifically adapted for managing Kubernetes clusters.
Helm addresses several key tasks:
Applications can be made up of dozens or even hundreds of Kubernetes objects, such as pods, services, configurations, and more. Helm consolidates these into a single package called a chart, which can be deployed with a single command. This approach significantly reduces the complexity of manually configuring applications.
Each chart can have multiple versions, making it easy to roll back to a previous version or update an application. Helm supports version control, tracks changes in deployed applications (releases), and allows rollbacks when necessary.
Helm uses templates to generate Kubernetes configuration files, simplifying the customization of parameters such as the number of replicas, network access settings, databases, and other variables. These settings are stored in a special configuration file values.yaml
. This allows the same chart to be used across different environments (development, testing, production) with minimal modifications.
Charts are stored in repositories, which can be either public or private. Helm allows adding, updating, and installing applications directly from different repositories. For example, the popular Bitnami repository contains many ready-to-use charts for various services.
Helm is closely tied to the Kubernetes version, so it’s essential to choose a version compatible with your cluster. You can refer to the Helm and Kubernetes compatibility table in the official documentation.
For Kubernetes versions from 1.28.x to 1.31.x, the latest version of Helm (3.16.x) is recommended.
For Kubernetes versions 1.26.x and 1.27.x, use Helm version 3.14.x.
To install Helm on Linux, you can use the official script for automated installation:
Download the installation script and make it executable:
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 700 get_helm.sh
Run the script to install the latest version of Helm:
./get_helm.sh
If you have Kubernetes versions 1.26.x or 1.27.x, specify the required Helm version:
./get_helm.sh -v 3.14.1
To install Helm through the system package manager on Ubuntu, follow these steps:
Add the Helm repository signing key:
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
Install the apt-transport-https
package if it’s not already installed:
sudo apt install apt-transport-https --yes
Add the Helm repository to your APT sources:
echo "deb [arch=$(dpkg --print-architecture) 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.list
Update your package list:
sudo apt update
Install Helm:
sudo apt install helm
For Kubernetes versions 1.26.x and 1.27.x, install the corresponding Helm version:
sudo apt install helm=3.14.2-1
Verify the installation:
helm version
To install Helm on Windows, follow these steps:
Run PowerShell as Administrator.
Install Helm with the following command:
winget install Helm.Helm
For Kubernetes versions 1.26.x and 1.27.x run:
winget install Helm.Helm -v 3.14.1
Verify the Helm version:
helm version
To install Helm on MacOS, you can use the official automated installation script:
Download the installation script and make it executable:
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 700 get_helm.sh
Run the script to install the latest Helm version:
./get_helm.sh
For Kubernetes versions 1.26.x and 1.27.x, specify the required Helm version:
./get_helm.sh -v 3.14.1
If you use Homebrew, you can install Helm with it. Note that only the latest version of Helm is available in Homebrew repositories. To install, run:
brew install helm
Verify the Helm version:
helm version
Helm uses repositories to store and distribute charts — application packages that can be installed in Kubernetes. Repositories help manage applications from centralized sources, simplifying the processes of installing, updating, and removing applications.
To install an application from a remote repository, you first need to add it to the list of available sources. This is done using the helm repo add
command. For example, to add the popular Bitnami repository, run the following command:
helm repo add bitnami https://charts.bitnami.com/bitnami
Helm supports both public and private repositories. Private repositories may require authentication credentials, such as a token or a username and password.
Charts in repositories may be updated, so to ensure you have the latest versions, it’s necessary to periodically update repository information. Use the following command:
helm repo update
This command synchronizes your local chart index with the current content of remote repositories.
You can view a list of all connected repositories with this command:
helm repo list
Example output:
If a repository is no longer needed, you can remove it using the helm repo remove
command. For example, to remove the Bitnami repository, run:
helm repo remove bitnami
This command only removes the repository from your local Helm configuration. The charts and installed applications themselves are not affected.
After setting up repositories, you can search for and install applications in Kubernetes using Helm.
To find a specific chart in connected repositories, use the following command:
helm search repo <application_name>
For example, to search for NGINX, run:
helm search repo nginx
To install an application, use this command:
helm install <release_name> <repository>/<chart_name>
For example, to install NGINX from the Bitnami repository:
helm install my-nginx bitnami/nginx
To check the application’s status, use:
kubectl get pods
To get release-specific information:
helm status <release_name>
To customize chart parameters, use:
helm install my-nginx bitnami/nginx --set service.type=NodePort
To remove an application and its resources, run:
helm uninstall <release_name>