Quick Start with Helm

Kiranms
Cloudnloud Tech Community
8 min readApr 30, 2023

Hello Readers,

Learning becomes enjoyable 💁🏽‍♂️ , When we try to connect technical dots between our day-to-day life or surroundings 🤗.

Before we start understanding Helm. Lets take same example from our day to day life, if I am hosting Birthday Event, what are the things do i need to arrange to get this event successful.

To host nice Birthday Event , I need to take care of few arrangements on my own like getting Decorative Items, food, drinks etc. So to achieve this task, what I will do, I will go to Each store and get this all the things separately one by one and then manually start setting up everything on my own at my house. don’t you think this will be real time consuming and some time I may miss few things and that may mess my Birthday Party.

To reduce burden of my head, What i can think of to package this event by Event organiser firm and they will take care everything for me to organise successful Birthday Event, so i don’t need to worry about all this stuff on my own. I hope at some point you have started connecting your dots what we are talking about.

Think about Kubernetes Admin like me’s life on Kubernetes to manage and deploy application manually on my own and it is real tedious job for me to manage at large scale of Kubernetes Clusters.

Lets take example of actual life of Kubernetes Admin like me , if i want to deploy simple NGINX web server on Kubernetes Cluster, I need a deployment to deploy entire stack with DB, PV, PVC, Service, Secrets etc. and I need to write YAML definition files for each object separately and then run the kubectl apply to create them one by one. this is one part now , lets think in other way, if i want to delete the NGINX web server with entire stack of DB, PV, PVC, Secrete and service i need to delete them one by one by mapping each object carefully. Now think how tedious job this will be again.

That is where Helm comes into the picture to ease our life to Manage and , Deploy application smoothly on Kubernetes Cluster. Helm provide us easy way to define,install and upgrade applications and Life Cycle Management of Application deployed on kubernetes.

What is Helm ?

Helm is a package manager for Kubernetes that allows us to manage, deploy, and share applications and services in a simple and easy way. It provides a way to package Kubernetes resources as YAML manifests, along with it’s dependencies, into a single deployable unit called a “chart.”

Helm Charts help us to define, install, and upgrade most complex Kubernetes application.

Helm Architectural Components :

Helm is implemented with two main components in Helm Version 3.

The Helm CLI : The Helm CLI is command line tool that users use to create, manage and deploy the charts. It also manages repositories, releases and interacting with helm library to install, upgrade and uninstall the charts.

The Helm Library : The Helm library is a set of Go libraries that provide us the functionality needed to manage and deploy charts on kubernetes. When we make the request to install the charts on the Kubernetes from Helm CLI , Helm talk to Kubernetes API server to achieve the desired operation.

Helm Components :

  • Chart : Chart is a helm package and it contains all the kubernetes definition which is necessary to run the application using Helm.
  • Release : Release is an instance of a chart and that is installed in the kubernetes cluster.
  • Chart Repository : Chart repository is a collection of charts that can be used to deploy packages on kubernetes from Helm repository.

Helm Version 2 & 3 :

These are the main difference between Helm 2 vs 3

  1. Architecture :
  • Helm 2 was using client-server architecture, with a Tiller server running on the Kubernetes cluster.
  • Helm 3 removed Tiller and brought a client-only architecture, that means that all operations which can directly performed on Kubernetes API server.

2. Security:

  • Helm 2 was having security issues for Tiller elevate permissions.
  • Helm 3 removed this issue by removing Tiller and brought Role-Based Access Control (RBAC) to control access to Kubernetes resources.

3. Chart dependencies:

  • Helm 3 brought new feature called chart dependencies, this allows charts to declare dependencies with other charts. This feature was not there in Helm 2.

4. Chart versioning:

  • Helm 3 brought new versioning scheme for charts, this makes life easier to manage and track different versions of charts.
  • 3-way strategic merge patch is one of the best feature in helm 3 which allows conflict resolution between package deployed with helm and by user changed manually by editing kubernetes objects, at the time of rollback this check the live state of current config and previous configuration done by helm and also by users.

