helm-k8s.jpg
Cover image for ron

Ron Northcutt Verified userVerified user

Head of DevRel

Appsmith

An Introduction to Helm: the Kubernetes Package Manager

Kubernetes has emerged as the de facto standard for orchestrating containerized applications. However, as powerful and flexible as Kubernetes is, managing complex application deployments can quickly become daunting. 

This is where Helm, the package manager for Kubernetes, comes into play. Helm simplifies and automates many Kubernetes operations, making it easier for developers to deploy and manage applications. In this post, we'll dive deep into what Helm is, its key features, and why it's become an indispensable tool for managing Kubernetes applications.

Want to jump right in? See our tutorial for how to install Helm.

What is Helm?

“A helmsman or “helm” is a person who steers a ship, sailboat, submarine, other types of maritime vessel, or spacecraft.” 

Wikipedia

“The package manager for Kubernetes; Helm is the best way to find, share, and use software built for Kubernetes.” 

Helm.sh

Helm is often described as the "apt/yum/homebrew for Kubernetes," but what does that mean? At its core, Helm is a tool that streamlines the installation and management of Kubernetes applications. It introduces the concept of "charts," which are pre-configured Kubernetes resources that can be deployed as single units. This abstraction allows developers and operators to deploy complex applications without needing to manage dozens of individual Kubernetes components manually.

Helm helps organize and manage software packages in a cool way. It uses YAML templates, which are like the blueprints for the software. Then, it has another part called values that can change parts of these blueprints. By mixing these values into the templates, Helm lets you customize your software setup without messing up the main design. This whole setup with the templates and values is called a Helm Chart.

NOTE: Originally, Helm was developed with a client-server architecture, including a component called Tiller running inside the Kubernetes cluster. However, since the release of Helm 3, the architecture has been simplified to a single binary that runs on the user's machine, eliminating the need for Tiller and addressing security concerns related to its operation.

Key Features of Helm

This tool does a lot, but you can summarize the overall features in 3 categories:

1. Helm Charts

At the heart of Helm's power are Helm Charts. A Chart is a package that contains all necessary resources and configuration to deploy an application or service on Kubernetes. Each chart includes:

  • A Chart.yaml file that describes the chart.
  • Templates for Kubernetes resources (e.g., Deployments, Services, ConfigMaps).
  • Default configuration values stored in values.yaml.
  • Optional hooks and tests for lifecycle management.

Charts can be easily packaged, shared, and reused, making them an ideal way to distribute applications or services designed to run on Kubernetes. For example, here is the chart.yaml for Appsmith:

annotations:
  category: Application
apiVersion: v2
name: appsmith
type: application
description: Appsmith is an open source framework to build admin panels, CRUD apps and workflows. Build everything you need, 10x faster.
maintainers:
  - email: tech@appsmith.com
    name: Appsmith
sources:
  - https://github.com/appsmithorg/appsmith
home: https://www.appsmith.com/
icon: https://assets.appsmith.com/appsmith-icon.png
version: 2.0.7
dependencies:
- condition: redis.enabled
  name: redis
  version: 16.11.2
  appVersion: 6.2.7
  repository: https://charts.bitnami.com/bitnami
- condition: mongodb.enabled
  name: mongodb
  version: 12.1.16
  appVersion: 5.0.9
  repository: https://charts.bitnami.com/bitnami

There is another even longer values.yaml file that provides specific configuration details for the package. This separation of configuration from the primary organization is a powerful way to balance reusability with customization. Here is an example of the values.yaml for just MongoDB:

mongodb:
  enabled: true
  service:
    nameOverride: appsmith-mongodb
  auth:
    rootUser: root
    rootPassword: password
  replicaCount: 2
  architecture: "replicaset"
  replicaSetName: rs0
  nodeSelector: {}
  image:
    tag: 5.0.21-debian-11-r5
  arbiter:
    nodeSelector: {}
  hidden:
    nodeSelector: {}

