Jump to content

How To Install Helm 3 For Kubernetes


Recommended Posts

This post explains the steps to install helm 3 on kubernetes 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.

Install Helm 3 – 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 3 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

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 have 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.5.4-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

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

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 3, install char 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 images from the security team.

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

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

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...