How to Deploy a Helm “Hello World” App Onto Kubernetes

We will create a simple Hello World static HTTP Service using Helm, package it and release it to an AWS EKS Cluster.

This tutorial expects you to have kubectl as well as helm installed on your computer.

Build our Docker image

Create a file called Dockerfile and place the below into it:

FROM busybox
ADD index.html /www/index.html
CMD httpd -p 8008 -h /www; tail -f /dev/null

Now we need to create our index.html file.

Create a new file called index.html and add the following code into it:

<h1>Hello World</h1>

Now you can run Docker, and push all your files!

docker build -t hello-world .
docker run -p 80:8008 hello-world

Confirm you can reach http://localhost in your web browser, if you see your Hello World HTML file, then let’s push this Docker image to Docker Hub.

docker login
docker tag hello-world aogl/hello-world
docker push aogl/hello-world:latest

Note to replace aogl in the above commands with your own username!

Package and install with Helm

Let’s create a skeleton Helm application, use the CLI to do this:

helm create helloworld-chart

Now you should have a new directory called helloworld-chart, which is the same as what you asked Helm to create for you in the previous step.

You can run a helm lint within this directory, if you want Helm to run some config checks against the files. This is not required though, so only do it when you’ve made changes to the files later on.

Now you want to update the values.yaml file and replace a couple of things in the image and service sections:

  repository: aogl/hello-world
  tag: latest
  pullPolicy: IfNotPresent

  name: hello-world
  type: LoadBalancer
  externalPort: 80
  internalPort: 8008
  port: 80

So minus all the comments, your values.yaml should now look something like this:

replicaCount: 1

  repository: aogl/hello-world
  tag: latest
  pullPolicy: IfNotPresent

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

  create: true
  annotations: {}

podSecurityContext: {}

securityContext: {}

  name: hello-world
  type: LoadBalancer
  externalPort: 80
  internalPort: 8008
  port: 80

  enabled: false
  annotations: {}
    - host: chart-example.local
      paths: []
  tls: []

resources: {}

nodeSelector: {}

tolerations: []

affinity: {}

Now we are ready to package our Helm application, run the following from the CLI:

helm package helloworld-chart

You will now have a file called helloworld-chart-0.1.0.tgz which we will now install to our Kubernetes cluster .

helm install helloworld helloworld-chart-0.1.0.tgz
kubectl get svc --watch

The --watch command above will sit and wait to receive an IP address for you.

Now using your web browser, you should be able to navigate to your IP or Load Balancer public IP that kubectl gave in response to the last step kubectl get svc.