No history yet

Introduction to Helm

Managing Kubernetes Complexity

Managing applications in Kubernetes can get complicated fast. A single application might require a Deployment, a Service, a ConfigMap, and a Secret, each defined in its own YAML file. As applications grow, so does the number of these files. Keeping track of them, versioning them, and deploying them consistently across different environments becomes a major challenge.

This is where Helm comes in. It's a tool that streamlines installing and managing Kubernetes applications.

Helm is the package manager for Kubernetes.

Think of Helm as being for Kubernetes what apt, yum, or Homebrew are for operating systems. Instead of manually installing an application and all its dependencies, you use a package manager to handle it in one step. Helm does the same for Kubernetes resources. It bundles everything an application needs into a single package called a Chart.

Chart

noun

A Helm package that contains all the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster.

When you install a chart, Helm creates an instance of it in your cluster. This running instance is called a release.

Release

noun

An instance of a chart running in a Kubernetes cluster. A single chart might be installed many times into the same cluster, and each time it is installed, a new release is created.

Using Helm, you can find, share, and use software built for Kubernetes. It simplifies deployments, upgrades, and rollbacks, making your applications much easier to manage.

Helm's Architecture

Helm's architecture has evolved. Early versions (Helm 2) used a client-server model. The Helm client (a command-line tool) communicated with a server-side component called Tiller, which ran inside your Kubernetes cluster. Tiller was responsible for managing releases.

This architecture had some security and operational challenges. Tiller required extensive permissions within the cluster, which could be a security risk. It also added an extra moving part to manage.

Helm 3, the current version, removed Tiller entirely. It now uses a simpler, client-only architecture. The Helm CLI interacts directly with the Kubernetes API server, just like kubectl. It uses your Kubernetes configuration file (kubeconfig) for authentication and authorization. This change makes Helm more secure and easier to use, as it relies on the security model already in place for your cluster.

The removal of Tiller in Helm 3 was a major improvement, simplifying the architecture and enhancing security by leveraging Kubernetes' own access controls.

Getting Started with Helm

Installing the Helm CLI is straightforward. The recommended way is to use the official installer script, which automatically finds the right version for your system.

# Download and run the installer script
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

You can also install Helm using package managers like Homebrew on macOS or Chocolatey on Windows. After installation, verify it's working by checking the version.

helm version

# Expected output (version numbers may vary):
# version.BuildInfo{Version:"v3.10.0", GitCommit:"...", GitTreeState:"clean", GoVersion:"go1.18.6"}

With Helm installed, you can start managing applications. First, you often need to add a chart repository. A repository is a location where charts are stored and shared. The artifacthub.io repository is a popular public one.

# Add the Bitnami repository, a popular source for charts
helm repo add bitnami https://charts.bitnami.com/bitnami

# Update your local list of charts
helm repo update

Now you can search for charts in the repositories you've added.

# Search for charts related to nginx
helm search repo nginx

To install a chart, you use the helm install command. You must give your release a name and specify the chart to install.

# Install the nginx chart from the bitnami repo
# with a release name of 'my-web-server'
helm install my-web-server bitnami/nginx

Once installed, you can see your active releases.

helm list

And when you're done with an application, you can uninstall the release, which removes all the Kubernetes resources that were created.

helm uninstall my-web-server

These basic commands are the foundation for managing complex applications in Kubernetes with ease.

Time to check your understanding of Helm's core concepts.

Quiz Questions 1/6

What is the primary problem that Helm is designed to solve in a Kubernetes environment?

Quiz Questions 2/6

In Helm terminology, what is a 'Chart'?

This covers the essentials of what Helm is, why it's useful, and how to perform basic operations. Next, we'll dive into the structure of a Helm chart itself.