Six tools to Simplify Kubernetes Journey — Day 4 — Helm Package Manager for Kubernetes

Helm is a package manager for Kubernetes. Similar to yum but for Kubernetes. It bundles all related manifests(such as deployment, service, etc.) into a chart. When installing chart, helm creates a release. The helm’s benefits it provide templating, repeatability, reliability, multiple environments, and ease of collaboration.

Installing Helm

Helm now has an installer script that will automatically grab the latest version of Helm and install it locally.


$ curl -fsSL -o
$ chmod 700
$ ./
  • Verify helm version
helm version
  • To check the current state of helm locally
helm env

How Helm Works

The way helm works are instead of using individual Kubernetes command for each Kubernetes object, it embeds the Kubernetes object definition in a package called a chart. This chart is then passed to the helm, and the helm connects to the Kubernetes API to create the Kubernetes objects. The way helm connects to the Kubernetes cluster/host via the config file


Under the hood, the helm library uses the Kubernetes client to communicate with the Kubernetes API.

Helm chart is the definition of your application, and the release is an instance of that chart. Helm stores these release manifests inside your Kubernetes cluster in the form of secrets.

Advantage of using helm

  • Traditional deployments in Kubernetes is done with Kubectl across files into separately managed items. Helm deploys units called charts as managed releases.
  • We can search for charts . Charts can be pulled(downloaded) and optionally unpacked(untar).

Chart Repo

  • The location where Helm charts can be stored and shared
  • Respond to REST API GET requests to get packages
  • Many storage options available — cloud buckets, local storage, GH Pages, etc. or we can use Chartmuseum(open-source helm chart repository).
  • To show all the repos
helm repo lis
  • To add a repo
helm repo add <repo> url
helm repo add stable
"stable" has been added to your repositories
  • Search a repo
$ helm search repo mysql
stable/mysql 1.6.7 5.7.30 Fast, reliable, scalable, and easy to use open-...
stable/mysqldump 2.6.2 2.4.1 DEPRECATED! - A Helm chart to help backup MySQL...
stable/prometheus-mysql-exporter 0.7.1 v0.11.0 DEPRECATED A Helm chart for prometheus mysql ex...
stable/percona 1.2.1 5.7.26 free, fully compatible, enhanced, open source d...
stable/percona-xtradb-cluster 1.0.6 5.7.19 free, fully compatible, enhanced, open source d...
stable/phpmyadmin 4.3.5 5.0.1 DEPRECATED phpMyAdmin is an mysql administratio...
stable/gcloud-sqlproxy 0.6.1 1.11 DEPRECATED Google Cloud SQL Proxy
stable/mariadb 7.3.14 10.3.22 DEPRECATED Fast, reliable, scalable, and easy t...
  • Search in hub
$ helm search hub |head
URL CHART VERSION APP VERSION DESCRIPTION 0.1.0 fedora-32 389 Directory Server 0.1.0 latest Network Manager Living at Edge 0.1.2 0.1.6 A Helm chart for restorecommerce access-control... 0.4.1 0.4.1 Kubernetes-Operator to simplify RBAC configurat... 0.1.0 1.0 A Helm chart of A10 acos prometheus exporter fo... 2.2.0 v0.102.0 DNS proxy as ad-blocker for local network 0.1.0 4.7.3 A Helm chart for Adminer 0.1.6 4.7.7 Adminer is a full-featured database management ... 1.1.11 1.2.13 Official Helm chart for Alert Engine

Creating your first chart

The easiest way to get started with chart is by using helm create command. The below command creates a new chart named myhelmchart.

helm create myhelmchart
  • If you drill down inside the myhelmchart directory, you will see the structure like this. Let take a look at each of these files/directory one by one
tree myhelmchar


Templates are one of the most important directories, and this is where helm looks for your Kubernetes object yaml definitions(Deployment, Services,etc.).


If templates hold the resource definition, then values provide the way to parameterize it.


