Helm is the package manager for Kubernetes that allows deploying and managing Kubernetes applications. Helm charts are packages that can be deployed to Kubernetes clusters using Helm. Helm charts contain templates for Kubernetes manifest files and default configuration values that can be customized. The Helm client communicates with the Tiller server, which installs and manages releases of charts on the Kubernetes cluster.
3. HELM & HELM CHARTS
Helm is the package manager for Kubernetes
(like yum and apt )
Helm charts are packages (like debs and rpms)
4. WHY HELM?
Managing repeating Kubernetes manifest or
copying form one to another, editing
hardcode values and validating syntex,
sharing across env like Dev, QA, Prod etc. is
hard
5. chart + configuration
Helm Library
Helm Client
k8s API Server
Helm Charts
k8s Cluster
Search, create and host
Helm Charts or pakages
HELM v3 Architecture
release object
Release info stored as secret in the
namespace with the app by default
7. Get Started with Helm v3
Install Helm 3
Linux - Run the client installer script that Helm provides:
$ curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh
$ chmod 700 get_helm.sh
$ ./get_helm.sh
macOS - Use Home brew to install:
$ brew install helm
Windows - Use Chocolatey to install:
$ choco install kubernetes-helm
$ helm version
version.BuildInfo{Version:"v3.1.1", GitCommit:"afe70585407b420d0097d07b21c47dc511525ac8",
GitTreeState:"clean", GoVersion:"go1.13.8"}
8. Get Started with Helm v3
$ helm create mychart
# Information about your chart, metadata, version and dependency
# Charts that this chart depends on
# The default values for your templates
9.
10.
11.
12.
13.
14.
15. Templates
Files under templates dir templets/ are treated
as dynamic YAML files using the go template lang
YAML templates prevents config duplication and
allows you to install same charts in dev, staging or
production environment.
17. $helm search hub : search for charts in helm hub
$helm search repo
$helm pull: download a chart to your local directory to view
$helm install: upload the chart to Kubernetes
$helm list: list releases of charts
$helm env - Helm client environment information
$helm get - download extended information of a named release
$helm history - fetch release history
$helm lint - examines a chart for possible issues
$helm package - package a chart directory into a chart archive
$helm repo - add, list, remove, update, and index chart repositories
$helm rollback - roll back a release to a previous revision
$helm show - show information of a chart
$helm status - displays the status of the named release
$helm template - locally render templates
19. Prerequisites
Docker
You have a Kubernetes Cluster
You have kubectl installed and configured to work with your Kubernetes cluster
I have k3d on my local - which deploys k3s clusters in containers, you can install
This Demo makes the following assumptions:
1.
2.
3.
4.
$ curl -s https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash
$ k3d create --workers 2 --name k3s
.
20. Installing a Chart
1. From a Chart Directory
$ helm install myapp ./mychart
2. From a remote chart repo
$ helm install myapp myrepo/mychart
21. Using custom values
1. Using a values file
$ helm install myapp ./mychart -f my-values.yaml
2. Using a key value pair
$ helm install myapp ./mychart --set image.tag=master
3. Advanced use
$ helm install myapp ./mychart
-f qa.yaml
-f staging.yaml