Steady at the helm
"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 Terraform.
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:
tree: {{ .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
helm create <project name>
Add some values to the values.yaml file:
favorite:
drink: grog
Add a ConfigMap template in templates/configmap.yaml:
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-configmap-{{ .Release.Namespace }}
data:
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:
helm install <release name> . --debug --dry-run
...
COMPUTED VALUES:
favorite:
drink: grog
...
MANIFEST:
---
# Source: ./templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <release name>-configmap-default
data:
drink: "grog"
Congrats on getting up and running with helm.
Anyone can hold the helm when the seas are calm - Publius Syrus