# What is HELM?

objectives

* Helm
    
* Installation
    
* Architecture
    
* Charts
    
* Functions
    
* Pipelines
    
* Conditionals
    
* with Blocks
    
* Range
    
* Chart Hooks
    
* Packaging & Signing
    
* Uploading
    

What is Helm?

* Helm is a package manager in the Kubernetes.
    
* `helm install WordPress`
    
* `helm upgrade WordPress`
    
* `helm rollback WordPress`
    
* `helm uninstall WordPress`
    

Installing Helm

Requirements:

* sudo snap install helm
    
* sudo snap install helm --classic
    

\--classic gives more priveledges to the host system

Helm 2 vs. Helm 3

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695702422296/93970d0c-e2c4-47e3-b96b-7e15487b425c.png align="center")

### Helm 2

we require Tiller to be installed in the cluster to perform the Kubernetes tasks.

Tiller is a middleware between the k8s cluster and helm.

Tiller by default run in guard mode.

Every change is stored as a snapshot in the form of revisions.

### Helm 3:

Not using the Tiller as middleware

3-way strategic Merge Patch

### Helm Components:

Release is a single installation of an application.

Each Release has multiple Revisions in it.

Metadata can be stored in secret in the k8s cluster

Charts are collections of objects.

**Templating in Helm**

*syntax*

{{ .Values. name}}

helm install \[release\]\[chart-name\]

helm install my-site bitnami/WordPress

releases are more useful for launching the same application as multiple apps.

**Helm Repositories**

`ArtifactHib.io`

All the artefact repositories are stored in the Hub.

**Helm charts**

Charts are the instruction manuals.

Helm structure

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695703853571/5a8752ed-ae2e-4d24-8fd3-4aa884a59012.png align="center")

Helm CLI

`helm --help`

`helm repo --help`

`helm repo update --help`

`helm search wordpress`

`helm search hub wordpress`

Deploying WordPress

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

`helm install my-release bitnami/WordPress`

**Helm Releases**

`helm list`

`helm uninstall my-release`

`helm repo`

`helm repo list`

`helm repo update`

**Customizing Chart parameters**

custom Parameters in Command Line --set

`helm install --set wordpreddBlogName="Helm Tutorials" my-release bitnami/WordPress`

This will replace the values in the Values.yml

we can also pass those values as custom values by creating another file for it as `custom-values. yaml`

`helm install --values custom-values.yaml my-release bitbami/WordPress`

`helm pull bitnami/WordPress`

`helm pull --untar bitnami/wordpress`

`ls WordPress`

`helm install my-release ./wordpress`

### Life Cycle Management

Each release is independent of the other. we can revert the things based on your requirement

`helm install nginx-release bitnami/nginx --version 7.10`

`helm upgrade nginx-release bitnami/nginx`

`helm list`

`helm history nginx-release`

`helm rollback nginx-release 1`

whenever we roll back the release it will create a new revision.

### **Helms Charts Atanomy**

`helm create <helm-chart-name>`

It will create a sample helm chart.

**Templatize**

Templatize is useful to pass the values as dynamic in the template files

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695718346649/b497c4ed-349b-4482-90d4-9325ca11973e.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695718566538/e3ddde12-698b-4fc0-996f-aa1f3370b6f2.png align="center")

**Verifying the Helm charts**

Lint: It is used to verify the yaml files are correct

**Template:**

Dry Run: This will be useful to verify the chart will run in the k8s cluster

`helm template ./nginx-chart`

`helm template release-Naem ./nginx-chart`

`helm template release-Naem ./nginx-chart --debug`

`helm install hello-world-1 ./nginx-chart --dry-run`

### Functions

upper

`{{ upper .Values.image.repository }}`

quote

`{{ quote .Values.image.repository }}`

replace

`{{ replace "x" "y" .Values.image.repository }}`

shuffle

`{{ shuffle .Values.image.repository }}`

refer the documentation pages

`{{ default "nginx" .Values.image.repository }}`

**Pipelines**

`{{ .Values.image.repository | upper | quote | shuffle }}`

**Conditionals**

`{{- if .Values.orgLabels }}`

`labels:`

`org: {{ .Values.orgLabel }}`

`{{- end }}`

`-` removes the extra spaces in the file

`{{- if .Values.orgLabels }}`

`labels:`

`org: {{ .Values.orgLabel }}`

`{{- else if eq .Values.orgLabel "hr" }}`

`labels:`

`org: human resources`

`{{- end }}`

| Function | Purpose |
| --- | --- |
| eq | equal |
| ne | not equal |
| lt | less than |
| le | less than or equal |
| gt | greater than |
| ge | greater than or equal |
| not | negation |
| empty | value is empty |

**With Blocks**

. -&gt; Root scope

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695727485379/3571eb75-151c-47e3-bab0-69b4223f0291.png align="center")

if we are not specifing the scope then we need traverse from root only

we can define scope using the with block

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695727665514/375a3be6-06d9-46ff-a95f-61a2dc5b589d.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695727727147/dcbbaf38-6b53-4a1c-9f67-51aa32dea094.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695727777943/a574b870-1ec6-40ac-9311-35f730e92c8b.png align="center")

**Range**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695728148110/417b4c1c-77d9-4b7b-996f-cb10953761f6.png align="center")

Named Templates

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695728701761/44918406-8aa9-482e-b5dc-79aa8e8231b2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695728720541/ad45c12d-813e-426a-9e90-0fc3a05c9071.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1695728794317/d57f100f-ac2b-411d-a899-405e1c5f7856.png align="center")

---

Thanks for reading! I hope you found this helpful and informative.

I'm always happy to connect with fellow tech enthusiasts and answer any questions you may have. Don't forget to follow me for more updates on tech, programming, and more.😄😄

Follow me on LinkedIn to see interesting posts like this : ) [**Linkedin**](https://www.linkedin.com/in/subbaramireddy/)
