Skip to content

Using Helm

Helm is one of the most popular package managers for Kubernetes. It uses a packaging format called chart which is used to version and deploy applications.

The example below demonstrates how to use Helm to deploy a TriggerMesh Bridge and manage its lifecycle.

Chart Initialization

Initialize a new Helm chart using the helm command-line tool:

$ helm create bridge-chart
Creating bridge-chart

A file structure similar to the one below is automatically generated with multiple sample files:

bridge-chart
├── Chart.yaml
├── charts
├── templates
│   ├── NOTES.txt
│   ├── _helpers.tpl
│   ├── deployment.yaml
│   ├── hpa.yaml
│   ├── ingress.yaml
│   ├── service.yaml
│   ├── serviceaccount.yaml
│   └── tests
│       └── test-connection.yaml
└── values.yaml

This file structure is explained in details in the Helm documentation at Charts > The Chart File Structure. In this example, we simply replace all samples contained in the templates directory with the Bridge List-manifest generated by til:

$ rm -rf bridge-chart/templates/*
$ til generate my-bridge.brg.hcl > bridge-chart/templates/my-bridge-manifest.json

Deployment

The chart can be deployed to the destination cluster using the command:

$ helm install my-bridge bridge-chart/
NAME: my-bridge
LAST DEPLOYED: Tue Apr 20 12:59:09 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None

The chart should appear as "deployed" in the list of Helm releases:

$ helm list
NAME        NAMESPACE   REVISION   UPDATED               STATUS     CHART                APP VERSION
my-bridge   default     1          2021-04-20 12:59:09   deployed   bridge-chart-0.1.0   1.16.0

Updates

Any future modification to the Bridge description can be applied to the deployed release using the following command:

$ helm upgrade my-bridge bridge-chart/
Release "my-bridge" has been upgraded. Happy Helming!
NAME: my-bridge
LAST DEPLOYED: Tue Apr 20 13:18:47 2021
NAMESPACE: default
STATUS: deployed
REVISION: 2
TEST SUITE: None

Under the hood, helm upgrade takes care of all lifecycle actions such as:

  • Updating existing objects so they match the desired state described in the Bridge description.
  • Creating objects that were added since the last Bridge release.
  • Deleting objects that should no longer be part of the Bridge release.

Termination

To undo the deployment of an entire Bridge, simply uninstall its Helm release:

$ helm uninstall my-bridge
release "my-bridge" uninstalled