Overview
Helm is a package manager for Kubernetes.
An Helm Chart provides a set of parametrable Kubernetes Resource (using a Go templating engine) and allows versionning, rollbacks, a reusability.
Installation
To enable this tool, add this to your vars.yml
:
---
tools:
- helm
Examples
Helm can be called within a Bash manifest, in a bundle to deploy a Chart or generating a template manifest.
FluxCD Helm Operator
This pipeline will install the FluxCD Helm Operator:
vars.yml:
---
tools:
- helm
packages:
- name: helm-operator
kind: bundle
bundles/helm-operator/10-namespace.yml:
---
apiVersion: v1
kind: Namespace
metadata:
name: fluxcd
bundles/helm-operator/20-helm-dependencies.sh:
#!/bin/bash
set -eux
helm repo add fluxcd https://charts.fluxcd.io
helm repo update
kubectl apply -f https://raw.githubusercontent.com/fluxcd/helm-operator/1.2.0/deploy/crds.yaml
helm upgrade -i helm-operator fluxcd/helm-operator --wait \
--namespace fluxcd \
--set helm.versions=v3 \
--set git.timeout=300s
Application generation
This pipeline will generate a manifest for the Nginx Ingress Controller to be
deployed with kapp using helm
as a template
engine:
vars.yml:
---
tools:
- helm
packages:
- name: generate-nginx-ingress
kind: bundle
- name: nginx-ingress
kind: application
bundles/generate-nginx-ingress/make-app.sh:
#!/bin/bash
set -eux
helm repo add nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm template helm-operator nginx/ingress-nginx > ./applications/nginx-ingress/manifest.yml
applications/nginx-ingress/README.md:
# Nginx Ingress Controller
This application will be generated by the bundle `generate-nginx-ingress`.
NB: the
applications/nginx-ingress/
folder MUST exist. You can put a file.gitkeep
inside, but it is recommended to at least add aREADME.md
for documentation purposes.