Service Foundry
Young Gyu Kim <credemol@gmail.com>

Setting Up Helm Chart Repository on GitHub

github helm repository

Introduction

This guide provides a step-by-step walkthrough for setting up a Helm chart repository on GitHub. Helm is a package manager for Kubernetes that simplifies defining, installing, and managing Kubernetes applications. Hosting Helm charts on GitHub enables easy sharing and centralized management.

Steps to Set Up a GitHub Helm Chart Repository

The following steps outline the process of setting up a GitHub Helm chart repository:

  1. Create a GitHub repository.

  2. Develop and package Helm charts.

  3. Create an index file for the repository.

  4. Commit and push the packaged charts and index file to the repository.

  5. Host the repository on GitHub Pages.

  6. Add the GitHub repository to Helm.

  7. Install charts from the GitHub Helm repository.

Step 1: Create a GitHub Repository

Create a new GitHub repository named helm-charts. Ensure the repository is initialized with a README file for clarity and structure.

Step 2: Develop and Package Helm Charts

Generate a Helm chart using the following command:

$ helm create service-foundry-builder

Customize the generated values.yaml file as needed, and remove unnecessary template files.

Package the chart to create a .tgz file:

$ helm package service-foundry-builder

Step 3: Create an Index File

The index.yaml file provides metadata about the available charts and allows Helm to locate them. Generate the index file with:

$ helm repo index . --url https://nsalexamy.github.io/helm-charts

Step 4: Commit and Push to GitHub

Add the .tgz files and the index.yaml file to the repository and push them to the main branch:

$ git add .
$ git commit -m "Add Helm charts"
$ git push origin main

Step 5: Host on GitHub Pages

  1. Create a new branch named gh-pages.

  2. In the repository settings, enable GitHub Pages for the gh-pages branch.

  3. Merge the main branch into gh-pages to publish the files.

Once merged, the index.yaml file will be accessible at:

For example, if your username is nsalexamy and the repository is helm-charts, the URL will be: https://nsalexamy.github.io/helm-charts

Step 6: Add the Repository to Helm

Add the GitHub repository as a Helm repository using the following command:

$ helm repo add service-foundry https://nsalexamy.github.io/helm-charts

# Verify the repository is added
$ helm repo list

Step 7: Install Charts from the GitHub Helm Repository

Install the Helm chart using:

$ helm install service-foundry-builder service-foundry/service-foundry-builder -n service-foundry --create-namespace

Results of the execution of Service Foundry Builder

Kubernetes resources created by Service Foundry Builder can be found on AWS Admin console like a screenshot below.

sf builder aws results
Figure 1. AWS Admin Console - EKS deployments

Conclusion

In this guide, we successfully set up a GitHub Helm chart repository, packaged the charts, generated an index file, and hosted the repository on GitHub Pages. Additionally, we demonstrated how to add the repository to Helm and install charts directly from it.

This document is available with better formatting at: https://nsalexamy.github.io/service-foundry/pages/documents/blog/github-helm-repo/