By default, Helm only uses the official Helm/stable repository for lookups and often in the following chapters, we will need to add additional repositories from third-party vendors using the method explained in this recipe.
Let's perform the following steps to add additional Helm repositories to your source list:
- Check the list of existing repositories. You should only see stable and local on the list:
$ helm repo list
NAME URL
stable https://kubernetes-charts.storage.googleapis.com
local http://127.0.0.1:8879/charts
- We need a persistent volume and authentication configured for our repository server. Create a file called customhelmrepo.yaml using the following content:
cat <<EOF >customhelmrepo.yaml
env:
open:
STORAGE: local
persistence:
enabled: true
accessMode: ReadWriteOnce
size: 10Gi
secret:
BASIC_AUTH_USER: helmcurator
BASIC_AUTH_PASS: myhelmpassword
EOF
- Create a repository server using a persistent volume:
$ helm install --name my-chartmuseum -f customhelmrepo.yaml stable/chartmuseum
- Get the service IP for chartmuseum. The following command will return an IP address, in our example, 10.3.0.37:
$ kubectl get svc --namespace default -l "app=chartmuseum" -l \
"release=my-chartmuseum" -o jsonpath="{.items[0].spec.clusterIP}"; echo
10.3.0.37
- Add the new Helm repository to your list of repositories; in our case, the IP is 10.3.0.37:
$ helm repo add chartmuseum http://10.3.0.37:8080
- Check the list of existing repositories:
$ helm repo list
NAME URL
stable https://kubernetes-charts.storage.googleapis.com
local http://127.0.0.1:8879/charts
chartmuseum http://10.3.0.37:8080
There are many options available to host your chart repository. You can deploy a local repository using an open source Helm repository server called ChartMuseum, on an S3 bucket, GitHub pages, or a classic web server. For simplicity, we used Helm itself to deploy a server. You can find alternative hosting methods for Helm charts under the See also section.