Helm allows the use of Go templating in the resources files for Kubernetes. The _helpers.tpl is used to define Go template helpers.


This is the plain text file that gets printed out when the chart is successfully deployed. Usually, this contains the next step for using the chart.


This file contains the metadata such as chart version, application version, or constraints like a minimum version of Kubernetes/Helm, which is required to manage this chart. Some required fields in chart.yaml.

Now you understand all the chart structure and all the corresponding files, it’s time to create your first chart. I will start with a simple Nginx application, and later on, we will parameterize it using values.yaml.

Step1: Cleanup all the files inside the templates directory so that we will start from scratch.

rm -rf myhelmchart/templates/

Step2: Create deployment file

kubectl create deployment nginx --image=nginx --dry-run=client -o yaml >>myhelmchart/templates/nginx.yaml

Step3: Expose your deployment

kubectl expose deploy nginx --port 80 --type NodePort --dry-run=client -o yaml >> myhelmchart/templates/service.yam

Now the catch is that if you try to expose the deployment without creating it, you will encounter this error, fix it, and create deployment temporarily(as we want to deploy it using helm)

kubectl create deployment nginx --image=ngin

Try to expose your deployment again

kubectl expose deploy nginx --port 80 --type NodePort --dry-run=client -o yaml >> myhelmchart/templates/service.yaml

As this my first chart, I want to keep it bare bone and define only the required values inside chart.yaml.

cat Chart.yaml               
apiVersion: v2
name: myhelmchart
description: A Helm chart for Kubernetes
version: 0.1.0
  • One more additional file I need to create is NOTES.txt inside the templates directory.
echo "This is first helm chart and it will deploy nginx application" >>templates/NOTES.txt
  • I also cleanup rest of the files and directory to draw the clean slate
rm -rf values.yaml charts
  • Don’t forget to cleanup the deployment
kubectl delete deployment ngin

Deploying your first chart

With all the config in place, it’s time to deploy the first helm chart. We can also set the release name so that we can refer it back at the later stages.

  • It is always a good idea to run linter before deploying your chart to ensure there is no syntax error or follow all the best practices.
helm lint ./myhelmchar
  • Let’s now start with a dry-run to make sure everything looks good
helm install demochart ./myhelmchart --dry-ru
  • If things good deploy your helm chart without dry-run option
helm install demochart ./myhelmchar
  • To verify it
helm lis
  • We have created and deployed our first helm chart; it’s time to parameterize these values using values.yaml. Let target the deployment.yaml and parameterize the image
apiVersion: apps/v1
  • But before that how to uninstall your application using helm
helm uninstall demochar
  • Verify it
helm list
  • Create values.yaml, and add key as imagename and its value as nginx
cat values.yam
  • Now to refer this value, you can specify it via Values and key so it should be like (.Values.imagename)
cat  myhelmchart/templates/nginx.yam
  • We can also bump up the version of helm chart
cat myhelmchart/Chart.yaml   
apiVersion: v2
name: myhelmchart
description: A Helm chart for Kubernetes
version: 0.2.0
  • Deploy it again
helm install demochart ./myhelmchart

Packaging Chart

You have your chart ready at this stage, but if you want to share these charts with your team or the rest of the community. To do that, use the helm package command.

helm package ./myhelmchart      
Successfully packaged chart and saved it to: /home/prashant/Documents/helm/myhelmchart-0.2.0.tgz
  • If your teammate need to install this chart, he can do it via helm install
helm install mychart myhelmchart-0.2.0.tgz

Wrapping Up

Helm is a powerful tool, and it greatly simplifies how you package your Kubernetes manifests. I barely scratched the surface in this blog, but if there is any helm feature you liked and want to share with the rest of the community, please mention that in the comment section.

AWS Community Builder, Ex-Redhat, Author, Blogger, YouTuber, RHCA, RHCDS, RHCE, Docker Certified,4XAWS, CCNA, MCP, Certified Jenkins, Terraform Certified, 1XGCP