Kubernetes & Helm(Part-1)

Shiwani Biradar
4 min readMar 4, 2020

In this article we will brief the need of kubernetes helm with the helm architecture and installation.

Need of kubernetes Helm

Kubernetes can become very complex with all the objects you need to handle such as ConfigMaps, services, pods, Persistent Volumes in addition to the number of releases you need to manage, but kubernetes helm offers a simple way to package everything into one simple application and advertises what you can configure. it can also managed number of releases of application very easily.

Helm

Helm is the package manager for the Kubernetes. It is first application package manager running atop Kubernetes. It allows describing the application structure through convenient helm-charts and managing it with simple commands.Helm enables a Kubernetes operator to have greater control of his/her Kubernetes cluster. If you are familiar with apt/yum/brew and their role in different Operating Systems then you should already know the importance of a package manager.

Helm is made of two components: A server called Tiller, which runs inside your Kubernetes cluster and a client called helm that runs on your local machine.Helm is a CLI tool that interacts with its backend server called “Tiller”. Helm is command line interface that interect with its backend server called tiller.

helm charts

Helm uses Charts to pack all the required K8S components for an application to deploy, run and scale. It is also where dependencies are defined, and configurations are updated and maintained.

A package is called a chart to keep with the maritime theme.With the Helm client, you can browse package repositories (containing published Charts) and deploy those Charts on your Kubernetes cluster. Helm will pull the Chart and talking to Tiller will create a release (an instance of a Chart).

Kubernetes Helm Architecture

Helm consists of two main components:

  • Helm Client — allows developers to create new charts, manage chart repositories, and interact with the tiller server
  • Tiller Server — runs inside the Kubernetes cluster. Interacts with Helm client, and translates chart definitions and configuration to Kubernetes API commands. Tiller combines a chart and its configuration to build a release. Tiller is also responsible for upgrading charts, or uninstalling and deleting them from the Kubernetes cluster.
Architecture of kubernetes helm

After Helm is installed, the helm init command installs the Tiller server to your running Kubernetes cluster. It is then possible to search for charts and install them to the cluster.

Installation of helm

  • First we’ll install the helm command-line utility on our local machine. Helm provides a script that handles the installation process on MacOS, Windows, or Linux. Change to a writable directory and download the script from Helm’s GitHub repository:

$cd /tmp

$curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > install-helm.sh

  • Make the script executable with chmod:

$ chmod u+x install-helm.sh

  • At this point you can use your favorite text editor to open the script and inspect it to make sure it’s safe. When you are satisfied, run it:

$ ./install-helm.sh

  • Next we will finish the installation by installing some Helm components on our cluster

Now next step is installing tiller

Tiller is a companion to the helm command that runs on your cluster, receiving commands from helm and communicating directly with the Kubernetes API to do the actual work of creating and deleting resources. To give Tiller the permissions it needs to run on the cluster, we are going to make a Kubernetes serviceaccount resource.

  • Create the tiller serviceaccount:

$ kubectl -n kube-system create serviceaccount tiller

  • Next, bind the tiller serviceaccount to the cluster-admin role:

$ kubectl create clusterrolebinding tiller — clusterrole cluster-admin — serviceaccount=kube-system:tiller

  • Now we can run helm init, which installs Tiller on our cluster, along with some local housekeeping tasks such as downloading the stable repo details:

$ helm init — service-account tiller

  • To verify that Tiller is running, list the pods in thekube-system namespace:

$ kubectl get pods — namespace kube-system

Now next step is installing helm charts

Helm software packages are called charts. Helm comes preconfigured with a curated chart repository called stable.We are going to install the Kubernetes Dashboard as an example.

  • Use helm to install the kubernetes-dashboard package from the stable repo:

$ helm install stable/kubernetes-dashboard — name dashboard-demo

  • We can ask Helm for a list of releases on this cluster:

$ helm list

  • We can now use kubectl to verify that a new service has been deployed on the cluster:

$ kubectl get services

  • now you can access kubernetes dashboard .

In next article we will see another example of kubernetes helm.

--

--