Dwarves
Memo
Type ESC to close search bar

Kubernetes Helm 101

In recent years, Kubernetes has exploded tremendously. At the same time, it creates new communities including ecosystems that make it easier to develop and deploy complex applications. If Kubernetes means the shipman of the ship, then Helm is the steering wheel of that shipman in the career of every DevOps and Developer.

Helm is a Package Manager for Kubernetes, analogous to NPM or YARN. However, it’s not just the Package Manager, it is also a Deployment Management for Kubernetes. In simpler terms, instead of having to define various Kubernetes resources to deploy an application, with Helm you just type a few commands in the terminal and enter, done.

In this article, we will learn about Helm, a powerful tool that makes life working with Kubernetes easier than ever. Although these terms are quite common with developers today, we will skim a jiffy for those who don’t know:

Helm Overview

Concepts

Helm has 4 basic concepts:

Architecture

Helm has a fairly simple client-server architecture, including a CLI client and an in-cluster server running in the Kubernetes cluster:

Here are some basic concepts and architectures to help you understand and grasp Helm more quickly. In the next section, we’ll take some tutorials to deep dive into Helm. Let’s do it!

Helm in Action

Before we begin, we’ll need to prepare a few things for us to be able to practice with Helm.

Installing Helm

There are multiple ways to install Helm that are obviously described on the Helm documentation. Helm has two parts: The Helm client (helm) and the Helm server (Tiller). The quickest way to install helm on macOS is using Homebrew, a package manager for macOS platforms.

It’s a simple command to install Helm client locally via Homebrew

brew install kubernetes-helm

Next step is to initialize helm, please ensure that the Kubernetes cluster is running and accessible through kubectl. When you initialize helm, a deployment named tiller-deploy will be deployed in the kube-system namespace.

Initialize helm using the following command.

helm init

Check the tiller deployment in the kube-systems namespace using ***kubectl ***command

kubectl get deployment tiller-deploy -n kube-system

Deploy an Application using Helm

Now we’re going to deploy a Kafka cluster using helm.

It’s many charts of Kafka when we search on the Helm Hub. Unfortunately, Kafka doesn’t have a Stable chart, so you can choose which one fits with your use case. For this tutorial, we’ll install the Kafka chart of Bitnami into queue-production namespace.

As a simple way, we can install Kafka with helm by the following command

# Add Incubator repository
helm repo add bitnami https://charts.bitnami.com/bitnami

# Update helm repository
helm repo update

# Install Kafka
helm install bitnami/kafka --name kafka --namespace queue

Now, it already installed on your Kubernetes cluster, but it may not work properly for your needs. For me, I usually looking for a values.yaml file, and store it locally to save a specific configuration for instance of the application.

Execute the following helm install command to deploy a Kafka with your Config in values-prod.yaml. It will download the Kafka helm chart from the Bitnami repo and apply your configuration via values.yaml file.

helm install bitnami/kafka \
  --name kafka-prod \
  --namespace queue-production \
  -f bitnami/values-prod.yaml

Check the install helm chart using this command

helm ls

Delete the installation from Kubernetes cluster, use this command

helm delete --purge kafka-prod

Conclusion

We’ve witnessed the ecosystem around Kubernetes blossom, and new tools are appearing every day. Helm is an essential tool for DevOps and Developer using Kubernetes in their production environment. Tools like Helm are often used when considering quick deployment strategies and cost savings in operations.

You can refer to more information in the documentation of Helm. In the next article, I will show you how to create a Helm Chart of NATS-streaming. Hopefully, this article will help you who are intending to learn about Helm as well as the necessary tools of the DevOps. Thank you, please give me your commend if there are deficiencies and I will do better in the next articles.

Read more