Concepts

2 minutes read

Helm is a Package Manager for Kubernetes, it allows defining, installing, upgrading and deleting applications.
A Helm Chart is an application packaged with Helm, it has a script file/folder structure and uses a templating language.
The Helm Client is a binary used to manipulate application packaged with Helm.

Overview

The complete documentation can be found at https://helm.sh

The ArtifactHub is the place where many applications are distributed and ready to be deployed in a Kubernetes cluster.

ArtifactHub

An application installed from a Chart is called a release.

  • Installing a chart from a helm repository
# Adding a repository
helm repo add grafana https://grafana.github.io/helm-charts

# Installing a chart (= creating a release from this chart)
helm install my-grafana grafana/grafana --version 7.3.8
  • Installing a chart from an OCI registry
helm install my-redis oci://registry-1.docker.io/bitnamicharts/redis
  • Creating / upgrading a release
helm install my-release CHART_URL -f values.test.yaml
or
helm upgrade --install my-release CHART_URL -f values.test.yaml
  • Getting information about a given release
helm get all/hooks/manifest/notes/values my-release
  • Listing existing releases
helm list
  • Removing a release
helm delete my-release

The following command creates a sample Chart containing resources to deploy a NGinx server:

helm create my-app

The folder structure created is as follows:

$ tree my-app
my-app
β”œβ”€β”€ Chart.yaml
β”œβ”€β”€ charts
β”œβ”€β”€ templates
β”‚   β”œβ”€β”€ NOTES.txt
β”‚   β”œβ”€β”€ _helpers.tpl
β”‚   β”œβ”€β”€ deployment.yaml
β”‚   β”œβ”€β”€ ingress.yaml
β”‚   β”œβ”€β”€ service.yaml
β”‚   β”œβ”€β”€ serviceaccount.yaml
β”‚   └── tests
β”‚       └── test-connection.yaml
└── values.yaml
  • Chart.yaml contains the application metadata and the dependencies list
  • charts is a folder used to store the dependent charts
  • NOTES.txt provides the post install instructions to the user
  • _helpers.tpl contains functions and variables to simplify the templating
  • the YAML files in the templates’ folder contain specifications with templating code
  • values.yaml defines the configuration values for the application

In the exercises we created many resources and put them all in a single folder. We will now use Helm to package the VotingApp to ease the distribution and deployment of this application.

Raw YAML manifests to Helm