Using Kubernetes does not excuse you from Configuration and Package Management
The Harness Squad is out in force here at KubeCon North America this year in sunny San Diego. Lots of announcements pouring in throughout the show (and a lot about tacos, my favorite). A stalwart in the Kubernetes ecosystem is Helm which was introduced at the very first KubeCon in 2015. For many of us, Helm was the first addition to Kubernetes you installed after your cluster was up and running. The big news is that Helm V3 has been released a week ahead of KubeCon North America introducing some fundamental changes. If you are unsure what Helm is, stick around and your friends at Harness are here to help. Let’s take a look at some Helm basics to get you dangerous.
A Brief History of Helm
The genesis and history of open source projects can be a mystery sometimes. The Helm Project does a really good job of explaining where they came from. Deis, a firm dedicated to helping the Kubernetes Ecosystem which was later acquired by Microsoft, created Helm. Deis as a fun fact is also one of the original sponsors of The Children’s Guide to Kubernetes.
The original goal of Helm was to be like one of my favorite tools on my Mac, Homebrew, for Kubernetes clusters aka the missing package manager. Though as the needs changed from a single administrator to need of multiple teams needing to administer and extend Kubernetes, Helm has evolved. Currently, Helm lives as an Incubating Project inside the Cloud Native Computing Foundation (CNCF). Helm certainly fills a need for package management inside of the Kubernetes ecosystem.
Helm in a Handbasket
When working with Kubernetes, you can certainly feel like a YAML Engineer with the amount of YAML files floating around. There are YAML files that describe environments, YAML files that describe deployments, YAML files that describe objects; and the list goes on.
Helm is designed to be a package manager. The main unit of work in Helm is a Helm Chart which is Helm’s packaging format. Effectively a Helm Chart is a series of YAML files organized in a structure/convention for Helm to execute on. Like our buddy Homebrew on your Mac [or in the Linux world RPM or APT), Helm helps to install, upgrade, and configure packages/applications inside of Kubernetes.
What would be a package manager without a repository to store those packages? Helm certainly has a concept of repositories. Curious what is available in the wild? Can browse the public Helm Hub for Charts and appropriate Repositories. Let’s go through an example to get us cooking with Helm.
Your First Helm-ing
Like always can pick your poison if you want to watch the video or follow along in the blog post.
To get started, can cheat and use Homebrew (since Helm was modeled originally after this right?). Since Helm is one of my essential tools and already on my machine, upgrading to Helm V3 is easy with brew upgrade helm. If you have not installed Helm before, can install Helm with brew install kubernetes-helm.
A quick area to play with Helm is Minikube. Using our Homebrew again, if you have not installed Minikube before can run brew cask install minikube. If you just want to update, can run brew cask upgrade minikube.
I like to give Minikube a little more memory on my MacBook Pro with minikube config set memory 8128. Once all that is done, just simply minikube start.
To validate Minikube is up and running, we can run minikube dashboard.
Back to Helm. Can add the Bitnami repo as an example.
helm repo add bitnami https://charts.bitnami.com/bitnami
Validate the Chart is there.
helm search repo bitnami/nginx
Install the Chart
helm install my-nginx bitnami/nginx
And you are cooking with gas now! Can validate the deployment on the Kubernetes Web Dashboard.
What would a package manager be if you can’t uninstall gracefully also?
helm delete my-nginx
Just like that, you have gone through a simple Helm example. Like any technology that is part of a fast-moving ecosystem, Helm has been evolving and different ways of solving the problem have been springing up.
Like any fast-evolving technology, change and competition has certainly come to Helm. In our next part of the series, we will take a more critical look at Helm and what the competition to Helm looks like. With the Harness Platform, you can leverage Helm in various ways such as part of your Continuous Delivery Workflow and even installing a Harness Delegate via Helm. Stay tuned for the next part of the series and updates from KubeCon.