Using a private github repo as helm chart repo (https access)

Written by kavehmz | Published 2017/09/29
Tech Story Tags: github | helm | kubernetes | devops | git

TLDRvia the TL;DR App

Helm is a nice package manager for Kubernetes. If you are using k8s specially in complex setups helm can help you in creating a nice release process.

In complex setups sometimes you need a private helm repository for your packages.

This is how you can use a github repo, public or private, as helm repo.

Create a helm chart repo in github

It is easy. Create a repo and for adding packages, follow these commands

$ helm package $YOUR_CHART_PATH/ # to build the tgz file and copy it here$ helm repo index . # create or update the index.yaml for repo$ git add .$ git commit -m 'New chart version'$ git push

Access your repo

At the moment helm only understand http(s) for repository servers. The following trick shows how you can have that in a private or public github repo without using gh-pages.

You might know that github has a raw view. So simply use the following:

$ helm repo add sample 'https://raw.githubusercontent.com/kmzfs/helm-repo-in-github/master/'$ helm repo update$ helm search aerospikeNAME VERSION DESCRIPTIONsample/aerospike 0.1.2 A Helm chart for Aerospike in Kubernetes

and if you want to keep your repo private you can create a “Personal access tokens” and use it like:

$ helm repo add sample 'https://MY_PRIVATE_TOKEN@raw.githubusercontent.com/kmzfs/helm-repo-in-github/master/'

Just be careful who is creating the token and what is its level of access.

kmzfs/helm-repo-in-github_helm-repo-in-github - This is a sample for how to setup a helm repo in github_github.com


Written by kavehmz | A binary world janitor. Specialized in code, architecture cleanup and cost reduction
Published by HackerNoon on 2017/09/29