Installing and Testing Helm and Tiller

1 hour
  • 2 Learning Objectives

About this Hands-on Lab

This Hands-On Lab is intended to provide practice with installing and configuring Helm in a Kubernetes environment.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Install Helm and Tiller in the Existing Cluster

Download the helm binary release:

[user@host]$ curl https://get.helm.sh/helm-v2.17.0-linux-amd64.tar.gz > ./helm.tar.gz

Extract the archive:

[user@host]$ tar -xvf ./helm.tar.gz

Navigate to the linux-amd64 directory:

[user@host]$ cd linux-amd64

Move the helm and tiller executable files to the /usr/local/bin directory:

[user@host]$ sudo mv ./helm /usr/local/bin
[user@host]$ sudo mv ./tiller /usr/local/bin

Run the helm version command to ensure that the helm command is available:

[user@host]$ helm version

Install tiller:

[user@host]$ helm init --stable-repo-url https://charts.helm.sh/stable 

Run the version command again to ensure that Tiller is available:

[user@host]$ helm version
Deploy, Troubleshoot, and Verify Deployment of the NGINX Chart

Ensure that you are in the cloud_user home directory. This directory contains the nginx chart at /home/cloud_user/nginx:

[cloud_user@host]$ cd ~

This command should return a directory listing containing Chart.yaml:

[cloud_user@host]$ls ./nginx

Install the nginx chart:

[cloud_user@host]$ helm install ./nginx

This command should error with a "name" error, due to the tiller service account missing.
Add the tiller service account:

[cloud_user@host]$ kubectl create serviceaccount --namespace kube-system tiller
[cloud_user@host]$ kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
[cloud_user]$ kubectl patch deploy --namespace kube-system tiller-deploy -p'{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

Wait for the tiller pod to restart with the update, and then install the nginx example chart:

[cloud_user@host]$ helm install ./nginx

Once the release has completed and you see the release output, locate the cluster IP for the service that has been created. Then confirm that the nginx pod has been deployed correctly.

[cloud_user@host]$ curl "service cluster ip":8888

This should return an html message.

Clean up the test deployment, get the release name from Helm, and then delete the release:

[cloud_user@host]$ helm ls --short
[cloud_user@host]$ helm delete "return from previous command"

Confirm that the release has been removed. The following commands should return nothing:

[cloud_user@host]$ helm ls  
[cloud_user@host]$ kubectl get pods

Additional Resources

In order to facilitate the release of applications in a reproducible manner, we need to ensure that our Kubernetes cluster has package management installed and configured correctly. This will allow us to release applications. We will be taking an existing Kubernetes cluster, installing Helm and Tiller, and then releasing a test chart to ensure that everything is working correctly.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?