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
    
  2. Add a helm chart repository

    helm repo add oteemocharts https://oteemo.github.io/charts
    
  3. Update your local helm repositories

    helm repo update
    
  4. 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
    
  5. 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
    
  6. 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
    
  7. 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