Kubernetes

Helm (Kubernetes)

Helm is a:

Package manager for Kubernetes (the YAML configuration files).

  • A bundle of YAML files is called a “Helm chart”
  • Think of this as a dockerfile manager
  • There are Public and Private repositories
  • You can use helm search to find charts in your repository, or public ones
  • helm install will install a chart on your cluster.

Templating Engine

  • Define a common blueprint for (say) microservices, and use that blueprint with some placeholders for some values (say for, image and name).
  • values.yaml file can be used to populate the templates with data for the placeholders.
  • command line --set can also be used to set values in placeholders.
  • useful for deploying same containers in different environments (eg. Dev/Staging/Prod)

Helm Chart Directory Structure:

└── myChart
    ├── Chart.yaml
    ├── values.yaml
    ├── charts
    ├── templates

Where myChart is the name of the chart

Chart.yaml holds the meta info about the chart

values.yaml values for template. (These are the defaults, and can be overridden later)

charts directory, holds chart dependencies.

and templates directory, holds the templates for this chart

helm install myChart to install this chart

Optional files include README.md and LICENSE

helm install --values=myvalues.yaml chartname

to override the default values with the ones specified in the myvalues.yaml file.

example values.yaml

imageName: myApp
port: 8080
version: 1.0.0

example myvalues.yaml

version: 2.0.0

result will be

imageName: myApp
port: 8080
version: 2.0.0

commandline example:

helm install --set version=2.0.0 <chartname>

Release Manager

Depending on helm version.

Helm 2.0 had a client server setup, where a server (named tiller) was installed on the kubernetes cluster and helm clients sent it charts that it then used to CRUD deployments (etc) with. Unfortunately this was seen as a security risk (a single service on the cluster that had the power to CRUD everything was a rpime target for malicious users, or even problematic if people made mistakes).

Instead, in helm 3.0 there is no tiller service.

Helm can help rolling back to states because it keeps a record of previous states of the cluster.

Published:
comments powered by Disqus