Introduction to Helm - Package Manager for Kubernetes

Introduction to Kubernetes and Helm 

Kubernetes is one of the best platforms to deploy and manage containerized applications. But deploying such containerized applications to Kubernetes can be challenging. You have to write a detailed YAML file to deploy resources like pods, deployments, and services on Kubernetes that’s where Helm comes into the play. Helm is a package manager for Kubernetes; it’s the yum and apt of Kubernetes. It allows us to deploy resources to Kubernetes quickly. It deploys charts which are the packages of application. Helm is also an official Kubernetes project in the Cloud Native Computing Foundation (CNCF) under the category of incubating projects.

Completely Managed Kubernetes operations, including monitoring, deployment and optimized usage of Kubernetes in complex environments.

Explore our Services, Managed Kubernetes as a Service

Why we need Helm?

Helm makes deployments so easy in Kubernetes, all you need to add helm charts on your Kubernetes cluster. All the Helm charts are stored in Helm repository; you can search the required application chart on Helm registry and add them to your Kubernetes cluster with ease. For example, if you want to deploy a WordPress app on your Kubernetes, you have to create Yaml manifest files for deployment and service for both app and database, which can be quite complicated. Still, by using Helm you can deploy WordPress in a few minutes on your Kube cluster. Also if you want to deploy 50 microservices on Kubernetes using manifest files it consumes a whole lot of time and also there is an exorbitant probability of errors. Still, in case of Helm, you have to remember the name of required charts, and you can deploy these as quick as Flash. 

How to install Helm?

The process of installing Helm is effortless, you can install it using the binaries, or you can use package managers.

From homebrew on macOS:

brew install Helm

From Chocolatey on windows:

choco install Kubernetes-helm

From installer script:

Helm now comes with an installer script, you can fetch this script to your system, and it automatically installs the latest version of Helm in your system.

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

$ chmod 700 get_helm.sh

$ ./get_helm.sh

From binary release

1. Download the required version from “https://github.com/helm/helm/releases”

2. Unpack it using tar -zxvf helm-v3.0.0-linux-amd64.tar.gz (for linux)

3. Move to helm binary to desired location (mv linux-amd64/helm /usr/local/bin/helm)

After the installation of Helm in your system you can use the Command “helm version” to check the version of the Helm and also it verifies that Helm is successfully installed in your system.

Helm charts

The applications packages in Helm are called charts; they consist of YAML files and templates that are used for Kubernetes Deployments.

The structure of Helm charts

├── Chart.yaml

├── README.md 

├──LICENSE

├── templates

│ ├── NOTES.txt

│ ├── _helpers.tpl

│ ├── configmap.yaml

│ ├── deployment.yaml

│ ├── pvc.yaml

│ ├── secrets.yaml

│ └── svc.yaml└── values.yaml 

  • Chart.yaml

 This file contains the metadata about the chart, such as the chart’s name, version, and keywords.

  • README.md

 This file has information about the chart for the users so that they face no difficulty in using this chart.

  •  LICENSE

 This file contains a plain text license for the chart.

  • templates

 This directory contains the templates files of the chart, and when they combined with values, they generate the valid Kubernetes manifest files.

  • requirements.yaml

This file contains the list of all the dependencies of a chart.

  •  values.yaml

This file contains the default configuration values for a chart.

  •  configmap.yaml

This file contains the database configurations.

  • secrets.yaml

 This file stores all the database passwords. 

These charts can be installed from a local directory or a .tar.gz file. You can also use the repository to install charts in your Kubernetes.

Helm Repository

 A Helm repository is a server that acts as an arsenal for the Helm charts. We can use any HTTP server that can serve YAML files and tar files as a Helm repository. A Helm repo contains an index.yaml file that has the list of all the packages. On the other hand, at the user side or the client-side “helm repo” command is used to manage the repositories.

Helm Commands:

  • To install tiller

  helm init

  • To create a chart

 helm create <chart name>

  • To List the repositories

 helm repo list

  • To search a chart

 helm search <chart name>

  • To install a chart

 helm install <chart name> <flag>

  • To inspect a chart

 helm inspect <chart> <flag>

  • Install application using Helm

 Installing apps using Helm is quite easy; you can install very complex applications in just a few minutes. First of all, you have to add a repo in your system using Helm, and you can install any deployments available in that repo into your Kube cluster.

 For example, To install Jenkins using Helm we use Bitnami repository: 

  • To install Bitnami repository, we’ll use the command

 helm repo add bitnami https://charts.bitnami.com/bitnami 

  • To install Jenkins chart with a given name

 helm install –name jenk bitnami/Jenkins 

  • To check deployment on Kubernetes

 kubectl get deploy

This command shows you all the deployments running in your system, and you’ll also see Jenkins deployment there.

Conclusion

Kubernetes is undoubtedly the future of container orchestration. Helm is the best way to use Kubernetes effectively and efficiently, helm not just only helps developers who want to install some apps on Kubernetes, but it also helps DevOps engineer, they can still create YAML manifest files and use kubectl commands to do deployments. Yet, Helm helps them in reducing the complexity of deployment on Kubernetes, by using Helm they can define app quickly and deploy it easily on Kubernetes.  

There is no limit to the advantages of Helm. Still, it doesn’t mean that it is perfect like every other thing helm have limitation too, it requires too much logic to write its template, and it’s tough for a beginner to work on the Helm and also it has some security issues. Surely, Helm is not impeccable yet, but it’s growing continuously and rapidly with the support of the large, passionate community behind it, even recently Helm releases the latest version of its known as Helm3, with the rich set of new features it decreases the security problems of Helm, with this increasing speed we can believe that the day is not far when Helm becomes a perfect match for Kubernetes.

Also, read Kubecost – Cost Analysis with Kubernetes Monitoring



Leave a Comment

Name required.
Enter a Valid Email Address.
Comment required.(Min 30 Char)