Helm is a powerful tool that streamlines the deployment and sharing of applications across Kubernetes clusters, ensuring consistent and easy configuration. By creating Helm Charts, you can manage your deployments efficiently and quickly, encapsulating all dependencies within Helm Templates. While Kubernetes maintains the cluster’s desired state, Helm allows you to define and reconfigure that state at runtime using key-value pairs.
In brief, Helm serves as the package manager for Kubernetes, akin to how yum
or apt
function as package managers for Linux.
Before diving into Helm, it’s essential to understand the following concepts:
Chart: A Helm Chart contains all the resource definitions necessary to run an application on Kubernetes.
Tiller: (Note: As of Helm v3, Tiller has been removed.) Previously, Tiller was the Helm server component that interacted with the Kubernetes API to manage resources.
Release: A specific deployment of a Helm Chart, encompassing all the Kubernetes resources created.
Repository: A storage location where Helm Charts are maintained and shared.
Helm: The name of the project and the command-line interface (CLI) tool used to interact with Helm.
Here are some fundamental Helm commands to get you started:
Add a Repository:
helm repo add stable https://charts.helm.sh/stable
List Repositories:
helm repo list
Install a Chart:
helm install my-release stable/nginx-ingress
List Installed Charts:
helm ls
View Release History:
helm history my-release
Upgrade a Release:
helm upgrade my-release stable/nginx-ingress
Rollback a Release:
helm rollback my-release 1
Remove a Repository:
helm repo remove stable
Delete a Release:
helm delete my-release
You can create custom Helm Charts using the helm create
command:
helm create my-chart
This command generates a directory structure with the following components:
Chart.yaml: Contains metadata about the chart.
values.yaml: Holds default configuration values.
templates/: A directory containing Kubernetes manifest templates that reference values from values.yaml
.
For a comprehensive collection of pre-built Helm Charts, visit the official Helm repository on GitHub: https://github.com/helm/charts. This repository categorizes charts into two main directories:
Stable: Tested and ready-to-use charts.
Incubator: Charts under active development.
By leveraging Helm, you can simplify the management of Kubernetes applications, ensuring consistent and repeatable deployments across your environments.