Minio as Helm repository for your Kubernetes cluster

If you haven’t already heard about it, Helm is the Kubernetes package manager. Not only it lets you define, install and manage applications on your Kubernetes cluster — Helm itself is very easy to get started with. You can setup and start using Helm, very quickly on an existing Kubernetes cluster.

However, like any other package manager, Helm needs a repository to pull installation files. By default this is called the stable repository and is located at https://kubernetes-charts.storage.googleapis.com . For users who’d like to host their own Helm repository, there is a Helm command to do so — helm repo add .

An object store is perfect tool to keep such data repository. In this post we’ll see how to set up a Minio public bucket as your own Helm chart repository. But before that, let’s quickly understand how to set up Helm.

Install Helm

Prerequisites: Kubernetes cluster with kubectl configured to point to the cluster.

Once you have the Kubernetes cluster available, download and install Helm CLI binary on your computer.

Next, run helm init to install the Helm server component (Tiller). When you execute helm for the first time, it picks your Kubernetes cluster info from the default location $HOME/.kube/config. So, it knows which cluster to talk to and how to authenticate itself.

Setup Minio server and create a bucket

To use Minio as the Helm repository, start your Minio server instance and create a bucket. Here are the steps

  • Download Minio server binary from homepage.
  • Start the server using minio server /volume . Lookup the Minio quick start guide for more info.
  • Create a bucket on your Minio server instance and set the permissions to public. You can use Minio browser or mc to do this. I used mc for this post. Get started with mc here.

Once you have mc setup, create a mc alias:

mc config host add myminio SERVER_ENDPOINT ACCESS_KEY SECRET_KEY

Create a bucket:

mc mb myminio/minio-helm-repo

Set public permission:

mc policy download myminio/minio-helm-repo

This finishes Minio setup. Let us move on to setting up the Helm repository.

Create Helm repository in minio-helm-repo bucket

Helm looks for index.yaml file in its repositories. So, the first step is to create the index.yaml file. Here are the contents of the file:

index.yaml contains information on all the packages in the current repository. Each package is an entry with a list of related information. While most of the fields are self explanatory and taken from the Chart’s chart.yaml file, there are few new entries — for example, digest is the sha256sum of minio-0.1.2.tgz file.

Once you have the file ready, upload it to minio-helm-repo bucket. With mc you can do that using

mc cp ./index.yaml myminio/minio-helm-repo

Next step is to upload the chart tar ball. If you already have a chart published, you can take the chart tar ball and upload it to minio-helm-repo bucket. If you’re new to Helm charts, take a look at Helm chart development guidelines.

mc cp minio-0.1.2.tgz myminio/minio-helm-repo

Finally add this bucket as your chart repo:

helm repo add myrepo <SERVER_ENDPOINT>/minio-helm-repo

Test your repository

Now that everything is set, let’s test if Helm can talk to your new repository and install applications to the Kubernetes cluster.

helm install myrepo/minio

If everything went well, you’ll see helm setting up a new release based on the minio chart.


Related community posts:

We hangout on Slack, Join us! https://slack.minio.io

While you’re at it, help us understand your use case and how we can help you better! Fill out our best of Minio deployment form (takes less than a minute), and get a chance to be featured on the Minio website and showcase your Minio private cloud design to Minio community.