Helm: The Package Manager for Kubernetes

205 VIEWS

· ·

As more organizations start to prepackage their applications to be easily deployed on Kubernetes clusters, Helm is positioned to be the tool of choice. As apt/yum/dnf is to Linux, Helm is to Kubernetes.

Introduction

Helm is the official project of the Cloud Native Computing Foundation (CNCF), and provides a method of packaging the configuration around Kubernetes resources, including managing dependencies as applications. These configuration packages are called charts.

Helm actually has a nice description of its project goal on its main site: “Helm charts helps you define, install, and upgrade even the most complex Kubernetes application.”

To use Helm to deploy charts into a Kubernetes cluster, you need to deploy the server-side part of the project, called Tiller, into your cluster. Then you manage charts via the client side tool, which is called Helm (just like the main project).

Installation can be as simple as running one command. It does get more complicated if you have multiple security contexts and want the Tiller side to have a proper authentication setup.

Contents of a Chart

Instead of walking through all the steps to create a new chart, which is covered in Helm’s chart documentation, I thought it would be better to just walk through what is included in an existing package to show what is and isn’t in a chart.

The first thing to note is that a chart does not include any actual binaries—It is the metadata needed to install and configure one or more Kubernetes resources to work.

The directory structure is fairly straightforward. The top-level directory is the name of the package, and there are only two required files. Those files are Chart.yaml, which includes all the information about the chart, and values.yaml which is the default configuration values like memory size, or tags to have on the pod.

Sample entries in Charts.yaml

While the values.yaml file is required, there are no default configuration values that are required. It really depends on the application that is being referenced.

To actually have something deployed by the chart when it is installed by Helm, there will need to be files in the templates directory which combine to form the configuration information for the actual pod that Kubernetes is running, including what containers to load, as shown in the example.

Example file structure that is the MongoDB chart maintained by Bitnami

As you can see, there are additional files I did not describe that can be included to provide an even more robust application. All the files listed above (plus a couple more) are covered in the developing charts documentation on Helm’s site.

Installing a Chart

There is an hub on KubeApps which is the default location for people and companies to link to existing Kubernetes applications that are packaged for use by Helm.

The first step is to ensure you have the latest list of applications in the hub.

The next step is to install something. Pulling from stable is always a safe place to start.

At this point, if you want to get a basic list of features in the stable/mysql package, you can inspect it.

Every time you install an app, it creates an independent release, so multiple copies of the same application can be deployed and running. To review how to list releases and many of the other options available to work with applications (charts), check out the Using Helm section of the documentation site.

Conclusion

Prepackaged applications in the Kubernetes space are a key feature that will aide in Kubernetes adoption in more conservative and risk-averse organizations. Package management was a key ingredient in the success of Linux, and a central hub of preconfigured applications was key to containers taking off in popularity as Docker brought them into the mainstream.

Do you think you can beat this Sweet post?

If so, you may have what it takes to become a Sweetcode contributor... Learn More.

Vince Power is an Enterprise Architect at Medavie Blue Cross. His focus is on cloud adoption and technology planning in key areas like core computing (IaaS), identity and access management, application platforms (PaaS), and continuous delivery.


Discussion

Click on a tab to select how you'd like to leave your comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Menu