Previously we looked at how we can deploy a Node app using Helm. It is nice and all, but one of the main reason we want to use Helm chart is to share right? Today, we are going to look at how we can publish our Helm chart to Artifact Hub by using Github Pages.
1. Package Helm chart
The first step is to package our node-web-app Helm chart. Create a new directory called
node-web-app (I have created the directory alongside
devops directory, we will be pushing this new directory to Github later on).
Run the following command to package the
node-web-app Helm chart. You may have slightly different command depending on the location
helm package devops/handon/node-web-app
You will see a node-web-app-0.1.0.tgz get created. Move it to
mv node-web-app-0.1.0.tgz node-web-app
A valid Helm chart requires an index file. We can use Helm to create an
index.yaml for us by:
// helm repo index [DIRECTORY]
helm repo index node-web-app
You should see
2. Create Github Page
node-web-app to your Github repository. You will get a guidance when you create a new repository on how to push your code to Github.
Create a Github page on this repository by checking out to a new branch called gh-pages, then push the branch to remote.
git checkout -b gh-pages
git push -u origin gh-pages
After you have pushed the gh-pages branch remote, go and check whether your Github page is live. Go to your repository settings.
Click on Pages.
You should see something similar. You can click on the link and it will show the content of your README.md. Take note of your Github Page url (for my case, it is https://yoongti.github.io/node-web-app/), we will be using this url later.
3. Add chart to Artifact Hub
Go to https://artifacthub.io/ and create an account if you have not done so. Go to Control Panel by clicking your profile icon.
Click on Add Repository.
Fill in all the required information. The Kind should be Helm Chart. The url should be the url of your Github Page. Then click Add.
It will take some time for Artifact Hub to process. After it is done, you will see a green checkmark.
You can then search for it on Artifact Hub. Good job!!
You have learned how to publish Helm chart on Artifact Hub using Github Pages.
This concludes our Helm in Kubernetes series. I hope you learn something new along the way!
Helm In Kubernetes— Part 1: Introduction
If you have been using Kubernetes for some time, you probably heard about Helm. But what is Helm actually? What does…
Thanks for reading! If you like the post, leave a like so other people can see it as well.