-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assetsvc and asset-syncer docs (#1415)
- Loading branch information
Andres Martinez Gotor
authored
Jan 8, 2020
1 parent
35d0ae1
commit 039812c
Showing
5 changed files
with
98 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Kubeapps asset-syncer Developer Guide | ||
|
||
The `asset-syncer` component is a tool that scans a Helm chart repository and populates chart metadata in the database. This metadata is then served by the `assetsvc` component. | ||
|
||
## Prerequisites | ||
|
||
- [Git](https://git-scm.com/) | ||
- [Make](https://www.gnu.org/software/make/) | ||
- [Go programming language](https://golang.org/dl/) | ||
- [Docker CE](https://www.docker.com/community-edition) | ||
- [Kubernetes cluster (v1.8+)](https://kubernetes.io/docs/setup/pick-right-solution/). [Minikube](https://github.com/kubernetes/minikbue) is recommended. | ||
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | ||
- [Telepresence](https://telepresence.io) | ||
|
||
## Environment | ||
|
||
```bash | ||
export GOPATH=~/gopath | ||
export PATH=$GOPATH/bin:$PATH | ||
export KUBEAPPS_DIR=$GOPATH/src/github.com/kubeapps/kubeapps | ||
``` | ||
|
||
## Download the Kubeapps source code | ||
|
||
```bash | ||
git clone https://github.com/kubeapps/kubeapps $KUBEAPPS_DIR | ||
``` | ||
|
||
The `asset-syncer` sources are located under the `cmd/asset-syncer/` directory. | ||
|
||
### Install Kubeapps in your cluster | ||
|
||
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](../../chart/kubeapps/README.md) to install Kubeapps in your cluster. | ||
|
||
### Building the `asset-syncer` image | ||
|
||
```bash | ||
cd $KUBEAPPS_DIR | ||
make kubeapps/asset-syncer | ||
``` | ||
|
||
This builds the `asset-syncer` Docker image. | ||
|
||
### Running in development | ||
|
||
When using MongoDB: | ||
|
||
```bash | ||
export DB_PASSWORD=$(kubectl get secret --namespace kubeapps kubeapps-mongodb -o go-template='{{index .data "mongodb-root-password" | base64decode}}') | ||
telepresence --namespace kubeapps --docker-run -e DB_PASSWORD=$DB_PASSWORD --rm -ti kubeapps/asset-syncer /asset-syncer sync --database-user=root --database-url=kubeapps-mongodb --database-type=mongodb --database-name=charts stable https://kubernetes-charts.storage.googleapis.com | ||
``` | ||
|
||
When using PostgreSQL: | ||
|
||
```bash | ||
export DB_PASSWORD=$(kubectl get secret --namespace kubeapps kubeapps-db -o go-template='{{index .data "postgresql-password" | base64decode}}') | ||
telepresence --namespace kubeapps --docker-run -e DB_PASSWORD=$DB_PASSWORD --rm -ti kubeapps/asset-syncer /asset-syncer sync --database-user=postgres --database-url=kubeapps-postgresql:5432 --database-type=postgresql --database-name=assets stable https://kubernetes-charts.storage.googleapis.com | ||
``` | ||
|
||
Note that the asset-syncer should be rebuilt for new changes to take effect. | ||
|
||
### Running tests | ||
|
||
You can run the asset-syncer tests along with the tests for the Kubeapps project: | ||
|
||
```bash | ||
go test -v ./... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.