Hosting HELM chart private repositories in GitHub and GitLab

By: Tomoya Amachi
Posted: Feb 15, 2020

Helm is a popular tool for Kubernetes package manager. This article introduces what is Helm and how to host private helm repositories.

Helm's concept and glossary

The package manager for Kubernetes

Official site

Helm is a popular tool for Kubernetes package manager. Helm contains 3 main concepts.


A "Repo" is a charts registry. You can add your own registry.

The official Helm stable repo is popular. You can add repos with following commands.

$ helm repo add stable
$ helm repo update
$ helm search repo stable
NAME                                    CHART VERSION   APP VERSION                     DESCRIPTION
stable/acs-engine-autoscaler            2.2.2           2.1.1                           DEPRECATED Scales worker nodes within agent pools
stable/aerospike                        0.2.8           v4.5.0.5                        A Helm chart for Aerospike in Kubernetes
stable/airflow                          4.1.0           1.10.4                          Airflow is a platform to programmatically autho...
stable/ambassador                       4.1.0           0.81.0                          A Helm chart for Datawire Ambassador


A "Chart" is the term used for a package. A "Chart" is a collection of files that describe a related set of Kubernetes resources.

$ helm show chart stable/aerospike
apiVersion: v1
appVersion: v4.5.0.5
description: A Helm chart for Aerospike in Kubernetes
- aerospike
- big-data
- email:
  name: kavehmz
- email:
  name: okgolove
name: aerospike
version: 0.3.2


When a chart is installed, the Helm library creates a release to track that installation. A single chart may be installed many times into the same cluster, and create many different releases.

Release names always changed when we install charts.

We can set release name with a parameter.

$ helm install [RELEASE_NAME] stable/aerospike

Or we can use generated values.

$ helm install --generate-name stable/aerospike


Values provide a way to override template defaults with your own information.

We can check templates with values.

$ helm template stable/aerospike -f test_values.yml

And we can install with values.

$ helm install --generate-name stable/aerospike -f test_values.yml


helm v3.0.3


Public Repository

We can use GitLab Pages in a Public Repository. We need running GitLab runner to publish GitLab Pages.

# .gitlab-ci.yml
    name: linkyard/docker-helm
    entrypoint: ["/bin/sh", "-c"]
  stage: deploy
    - helm init --client-only
    - mkdir -p ../public
    - "echo \"User-Agent: *\nDisallow: /\" > ../public/robots.txt"
    - helm package * --destination ../public
    - helm repo index --url https://${CI_PROJECT_NAMESPACE}${CI_PROJECT_NAME} .
    - mv index.yaml ../public
    - mv ../public .
      - public
    - master

After that

helm repo add mygitlab

Private Repository

If you use index.yaml we need to build a new server which hosts index.yaml.

But helm v3 can evaluate OCI format, so we can use GitLab Packages.

At first, we create a new chart.

# OCI format is experimental feature

helm registry login -u tomoyamachi --password <token>

helm chart save map-collector

helm chart list
helm chart push

Then we try to fetch the target chart in another environment.

helm registry login -u tomoyamachi --password <token>
helm chart pull
helm chart list

Now we can use the catalog chart in this environment.


When using GitHub, we use

You only need to set the index.yaml to the root path of the target repository.

helm repo add my-public-github

You can provide a username and password(token) with parameters.

helm repo add --username tomoyamachi --password $TOKEN my-private-github