The chart-repo
component is tool that scans a Helm chart repository and populates chart metadata in a MongoDB server. This metadata is then served by the chartsvc
component.
Telepresence is not a hard requirement, but is recommended for a better developer experience
export GOPATH=~/gopath/
export PATH=$GOPATH/bin:$PATH
export KUBEAPPS_DIR=$GOPATH/src/github.com/kubeapps/kubeapps
git clone --recurse-submodules https://github.com/kubeapps/kubeapps $KUBEAPPS_DIR
The chart-repo
sources are located under the cmd/chart-repo/
directory of the repository.
cd $KUBEAPPS_DIR/cmd/chart-repo
Kubeapps is a Kubernetes-native application. To develop and test Kubeapps components we need a Kubernetes cluster with Kubeapps already installed. Follow the Kubeapps installation guide to install Kubeapps in your cluster.
go build
This builds the chart-repo
binary in the working directory.
Telepresence is a local development tool for Kubernetes microservices. As chart-repo
is a tool that is executed in the Kubernetes cluster we use telepresence so that chart-repo
can access the services running on your local development server.
Create a telepresence
shell,
telepresence --namespace kubeapps --method inject-tcp --run-shell
NOTE: If you encounter issues getting this setup working correctly, please try switching the telepresence proxying method in the above command to
vpn-tcp
. Refer to the telepresence docs to learn more about the available proxying methods and their limitations.
To test and debug the chart-repo
tool launch the command locally within the telepresence shell:
export MONGO_PASSWORD=$(kubectl get secret --namespace kubeapps mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
./chart-repo sync --mongo-url=mongodb.kubeapps --mongo-user=root stable https://kubernetes-charts.storage.googleapis.com
To start the tests on the chart-repo
execute the following command:
go test
To build the kubeapps/chart-repo
docker image with the docker image tag myver
:
cd $KUBEAPPS_DIR
make VERSION=myver kubeapps/chart-repo