You’ve probably been using helm for a while and thinking of using it as a means to deploy your custom applications but didn’t know how exactly to go by it? Well today we’ll be going through a series of steps required to setting up your chart repository and using your custom charts via helm.

First, let’s see what is needed in order to use custom charts with helm:

Custom charts A chart repository Working kubernetes cluster Helm

Assuming that you’ve created your custom chart for your deployment(For this blog we’ll be using a custom mysql chart), the 1st thing will be to upload that chart to a chart repository from where helm can fetch it and install it. For that we’ll be using ChartMuseum as our chart repository.

Why ChartMuseum you ask?

It’s really simple to set up

It exposes an API that you can use to manipulate and fetch charts

It supports local, s3 and azure storage backend

Setting up ChartMuseum

First we need to set up ChartMuseum and upload our chart to it. Let’s follow the steps below for setting it up

Download the binary by using the link below or you can always download a specific release from their github

Make the binary executable by running chmod +x chartmuseum

Move the binary to your bin location

Verify that it is installed by running chartmuseum --version

Now that ChartMuseum is installed, we will configure a local storage backend for it

Replace <chart-dir> and <port> in the following command and run it on a terminal

and in the following command and run it on a terminal ChartMuseum will use <chart-dir> for its storage

chartmuseum --port=<port> --storage="local" --storage-local-rootdir="<chart-dir>"

You will see ChartMuseum showing that it is starting on the specified port

Configuring ChartMuseum with Helm

In order for helm to fetch and install charts from ChartMuseum, you will first need to add ChartMuseum to helm as a repository. You can do that by following the steps below

Run helm repo add chartmuseum http://localhost:8080

Here chartmuseum will act as a repository name and http://localhost:8080 will be the url where chartmuseum is running

will act as a repository name and will be the url where chartmuseum is running Now you can run helm repo update and it will fetch chart metadata from ChartMuseum as well

Uploading your custom chart to ChartMuseum

Now that ChartMuseum is up and running on your specified port, let’s move on to uploading your custom chart. For our demo we’ll be using a custom mysql chart located here.

If you want to follow along, simply clone the repository above and open up a terminal in that directory.

The demo chart contains a directory named mysql , inside which is its chart. Let’s follow the steps below to upload the chart to ChartMuseum

Navigate to the cloned repository and go to mysql directory

directory Run helm lint to verify that the chart has no compile time errors

to verify that the chart has no compile time errors Run helm package . to package the chart into a file. The packaged name of the chart will be mysql-1.0.0.tgz , where mysql is the name of the chart and 1.0.0 is the chart version

to package the chart into a file. The packaged name of the chart will be , where is the name of the chart and is the chart version Once we have the packaged chart, we can upload it to ChartMuseum by sending a post request via curl to CM (assuming CM is running on port 8080).

Installing your Custom Chart

At this point you’ve accomplished the following things:

Install and Configure ChartMuseum

Add ChartMuseum as a Repository in Helm

Upload your custom chart to ChartMuseum

Now all you have to do is to install the custom chart via Helm. For that follow the steps below

Run helm repo update to fetch the latest chart that you uploaded to ChartMuseum

to fetch the latest chart that you uploaded to ChartMuseum Install your chart by running helm install chartmuseum/mysql --name demo-mysql and that’s it.

You’ve successfully installed your custom chart on your kubernetes cluster. You just have to upload all your custom charts to ChartMuseum now and install them via helm.

This is how we use ChartMuseum as a chart repository for helm in Stakater. For more information about us and what we do, or professional services regarding your stack / devops, visit stakater.com