Helm Lab💣
Lab Overview💣
In this lab we will install Helm CLI tool, add helm repository, use
helm
CLI tool to template kubernetes.yaml
files.
Helm Templating💣
Templating a chart💣
- Install the Helm CLI
mkdir -p ~/Desktop/configlabs
cd ~/Desktop/configlabs
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- Add a helm chart repository
helm repo add oteemocharts https://oteemo.github.io/charts
- Update your local helm repositories
helm repo update
-
Template out to a single file
verify that you are in the correct directory (should be ~/Desktop/configlabs)pwd helm template oteemocharts/sonarqube > generated.yaml
-
View contents of the generated file
cat generated.yaml
This file should have
Secret
,ConfigMap
,Service
,Deployment
,StatefulSet
, andpod
objects.
These kubernetes object files are all in one single.yaml
file separated by---
file deliminator
To view the individual kubernetes objects
cat generated.yaml | grep -i kind:
kind: Secret
kind: ConfigMap
kind: ConfigMap
kind: ConfigMap
kind: ConfigMap
kind: ConfigMap
kind: Service
kind: Service
kind: Service
kind: Deployment
kind: StatefulSet
kind: Pod
-
Template out to multiple files
Another way to generate would be to a directory, this allows us to have a more manageable way to view all the resources needed for an application
helm template sonar oteemocharts/sonarqube --output-dir generated
-
View files created
ls -R generated
This will have all the same contents, just split up over the different files