Skip to content

Instantly share code, notes, and snippets.

@mattsdni
Created December 2, 2017 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattsdni/2f89566960288aa5d18e4803912b9c1e to your computer and use it in GitHub Desktop.
Save mattsdni/2f89566960288aa5d18e4803912b9c1e to your computer and use it in GitHub Desktop.

Helm

Helm allows us to bundle together many Kubernetes resources into Charts

Main Concepts

Charts

A Chart is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew formula, an Apt dpkg, or a Yum RPM file.

Repositories

A Repository is the place where charts can be collected and shared. It’s like Perl’s CPAN archive or the Fedora Package Database, but for Kubernetes packages.

Releases

A Release is an instance of a chart running in a Kubernetes cluster. One chart can often be installed many times into the same cluster. And each time it is installed, a new release is created. Consider a MySQL chart. If you want two databases running in your cluster, you can install that chart twice. Each one will have its own release, which will in turn have its own release name.

With these concepts in mind, we can now explain Helm like this:

Helm installs charts into Kubernetes, creating a new release for each installation. And to find new charts, you can search Helm chart repositories.

Example

First we install Helm with brew

mdennie@mdennie-mbp15:~$ brew install kubernetes-helm

Then we initialize helm on our cluster

mdennie@mdennie-mbp15:~$ helm init
$HELM_HOME has been configured at /Users/mdennie/.helm.

Tiller (the helm server side component) has been installed into your Kubernetes Cluster.
Happy Helming!

We can see that the tiller pod is running in kube-system

mdennie@mdennie-mbp15:~$ kubectl get pod -n kube-system
NAME                            READY     STATUS              RESTARTS   AGE
kube-addon-manager-minikube     1/1       Running             0          10m
kube-dns-6fc954457d-jwsxf       3/3       Running             0          10m
kubernetes-dashboard-vrq2z      1/1       Running             0          10m
tiller-deploy-58658fdd9-764mc   1/1       Running             0          8m

Now we can install a Helm chart. Charts are groups of Kubernetes resources that get deployed together.

mdennie@mdennie-mbp15:~$ helm install stable/mysql
NAME:   bilging-spaniel
LAST DEPLOYED: Fri Dec  1 15:50:30 2017
NAMESPACE: default
STATUS: DEPLOYED

We can list the charts on the cluster like this

mdennie@mdennie-mbp15:~$ helm ls
NAME           	REVISION	UPDATED                 	STATUS  	CHART      	NAMESPACE
bilging-spaniel	1       	Fri Dec  1 15:50:30 2017	DEPLOYED	mysql-0.3.0	default

To delete a release we use the helm delete command

mdennie@mdennie-mbp15:~$ helm delete bilging-spaniel
release "bilging-spaniel" deleted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment