Sign In
Sign In

Working with Helm

Updated on 28 October 2024

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:

  • Simplified Deployment

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.

  • Version Control for 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.

  • Reusable Configurations

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.

  • Centralized Repository Management

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.

Installing Helm

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.

Linux

To install Helm on Linux, you can use the official script for automated installation:

  1. 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
  1. Run the script to install the latest version of Helm:

./get_helm.sh
  1. If you have Kubernetes versions 1.26.x or 1.27.x, specify the required Helm version:

./get_helm.sh -v 3.14.1

Installation via Repository on Ubuntu

To install Helm through the system package manager on Ubuntu, follow these steps:

  1. Add the Helm repository signing key:

curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
  1. Install the apt-transport-https package if it’s not already installed:

sudo apt install apt-transport-https --yes
  1. 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
  1. Update your package list:

sudo apt update
  1. Install Helm:

sudo apt install helm
  1. For Kubernetes versions 1.26.x and 1.27.x, install the corresponding Helm version:

sudo apt install helm=3.14.2-1
  1. Verify the installation:

helm version

Windows

To install Helm on Windows, follow these steps:

  1. Run PowerShell as Administrator.

  2. Install Helm with the following command:

winget install Helm.Helm
  1. For Kubernetes versions 1.26.x and 1.27.x run:

winget install Helm.Helm -v 3.14.1
  1. Verify the Helm version:

helm version

MacOS

To install Helm on MacOS, you can use the official automated installation script:

  1. 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
  1. Run the script to install the latest Helm version:

./get_helm.sh
  1. For Kubernetes versions 1.26.x and 1.27.x, specify the required Helm version:

./get_helm.sh -v 3.14.1

Installation via Homebrew

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

Setting Up Helm Repositories

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.

Adding a Repository

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.

Updating Repositories

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.

Viewing Available Repositories

You can view a list of all connected repositories with this command:

helm repo list

Example output:

Image2

Removing a Repository

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.

Installing Applications with Helm

After setting up repositories, you can search for and install applications in Kubernetes using Helm.

Searching for Applications in Repositories

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

Installing an Application

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

Checking the Status of an Installed Application

To check the application’s status, use:

kubectl get pods

To get release-specific information:

helm status <release_name>

Overriding Installation Parameters

To customize chart parameters, use:

helm install my-nginx bitnami/nginx --set service.type=NodePort

Uninstalling an Application

To remove an application and its resources, run:

helm uninstall <release_name>
Was this page helpful?
Updated on 28 October 2024

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support