Skip to content

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📜

  1. Install the Helm CLI
mkdir -p ~/Desktop/configlabs
cd ~/Desktop/configlabs
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
  1. Add a helm chart repository
helm repo add oteemocharts https://oteemo.github.io/charts
  1. Update your local helm repositories
helm repo update
  1. 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
    
  2. View contents of the generated file

    cat generated.yaml 
    

    This file should have Secret, ConfigMap, Service, Deployment, StatefulSet, and pod 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:
Your output should look like this
 kind: Secret
 kind: ConfigMap
 kind: ConfigMap
 kind: ConfigMap
 kind: ConfigMap
 kind: ConfigMap
 kind: Service
 kind: Service
 kind: Service
 kind: Deployment
 kind: StatefulSet
 kind: Pod

  1. 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
    
  2. View files created

    ls -R generated
    

    This will have all the same contents, just split up over the different files

Other ways to interact with Helm📜

Official Helm Docs