Friday, December 27, 2024
Google search engine
HomeGuest BlogsInstall and Use Helm 3 on Kubernetes Cluster

Install and Use Helm 3 on Kubernetes Cluster

Welcome to today’s guide on how to install and use Helm 3 in your Kubernetes environment. Helm is the ultimate package manager for Kubernetes. It helps you manage Kubernetes applications by using Helm Charts – With it you can define, install, and upgrade basic to the most complex Kubernetes applications alike.

Helm 3 doesn’t have the server/client architecture like Helm 2. There is no tiller server component. So the installation is just for the helm command line component which interacts with Kubernetes through your kubectl configuration file and the default Kubernetes RBAC.

For Helm 2, checkout: Install and Use Helm 2 on Kubernetes Cluster

Step 1: Install Helm 3 on Linux | macOS

Download Helm 3 installation script.

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

Give the script execute permissions.

chmod 700 get_helm.sh

Run the installer.

sudo ./get_helm.sh

Here is a sample installation output:

Downloading https://get.helm.sh/helm-v3.12.3-linux-amd64.tar.gz
Verifying checksum... Done.
Preparing to install helm into /usr/local/bin
helm installed into /usr/local/bin/helm

Confirm installation of Helm 3

$ helm version
version.BuildInfo{Version:"v3.12.3", GitCommit:"3a31588ad33fe3b89af5a2a54ee1d25bfe6eaa5e", GitTreeState:"clean", GoVersion:"go1.20.7"}

Step 2: Add Helm Chart repository

Once you have Helm installed, add a chart repository. Add official charts repository:

$ helm repo add stable https://charts.helm.sh/stable
"stable" has been added to your repositories

In this example we’ll add bitnami repository:

$ helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories

Adding Nginx helm chart.

$ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
"ingress-nginx" has been added to your repositories

You will then be able to list the charts that can be installed:

helm search repo stable

Listing charts in the bitnami repository:

helm search repo bitnami

Step 3: Install Applications on Helm Chart

Confirm that your Kubernetes CLI is using the right cluster context by first listing the available contexts.

$ kubectl config get-contexts
CURRENT   NAME       CLUSTER    AUTHINFO         NAMESPACE
*         k3s        k3s        k3s-admin        kube-system
          prod       prod       prod-admin   

Switch to desired context:

$ kubectl config use-context k3s
Switched to context "k3s".

We will confirm if we can use Helm 3 to install applications on our Kubernetes cluster. In this setup, I’ll install Nginx ingress controller. NGINX Ingress controller can be easily installed from official Helm chart stable/nginx-ingress repository.

$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈

Get chart features:

$ helm show chart ingress-nginx/ingress-nginx
annotations:
  artifacthub.io/changes: |
    - "Added a doc line to the missing helm value service.internal.loadBalancerIP (#9406)"
    - "feat(helm): Add loadBalancerClass (#9562)"
    - "added helmshowvalues example (#10019)"
    - "Update Ingress-Nginx version controller-v1.8.1"
  artifacthub.io/prerelease: "false"
apiVersion: v2
appVersion: 1.8.1
description: Ingress controller for Kubernetes using NGINX as a reverse proxy and
  load balancer
home: https://github.com/kubernetes/ingress-nginx
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png
keywords:
- ingress
- nginx
kubeVersion: '>=1.20.0-0'
maintainers:
- name: rikatz
- name: strongjz
- name: tao12345666333
name: ingress-nginx
sources:
- https://github.com/kubernetes/ingress-nginx
version: 4.7.1

Install the chart using the helm install command.

helm upgrade --install ingress-nginx ingress-nginx \
  --namespace ingress-nginx --create-namespace

You can as well let the installer generate the name of your chart release (omits the NAME parameter). You will be greeted with a message like below after the installation.

Confirm installation:

helm ls

To uninstall a release, use the helm uninstall command:

$ helm uninstall ingress-nginx
release "nginx-ingress" uninstalled

$ helm list                   
NAME	NAMESPACE	REVISION	UPDATED	STATUS	CHART	APP VERSION

Below example if for the installation of DokuWiki on Kubernetes using Helm.

helm install dokuwiki stable/dokuwiki 

Enjoy using Helm to manage Applications lifecycle in your Kubernetes environment.

Other guides on Kubernetes

RELATED ARTICLES

Most Popular

Recent Comments