Helm and Helm Charts
Tags: kubernetes, helmchart, devops, tutorial
Published: 2022-12-20 08:16:30

## Overview

what is Helm? It is a package Manager for Kubernetes, just like apt is for ubuntu.

Let's say we have an application running on the Kubernetes cluster, to setup `Logging` using say, Elastic Stack, we need to create `Stateful set` for database, `ConfigMap` for external configuration, `Secret` for storing secrets, `Services` for the dashboard and finally a user with permissions. The amount of work required for the standard setup of a logging service is huge and it is pretty much the same for everyone out there. Why not just bundle up all the YAML files and made them available to other users? Helm calls this bundle of YAML files `Helm Charts`

### Helm Charts

Helm Charts are just Bundles of the YAML Files, which can be shared with users through Registries like Helm Hub. Users can create their own Helm Charts with Helm, this would also allow them to package the deployment in the dev environment and use the same in the prod environment or vice versa. Or you can also download and use the existing Helm charts, cutting down your deployment time.

Helm is also a Templating Engine, in deployments where multiple microservices exist, there would be multiple yaml files for each microservice, Using helm we can replace multiple similar YAML files with a single template file kind of like a blueprint, which takes values from `values.yaml` see the below example

Example Template file


![Template file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t9rzixvmztxki8fib5ta.png)

The values are coming from the value.yaml file below


![values.yaml](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/08omngi32hegeamjwfod.png)



Next up, we can see the structure of a Helm Chart

```plaintext
my_chart/
 Chart.yaml
 values.yaml
 charts/
 templates/
```

`my_chart` is the name of the chart.

`Chart.yaml` contains metadata information

`values.yaml` contains the values for the template files

`charts` contains the chart dependencies

`templates` contains the template files

`helm install <chartname>` injects the values from values.yaml into the template files and creates the Kubernetes manifests to be deployed.

Let's Assume that we are using the helm templates but the values inside the yaml file are something that we would like to change, in that case, we can define our own `.YAML` file and pass it while installing the helm chart as below

> helm install --values=my-values.yaml &lt;chartname&gt;

## Release Management

Helm version 2 comes in the form of a client i.e. helm CLI and a server component i.e. Tiller. It runs inside the Kubernetes cluster and deploys the components inside the cluster. It also keeps a history of chart executions, each time a new chart is Installed or upgraded, providing the rollback feature in case of deployment failure However this makes Tiller a big security concern, Hence in Helm version 3, Tiller was removed. So the Release Management feature although available in version 2 is not available in the latest releases.

### References

[What is Helm in Kubernetes? Helm and Helm Charts explained | Kubernetes Tutorial 23](https://www.youtube.com/watch?v=-ykwb1d0DXU)