Skip to content
Turtle

Steady at the helm

Helm, CI, Kubernetes1 min read

"Learning is fun" is what tell myself each time I probe k8s. This time I decided to dig into Helm. Helm is a package manager for Kubernetes. That just means we can write our k8s services in code similar to Terrafrom.

Helm is like a template processor. It consists of yaml files with two types of files: Chart.yaml and values.yaml. The chart file contains keys and templated values such as these:

1tree: {{ .Value.treeType }}

Helm is used to keep infrastructure as code, allowing for quick deploys and rollbacks to the cluster.

Setup

Here's a quick run through of how to get started. Create a project first

1helm create <project name>

Add some values to the values.yaml file:

1favorite:
2 drink: grog

Add a ConfigMap template in templates/configmap.yaml:

1apiVersion: v1
2kind: ConfigMap
3metadata:
4 name: {{ .Release.Name }}-configmap-{{ .Release.Namespace }}
5data:
6 drink: {{ .Values.favorite.drink | quote }}

Note the .Release object. Helm has a few built-in objects. Note also the pipe to a built-in function quote which will quote the drink value.

Now get a dry-run output first to see the compute value:

1helm install <release name> . --debug --dry-run
2
3...
4COMPUTED VALUES:
5favorite:
6 drink: grog
7...
8MANIFEST:
9---
10# Source: ./templates/configmap.yaml
11apiVersion: v1
12kind: ConfigMap
13metadata:
14 name: <release name>-configmap-default
15data:
16 drink: "grog"

Congrats on getting up and running with helm.


Anyone can hold the helm when the seas are calm - Publius Syrus