What is Helm ?

Helm is a package manager for Kubernetes. It makes it easy to create and deploy applications or services which are highly repeatables into a Kubernetes Cluster.

Helm uses “charts” which are a group of files that describe a related set of Kubernetes resources (pods, services, configmaps etc.)

Helm is made of two components:

The Helm Client is a command-line client for end users. The client is responsible for the following:

  • Local chart development
  • Managing repositories
  • Managing releases
  • Interfacing with the Helm library
  • Sending charts to be installed
  • Requesting upgrading or uninstalling of existing releases

The Helm Library which provides the logic for executing all Helm operations. It interfaces with the Kubernetes API server and provides the following capability:

  • Combining a chart and configuration to build a release
  • Installing charts into Kubernetes, and providing the subsequent release object
  • Upgrading and uninstalling charts by interacting with Kubernetes

Why Helm ?

Imagine you want to deploy a WordPress application on Kubernetes. You will have to create a lot of yml files for each resources such as nginx deployments, databases deployments, external and internal services etc. You can do it in only one file but it will quickly be a nightmare to maintain.

Helm solves the problem by giving the ability to run this WordPress solution in a single package with a simple command.

Installing Helm

You can find all installation procedures through this link.

In my case, I installed directly the binary as so :

  1. Download your desired version
  2. Unpack it (tar -zxvf helm-v3.0.0-linux-amd64.tar.gz)
  3. Find the helm binary in the unpacked directory, and move it to its desired destination (mv linux-amd64/helm /usr/local/bin/helm)

Helm Components

Here are the different files you will find in a Helm chart :

  • chart.yml : Description of the package
  • deployment.yml, service.yml, etc : One or more templates which contain Kubernetes manifest files
  • values.yml : file having values of all configuration variables shared by more than one deployments

Basic Commands

Let’s see together Helm basic commands :

  • Create a chart :
$ helm create <chart>
$ helm repo list
  • Search for a chart :
$ helm search <keyword>
  • Get information about a chart :
$ helm inspect <chart>
  • Deploy a chart (creates a release):
$ helm install <chart>
  • List all releases:
$ helm list --all
  • Upgrade a release:
$ helm upgrade <release> <chart>
  • Roll back a release:
$ helm rollback <release> <revision>
  • Delete a release:
$ helm delete <release>

Templating

Finally, one important feature with Helm is templating.

Imagine you have deployments and services which are pretty much the same, with only differences being the name or the Docker version image. Instead of having to write separates YAML files for each of them, you can use Helm to define a common blueprint for all microservices like a template file :

As you can see, the template inserted the image version from the values.yaml.

That’s all for today, in the next article we will deploy applications using Helm !

Sources

jfrog.com

youtube.com (agent of change)

medium.com/tenable-techblog

Leave a Comment

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