Skip to main contentMerative SPM on Kubernetes

ChartMuseum

Helm Charts are stored in a repository. For development purposes, you can use a local repository to use Helm along with Minikube. This runbook uses ChartMuseum as the local repository.

A Helm Chart is a collection of files that describe a related set of Kubernetes resources. Helm Charts are the recommended way to distribute deployments on Kubernetes clusters.

Use ChartMuseum to develop, test, and deploy locally before you distribute the charts. For more information, see Introduction to Helm.

Installing ChartMuseum in a Docker® container

ChartMuseum can run in a Docker container by using the docker run command when the docker container is created.

Take the following steps:

  • Start a Docker container that is accessible locally on port 8080:
docker run --rm -d --name chartmuseum \
-p 8080:8080 \
-e DEBUG=true \
-e STORAGE=local \
-e STORAGE_LOCAL_ROOTDIR=/tmp/charts \
chartmuseum/chartmuseum:v0.12.0
  • Run the docker logs command to view the Chart Museum logs:
docker logs chartmuseum

Testing ChartMuseum connectivity

Run the following command to test connectivity. 127.0.0.1 is the localhost IP address.

Note: On Windows, the Docker Engine can run in a dedicated docker-machine, or can be reused from the Minikube VM.

curl http://127.0.0.1:8080/index.yaml

You will see something like the following example:

apiVersion: v1
entries: {}
generated: "2019-06-17T10:55:37Z"
serverInfo: {}

Provisioning charts

When ChartMuseum is running, you can copy the compressed tgz files that are produced by Helm, or by using the Helm Push plugin (recommended approach).

Note: On Windows, as per this issue, the Helm Push plugin must be installed from a Bash shell (e.g., Git Bash).

helm plugin install https://github.com/chartmuseum/helm-push

Creating the chart files is covered later in the runbook when you run the helm package command. For more information, see Preparing Helm Charts.

Configure Helm to access the local repository

To use ChartMuseum as a repository, you must configure Helm to point to it. Run the appropriate command:

helm repo add local-development http://127.0.0.1:8080/

Verify the list of repositories by running the following command:

helm repo list

The helm repo list command also returns the local-development repository that you added when you ran the helm repo add command.

When the repository is added, run the following command to refresh the Helm index:

helm repo update