What is Helm?

Large systems that run on Kubernetes are often comprised of many resources and must operate in multiple environments with varying configurations. Operating these systems and managing their declarative Kubernetes resource definitions is challenging for developers. Helm is a tool designed to handle this complexity, making it easier to describe, manage, and install complex applications that run on Kubernetes.

Helm serves as a package manager for the Kubernetes ecosystem. Using Helm, software developers can create, version, share, and publish a single package that contains the Kubernetes resources necessary to run their applications. Helm also provides the ability to parameterize configuration values for the Kubernetes resources within a package, allowing a single set of resource definitions to be used across multiple environments. When packaged with Helm, systems and software are easily installed across multiple Kubernetes clusters by anyone who would like to use them.

Why Helm?

Throughout the course, we've worked with a sample Python application that runs within a Docker container on Kubernetes. When we ran the application on the cluster, we had to individually apply the Kubernetes Deployment and Service resources on the cluster.

For the small application, applying these two resources to a single environment is not extremely difficult, but imagine if the sample application contained dozens of resources that needed to be deployed on several clusters with distinct configurations. Managing the declarative configuration of each resource for each environment would make applying them to their respective cluster overwhelming.

Helm makes this scenario manageable by allowing the developers who create the software and those who install it to work with the resources in a single overarching package with configuration that can be parameterized. Let's walk through a simple demonstration illustrating the benefits of using Helm.

Helm concepts

Developers must understand three important concepts when managing their systems with Helm.

  • Chart

  • Release

  • Repository

Chart

A chart is a structured set of files within a convention-based directory structure, which can be used to generate Kubernetes manifests. Within this directory structure, there are three critical elements placed within the chart:

  • A chart.yaml file that contains information about the chart, such as its name and version.

  • A templates directory that contains Kubernetes resource definitions (manifests). Helm allows these manifests to include fields so that the same template for a Kubernetes resource definition can be used with multiple configurations. When generating a manifest from a template, Helm can access values to replace the fields from multiple sources, such as the values.yaml file, values files passed to helm install, or values passed as parameters to the helm install command.

  • A values.yaml file that contains the default values that will be substituted for the fields found within the Kubernetes resource definitions found in the templates directory. The values specified in this file can be overridden by other sources, as mentioned above.

Release

A release is an instance of a Helm chart that has been deployed on a Kubernetes cluster. Each release is provided with a name that identifies it on the cluster. The same chart can be deployed and run multiple times on a cluster, with each installation of the chart representing a release.

Repository

A repository is wherepackaged Helm charts are stored and retrieved. Charts can be packaged into chart archive files that contain the chart within a .tgz file. The chart archives are then accessible through the repository for others to pull and deploy on their clusters with Helm. It isn't necessary to package a Helm chart to install it with Helm on a Kubernetes cluster. However, when publishing a chart publicly for others to consume, it's best to package the chart.

Deploying a Helm chart

Within the interactive widget below, a Helm chart for the sample Python application can be found in the /infrastructure/python-sample directory. Let's walk through how to install the chart to create a release on a Kubernetes cluster.

Install Helm

Before installing the chart, Helm must be installed on the client interacting with the Kubernetes API. To install Helm on the client, launch the interactive widget and enter the following command into its terminal:

Get hands-on with 1200+ tech skills courses.