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:
Now we need to create our index.html
file.
Create a new file called index.html
and add the following code into it:
|
|
Now you can run Docker, and push all your files!
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.
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:
|
|
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:
So minus all the comments, your values.yaml
should now look something like this:
|
|
Now we are ready to package our Helm application, run the following from the CLI:
|
|
You will now have a file called helloworld-chart-0.1.0.tgz
which we will now install to our Kubernetes cluster.
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
.