Today I want to share what I did with a customer to make his GitHub Repo become an automated HTTP Helm Chart Repo.
This is a very good choice, since there’s a GitHub Action that we can use to keep the repo index updated automatically.
A GitHub Account, and some Helm Chart dummies.
Let’s create a super simple GitHub Repo/Project:
Now let’s create a branch called gh-pages.
I’m already at the UI, so I won’t clone/checkout right now.
Let’s follow this guide, to make sure our repo is ready for hosting the Helm Chart Repo!
This is what we are going to do:
You’ll want to make sure your gh-pages branch is set as GitHub Pages, click on your repo Settings and scroll down to GitHub pages section and set as per below:
Alright, it looks like we are in the right direction.
Now, it’s time to give this repo super powers, by following this GitHub Action guide:
Important: Besides the action source, it’s important to keep a /charts path to host your Helm Chart Sources, in the main branch.
So, let’s do it!
Let’s clone the repo:
➜ Harness_Labs git clone email@example.com:gabrielcerioni/harness-helm-charts.git Cloning into 'harness-helm-charts'... remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (3/3), done.
And add the changes as suggested in the Helm Chart tutorial link!
- Enhance our README.md - gh-pages branch;
- Add the Action, exactly as reported here - main branch:
Helm | Chart Releaser Action to Automate GitHub Page Charts
This process creates or updates an
index.yaml in the gh-pages branch. So, let’s use this trick to make sure the Action is working.
Ok. Now, it’s time to add our chart source path, push the project to it’s origin, and pray for the best.
I found the Helm documentation about this part a little poor, and that’s one of the reasons I’m writing this article.
This is our current state:
So, let’s create the path that will host my very simple and dummy
NGINX Helm Chart Source, and then I’ll add the very nice Helm Chart I have:
This is a Helm Source that I got by following the tutorial on the documentation. I didn’t change anything.
Let’s just add a random version in the
Chart.yaml, to make sure it’s working:
Nice! Time to push that to our origin!
Let’s just make sure this is working.
I’ll take a look at the GitHub Action tab. Looks solid to me:
I don’t believe in it. I’ll test it again, version #14 now!
Important: you can also check that the Action is handling well our
index.yaml, in the gh-pages branch.
This file is super important to any HTTP Repo, right?
You can check this out by reaching the same path in your Lab:
Big Last Step - Use it in Harness:
Let’s create a good
Helm Repo Artifact Server in Harness UI (Connectors):
And add that Repo as my Service Remote Helm Manifest!
It takes a while, but it loads the versions available:
Super nice! Let’s run it in a template
Rolling Update Workflow!
No one can stop us!
<cloud: aws, gcp, azure>
<type: howto, experts>
<category: gitops, github, kubernetes, k8s, deployment, repo, helmcharts, charts, helm, http>