The Appsmith repo has a great example of what a full Helm chart looks like - including the yaml files and templates. You can also see how we have included some documentation and resources to help you understand how to use and customize the project.

2. Chart Repositories

So, once you have a chart, how do you find and share it? Helm leverages chart repositories to share and discover charts. Repositories can be public, like the Artifact Hub (previously called Helm Hub), which hosts charts from numerous sources, or private, for companies to store internally developed charts. This approach enables a community-driven approach to sharing Kubernetes applications and services. 

It also provides the flexibility for managing reusable public and private collections of Kubernetes setup config. You can see the Appsmith project in Artifact Hub here, which contains information on installing the chart, prerequisites, and all available parameters for you to customize the installation.

artifact hub appsmith

In addition to the parameters, you can use a --set flag in your Helm commands to override the value of a setting in the values.yaml file. You can also use a --values flag to override the values in a chart and pass in a new YAML file. This flexibility is one of the reasons why separating the values from the chart is so important.

Want more info on overriding the values with flags? See our post on advanced Helm features.

3. Release Management

One of the most powerful features of Helm is how great it is at managing application releases. With Helm, you can upgrade, rollback, and manage deployed application versions without breaking a sweat. When you use Helm to install an app, it creates what's called a release. You can think of a release as a way to keep track of the apps you've set up in a Kubernetes (K8S) cluster. 

Helm tracks each deployment as a "release," allowing operators to manage deployments and updates systematically. This means you can have multiple versions of an app, like Redis, installed, and each version is kept track of separately in the cluster.

You can see what releases you have by using the command helm ls. Each release will have a "revision," which is just Helm's way of saying version number. If you update a release, like giving more memory to your Redis app, the revision number goes up. Helm lets you go back to an earlier version if you need to, making it super handy for managing your apps and keeping things running smoothly.

Why You Need Helm

Ok, so with all of this info, you can see how using Helm makes working with Kubernetes a whole lot easier. Let's review why it's such a game-changer.

  1. Simplification of Kubernetes Application Deployment

    When you're setting up apps with Kubernetes, you need to use files called manifests, which are written in either YAML or JSON. These files can get really detailed and tricky to handle, especially when you're dealing with big, complicated apps. That's where Helm steps in. Helm uses charts, which are like simplified instructions for deploying these complex apps. By using these charts, you can set up your apps with just a few easy commands, cutting through the complexity. Plus, Helm takes care of how these charts depend on each other, making the whole process even smoother.

  2. Configuration Management

    One of the cool things about Helm charts is how customizable they are. They use a file called values.yaml that lets you tweak your app settings to fit different situations, like whether you're testing something new (development), showing it to a limited audience (staging), or going live for everyone to see (production). The best part? You can use the same chart for all these scenarios and just change the settings in the values.yaml file as needed.

  3. Efficient Application Management

    Helm really shines when it comes to updating your apps or fixing something if it goes wrong (rolling back). It keeps track of each version of your app deployment as a "release." If you update an app and something doesn't work, you can easily go back to a previous version. This feature is super helpful because it keeps your apps running smoothly and reduces the chance of things breaking down when you try something new. It's kind of like git, but for your deployments.

  4. Community and Ecosystem

    The Helm community is full of people who are really into making and sharing these charts for all kinds of apps. This means you often don't have to start from scratch when you want to set up something new; there's a good chance someone has already made a chart for it. By using these shared charts and maybe even contributing your own, you become part of a big group of developers and operators who are all helping each other make better apps faster.

Helm takes a lot of the headaches out of using Kubernetes. It makes it easier to set up and manage your apps, lets you customize them for any situation, and connects you with a whole world of other people who are doing the same thing. It's a tool that can really speed up how you build and run your apps, making your life a lot easier in the process.

Helm is more than just a tool; it's a cornerstone of the Kubernetes ecosystem, simplifying the deployment and management of applications. Its genius lies in making a really complex problem very easy to manage, which is why it is pretty much an essential tool for working with Kubernetes at all.