-
Notifications
You must be signed in to change notification settings - Fork 705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add developer docs for chartsvc and chart-repo #775
Merged
prydonius
merged 3 commits into
vmware-tanzu:master
from
prydonius:754-chartsvc-chart-repo-dev-docs
Oct 30, 2018
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Kubeapps chart-repo Developer Guide | ||
|
||
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. Its source is maintained in the [Monocular project repository](https://github.com/helm/monocular). | ||
|
||
## 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 MONOCULAR_DIR=$GOPATH | ||
``` | ||
|
||
## Download the Monocular source code | ||
|
||
```bash | ||
git clone https://github.com/helm/monocular $MONOCULAR_DIR | ||
``` | ||
|
||
The `chart-repo` sources are located under the `cmd/chart-repo/` 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 `chart-repo` image | ||
|
||
```bash | ||
cd $MONOCULAR_DIR | ||
dep ensure | ||
make -C cmd/chart-repo docker-build | ||
``` | ||
|
||
This builds the `chart-repo` Docker image. | ||
|
||
### Running in development | ||
|
||
#### Option 1: Using Telepresence (recommended) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this guide only have one option so I guess we can skip the heading There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch, thanks! |
||
|
||
```bash | ||
export MONGO_PASSWORD=$(kubectl get secret --namespace kubeapps kubeapps-mongodb -o jsonpath="{.data.mongodb-root-password}" | base64 --decode) | ||
telepresence --namespace kubeapps --docker-run -e MONGO_PASSWORD=$MONGO_PASSWORD --rm -ti quay.io/helmpack/chart-repo /chart-repo sync --mongo-user=root --mongo-url=kubeapps-mongodb stable https://kubernetes-charts.storage.googleapis.com | ||
``` | ||
|
||
Note that the chart-repo should be rebuilt for new changes to take effect. | ||
|
||
### Running tests | ||
|
||
You can run the chart-repo tests along with the tests for the Monocular 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Kubeapps chartsvc Developer Guide | ||
|
||
The `chartsvc` component is a micro-service that creates an API endpoint for accessing the metadata for charts in Helm chart repositories that's populated in a MongoDB server. Its source is maintained in the [Monocular project repository](https://github.com/helm/monocular). | ||
|
||
## 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 MONOCULAR_DIR=$GOPATH | ||
``` | ||
|
||
## Download the Monocular source code | ||
|
||
```bash | ||
git clone https://github.com/helm/monocular $MONOCULAR_DIR | ||
``` | ||
|
||
The `chartsvc` sources are located under the `cmd/chartsvc/` 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 `chartsvc` image | ||
|
||
```bash | ||
cd $MONOCULAR_DIR | ||
dep ensure | ||
make -C cmd/chartsvc docker-build | ||
``` | ||
|
||
This builds the `chartsvc` Docker image. | ||
|
||
### Running in development | ||
|
||
#### Option 1: Using Telepresence (recommended) | ||
|
||
```bash | ||
telepresence --swap-deployment kubeapps-internal-chartsvc --namespace kubeapps --expose 8080:8080 --docker-run --rm -ti quay.io/helmpack/chartsvc /chartsvc --mongo-user=root --mongo-url=kubeapps-mongodb | ||
``` | ||
|
||
Note that the chartsvc should be rebuilt for new changes to take effect. | ||
|
||
#### Option 2: Replacing the image in the chartsvc Deployment | ||
|
||
Note: By default, Kubeapps will try to fetch the latest version of the image so in order to make this workflow work in Minikube you will need to update the imagePullPolicy first: | ||
|
||
``` | ||
kubectl patch deployment kubeapps-internal-chartsvc -n kubeapps --type=json -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "IfNotPresent"}]' | ||
``` | ||
|
||
``` | ||
kubectl set image -n kubeapps deployment kubeapps-internal-chartsvc chartsvc=quay.io/helmpack/chartsvc:latest | ||
``` | ||
|
||
For further redeploys you can change the version to deploy a different tag or rebuild the same image and restart the pod executing: | ||
|
||
``` | ||
kubectl delete pod -n kubeapps -l app=kubeapps-internal-chartsvc | ||
``` | ||
|
||
Note: If you using a cloud provider to develop the service you will need to retag the image and push it to a public registry. | ||
|
||
### Running tests | ||
|
||
You can run the chartsvc tests along with the tests for the Monocular project: | ||
|
||
```bash | ||
go test -v ./... | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we just point here to the monocular repo? We are having duplicated documentation
Also this is likely to get outdated since the source code of this tool is not in this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #775 (comment).
But how often do we need to change the development workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that we don't update them very often