5. Chart repository:

  • Helm 3 brought new format for chart repositories, this is more secure and efficient than the format were used in Helm 2.

Let get into the some action of Helming 🎬🎬🎬

Helm Installation :

Note: — Basic Requirement to install and run Helm you need Kubernetes cluster up and running. You can use any Kubernetes Solution (I used minikube) or Managed Kubernetes service from any cloud provider.

There are multiple ways to install helm on your system. in this example i going to use Ubuntu on my laptop so through out this blogs we are talking about Install on Ubuntu.

you can follow helm official documentation for specific OS based installation according to your need.

1. Download and install Helm package manager signing key.

# curl https://baltocdn.com/helm/signing.asc | gpg — dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null

Download GPG Key

2. Install apt-transport-https package, if you are installing helm on Debian-based operating system. this package is just to fetch packages from sources. (if you have this package installed already you can skip this steps)

# sudo apt-get install apt-transport-https — yes

Install apt-transport-https

3. Add GPG key

# echo “deb [arch=$(dpkg — print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main” | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list

Add GPG Key

4. if you want you can run the system update or skip, if your system already updated.

# sudo apt-get update

5. Install Helm.

# sudo apt-get install helm

Install Helm

Now install and setup some sample application like nginx with helm charts.

  1. Lets Add helm repo for nginx by bitnami and list after repo add.

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

#helm repo list

helm repo add and list

2. Now install our sample nginx app by helm chart.

#helm install my-nginx bitnami/nginx — version 14.0.0

Helm Chart Install

here we can see helm chart for nginx is successfully install , lets check by running kubectl command.

# kubectl get all

nginx deployed

Note :- I have deployed this nginx in my minikube, that is why you see service/my-nginx LoadBalancer Service is in pending state. to access your service you need to run minikube tunnel command to connect to LoadBalancer services, when you run minikube tunnel you LoadBalancer service receives IP.

minikube tunnel
watch your service

Now open your browser and check the nginx web page

nginx web page

Lets have quick understanding of helm chart files and directory structure, if we pull helm chart locally and see what are the things in there in chart.

helm pull
sample nginx tree

Lets have quick look at major helm chart structure of sample nginx chart.

  • Chart.yaml :- Chart files has the metadata for the helm chart including name, version, description and chart dependencies which required to install necessary component.
  • Values.yaml :- Values files contains default values for the chart configuration variable and can be change and customised as per need.
  • templates :- This is the directory and it has all the kubernetes YAML resource and definition files will be deployed from here when we run helm install.
  • deployment.yaml :- deployment contained the YAML for kubernetes resource deployment
  • service.yaml :- Service files contains kubernetes service object that will provide network access to external world.
  • ingress.yaml :- ingress files contains kubernetes ingress resource to route traffic for incoming and outgoing rules.
  • README.md :-Readme contains information about chart and details about helm chart and access part for deployment.

You can see many files in templates directory in above screen shot, you can connect dots accordingly as per name suggests.

lets have quick review of other Helm commands.

  • helm version :- Display installed helm version.
  • helm list :- List all the helm releases that are installed on system.
  • helm repo :- This commands provide sub commands to manage repo, add , delete and list
  • helm search :- Search helm repository charts
  • helm create :- Create new helm charts
  • helm lint :- Lint check helm chart for syntax errors
  • helm pull :- This download helm chart without installing on the system
  • helm install :- This install helm chart on the kubernetes cluster.
  • helm history :- This command shows releases history on the system with revision numbers and so.
  • helm upgrade :- This command upgrades installed helm charts to new version.
  • helm rollback :- This command rollback helm chart to last version
  • helm uninstall :- This command uninstall helm chart and remove all kubernetes object which was installed with chart.

At the end helm is really great tool to learn for kubernetes package management. Happy Helming !!! 😎

if you like this blog please share, comment that motivates me to writes another great technological blogs.

Happy Learning !!

--

--