How To Install Helm For Kubernetes

Helm Tutorial on installation

This post explains the steps to install Helm and install Helm charts for managing and deploying applications on the Kubernetes cluster.

Helm Prerequisites

You should have the following before getting started with the helm setup.

  1. A running Kubernetes cluster.
  2. The Kubernetes cluster API endpoint should be reachable from the machine you are running helm.
  3. Authenticate the cluster using kubectl and it should have cluster-admin permissions.

Method 1: Install Helm Using Script

I recommend this method if you are setting up a test environment in your local workstation or a server. For project requirements, please follow the binary installation of the specific version that is explained in the next section.

Note: The workstation you are running should have the kubectl context set to the cluster you want to manage with Helm.

Step 1: Download the latest Helm installation script.

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3

Step 2: Add execute permissions to the downloaded script.

chmod +x get_helm.sh

Step 3: Execute the installation script. This script will automatically find the right binary for your system.

./get_helm.sh

Step 4: Validate helm installation by executing the helm command.

helm

Method 2: Install Helm 3 From Binary

This method is recommended for project requirements where you can have a specific version of Helm installed across all the environments.

For example, if you are using Jenkins for Helm deployments, ensure the Jenkins agent where the Helm command runs has kubectl configured with admin permissions.

Step 1: Head over to the Github helm release page and copy the Linux amd64 link for the required version.

helm installation binary - release page

Step 2: Download the binary using wget.

wget -O helm.tar.gz https://get.helm.sh/helm-v3.13.0-rc.1-linux-amd64.tar.gz

Step 3: Untar the downloaded file.

tar -zxvf helm.tar.gz

Step 4: Move the helm executable to the bin directory.

sudo mv linux-amd64/helm /usr/local/bin/helm

Step 5: Validate by executing the helm command.

helm

Method 3: Install Helm From Package Managers

For Mac,

brew install helm

For Debian/Ubuntu,

curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https --yes
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
sudo apt-get update
sudo apt-get install helm

For Windows,

# For Scoop

scoop install helm

#For Chocolatey

choco install kubernetes-helm

Upgrade Helm Executable

If you are using a older version of helm and if you want to upgrade it to the latest version, you can use the following steps as per the OS type.

For MAC,

brew update
brew upgrade helm

For Linux,

The following script will fetch the latest version and upgrades it.

curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

For Windows,

choco upgrade kubernetes-helm

After the upgrade check the version using the following command.

helm version

Add Stable Helm Repo

The Helm repo contains the stable helm charts developed and maintained by the community.

Now, add the public stable helm repo for installing the stable charts.

helm repo add stable https://charts.helm.sh/stable

You can search the available chart using the search command. For example, if you want to set up Jenkins on Kubernetes, you can search for Jenkins chart using the following command.

helm search repo jenkins

Alternatively, you can search for stable community charts via artifacthub.com. Here you can find many community-contributed helm charts.

search helm charts

Install & Validate Helm Chart

To validate the helm setup let’s set up the Nginx ingress controller using the helm chart available in Artifacthub.

Step 1: First add the nginx-ingress helm repo.

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx

Step 2: Update the chart repo.

helm repo update

Step 3: Let’s install a stable Nginx chart and test the setup. The ingress controller gets deployed in the default namespace.

helm install ingress-controller ingress-nginx/ingress-nginx

Here ingress-controller is the custom release name. You can give the name of your preference.

Step 4: Now, check the status of the ingress helm deployment using the following command. It should show the status of the deployment.

helm ls

Alternatively, you can use the kubectl command to check the ingress deployment in the default namespace.

kubectl get deployments

Step 4: Now, to remove the deployment after validation, all you have to do is uninstall the deployment using its release name.

helm uninstall ingress-controller

Conclusion

In this post, we have seen how to install Helm, install chart repo, and validate a sample Helm deployment.

When you use helm for project use cases, it is recommended you create your own helm charts with approved container images from the security team.

If you use community helm charts in project environments, ensure you replace the community docker images with custom-built images.

Next, look at the comprehensive beginner’s guide on how to create a Helm chart. It covers the helm chart development and its best practices using step-by-step guides.

6 comments
    1. Hi Venkat,

      Helm 3 is a client binary. You don’t have to uninstall anything from the Kubernetes cluster. Only in Helm2, there was this concept of tiller where you have to delete the tiller deployment.

  1. With the command
    > helm repo list
    one can list all repos in helm. I think this would be useful to add here. I am also new to k8s and helm and these sort of commands are helpful to learn and to double check.

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like