Skip to main content

Creating a Helm Chart

Hands-On Lab


Photo of Travis Thomsen

Travis Thomsen

Course Development Director in Content





For the last six months, the Acme Anvil Corporation has been migrating some of their bare metal infrastructure to Docker containers. A schism has developed between the members of your team on whether to use Docker Swarm or Kubernetes. To settle the dispute, your manager has decided to create a series of challenges. You have been tasked with using Helm charts to create an application using the httpd image. The service should be publicly accessible using NodePort.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Creating a Helm Chart


In this lab, we are going to install Helm and then create a Helm chart that we will use to create an httpd application.

Accessing the Live Environment

Locate the public IP address on the lab instructions page and click the clipboard icon to copy it. Open your terminal application, and enter the following:

ssh cloud_user@PUBLIC_IP_ADDRESS

At the prompt, enter yes to confirm that we wish to continue connecting.

Next, copy the password from the lab instructions page and enter it at the password prompt in your terminal. Then elevate privileges to root.

sudo su -

Enter the password again when prompted. We have now successfully logged in to the environment.

Creating an Application Using Helm

Install Helm

Use curl to create a local copy of the Helm install script.

curl > /tmp/

Verify that this worked by running cat on the file we just downloaded.

cat /tmp/

You should see a long output that indicates the file was downloaded correctly. Use clear to clear your screen.

Next, we'll use chmod to modify access permissions for the install script.

chmod 700 /tmp/

Set the version to v2.8.2.

DESIRED_VERSION=v2.8.2 /tmp/

Then, initialize Helm.

helm init --wait

Finally, we need to give Helm the permissions it needs to work with Kubernetes. Run the following command:

kubectl --namespace=kube-system create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default

Run helm ls to make sure our configuration is working properly. We should get no error response, indicating that there are no issues.

Create a Helm Chart

Create a directory called charts and change your working directory to charts.

mkdir charts
cd charts

Now let's create the chart for httpd.

helm create httpd

Run ls to verify that our directory was created correctly, then use clear to clear your screen.

Navigate to the httpd directory.

cd httpd/

This directory contains two files: chart.yaml and values.yaml. We need to edit the values.yaml file.

Open values.yaml in the vi text editor.

vi values.yaml

Under image, change the repository to httpd. Change the tag to latest. Under service, change type to NodePort.

When you're finished, httpd/values.yaml should look like this:

replicaCount: 1

  repository: httpd
  tag: latest
  pullPolicy: IfNotPresent

  type: NodePort
  port: 80

  enabled: false
  annotations: {}
  path: /
    - chart-example.local
  tls: []

resources: {}

nodeSelector: {}

tolerations: []

affinity: {}

Then, exit the vi text editor.


Create the Application

Back out of the httpd directory.

cd ../

Now that we're back in the charts directory, let's install our application.

helm install --name my-httpd ./httpd/

Copy the commands listed under the NOTES section of the output, and then paste and run them. It should return the private IP address and port number of our application.

Let's check to see if our pods have come online.

kubectl get pods

The output shows us the pod that was created by Helm. Now let's list the services.

kubectl get services

Locate the port number of my-httpd displayed in the output; we'll need it in a moment. Next, navigate to the lab instructions page, and copy the public IP address. Open a new browser tab, and paste in the public IP address. Add a colon (:) after it. Then, copy the port number of my-httpd from your terminal output and paste it after the colon in the address bar of your browser tab. Press Enter to load the page. If everything is working correctly, you should see a success message that says, "It works!"


Congratulations, you've successfully completed this lab!