Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Upgrade readme file #43

Merged
merged 3 commits into from
Oct 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 47 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,51 @@ For more information, read the [Helm Broker documentation](https://kyma-project.

To run the project, download these tools:

* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
* [Helm CLI](https://github.com/kubernetes/helm#install)
* [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) for local installation
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) 1.16
* [Helm CLI](https://github.com/kubernetes/helm#install) 2.10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we cannot use helm 2.14 or 2.15?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested. can be :)

* [docker](https://docs.docker.com/install/) 19.03 (for local installation)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [docker](https://docs.docker.com/install/) 19.03 (for local installation)
* [Docker](https://docs.docker.com/install/) 19.03 (for local installation)

* [Kind](https://github.com/kubernetes-sigs/kind#installation-and-usage) 0.5 (for local installation)

for non-local installation (without kind) use Kubernetes in version 1.15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for non-local installation (without kind) use Kubernetes in version 1.15
>**NOTE:** For non-local installation, use Kubernetes v1.15.


## Installation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should somewhere describe that you can just execute the
./hack/run-dev-kind.sh which will execute all those steps for you. Now it is a piece of secret knowledge.

IMO here we can have just info about this script with prerequisite and in the directory where this ./hack/run-dev-kind.sh have details what is done under the hood and if someone wants to do it manually then can do it.


To run the Helm Broker, you need a Kubernetes cluster with Tiller and Service Catalog. Follow these steps to set up the Helm Broker on Minikube with all necessary dependencies:
To run the Helm Broker, you need a Kubernetes cluster with Tiller and Service Catalog. Follow these steps to set up the Helm Broker on Kind with all necessary dependencies:

1. Run the Minikube:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can just have a short script under the hack folder so user/developer will need to just execute
./hack/run-dev-kind.sh

this script can even automate that kind and helm will be downloaded for you if you will specify additional flag, we already have some helpers for that in /hack/ci dir.

so sth like:

./hack/run-dev-kind.sh --skip-deps-installation # such thing will resuse your own kind and helm
# or
./hack/run-dev-kind.sh --install-deps # such thing will install own kind and helm instead of reusing your own

I do not have strong preferences if skip or install is a better approach

WDYT?
because copying that each time is boring :(

1. Create local cluster with Kind (making sure the docker is turned on):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Create local cluster with Kind (making sure the docker is turned on):
1. Create a local cluster on Kind:

```bash
minikube start
kind create cluster
```

2. Install Tiller into your cluster:
```bash
helm init
helm init --wait
```

3. Create ServiceAccount for Tiller with admin privileges
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo it should be in different order:

shout '- Installing Tiller...'
kubectl --namespace kube-system create sa tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller --upgrade --wait

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Order is the same: create serviceaccount, create clusterrolebinding,
the difference is the last command: helm init instead patch deploy. Do you mean change command? Is there something wrong with patch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Create ServiceAccount for Tiller with admin privileges
3. Create a ServiceAccount for Tiller with admin privileges:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outdated

```bash
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
```

3. Install the Service Catalog as a Helm chart:
4. Install the Service Catalog as a Helm chart:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. Install the Service Catalog as a Helm chart:
4. Install Service Catalog as a Helm chart:

```bash
helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com
helm install svc-cat/catalog --name catalog --namespace catalog
```

4. Install the Helm Broker chart:
5. Clone Helm Broker repository
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. Clone Helm Broker repository
5. Clone the Helm Broker repository:

```bash
helm install charts/helm-broker --name helm-broker --namespace helm-broker
git clone git@github.com:kyma-project/helm-broker.git
```
## Usage

6. Install the Helm Broker chart from the cloned repository:
```bash
helm install charts/helm-broker --name helm-broker --namespace helm-broker
```

## Usage

If you have installed the Helm Broker with the Service Catalog, you can add your addon repositories and provision ServiceInstances. Read [this](https://kyma-project.io/docs/master/components/helm-broker#details-create-addons-repository) document to learn how. You can find more ready-to-use addons [here](https://github.com/kyma-project/addons). Follow this example to configure the Helm Broker and provision the Redis instance:

Expand All @@ -49,7 +63,6 @@ If you have installed the Helm Broker with the Service Catalog, you can add your
kubectl apply -f hack/examples/sample-addons.yaml
```


After the Helm Broker processes the addons' configuration, you can see the Redis ClusterServiceClass:

```bash
Expand Down Expand Up @@ -116,22 +129,39 @@ Use the following environment variables to configure the Controller component of

To set up the project, download these tools:

* [Go](https://golang.org/dl/) 1.11.4
* [Dep](https://github.com/golang/dep) v0.5.0
* [Go](https://golang.org/dl/) 1.12
* [Dep](https://github.com/golang/dep) 0.5
* [Docker](https://www.docker.com/)

>**NOTE:** The versions of Go and Dep are compliant with the `buildpack` used by Prow. For more details, read [this](https://github.com/kyma-project/test-infra/blob/master/prow/images/buildpack-golang/README.md) document.

### Project structure

The repository has the following structure:

```
├── .github # Pull request and issue templates
├── charts # Charts to install by Helm
├── cmd # Main applications for project
├── config # Configuration file templates or default configs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
├── config # Configuration file templates or default configs
├── config # Configuration file templates or default configurations

├── deploy # Dockerfiles to build images
├── docs # Documentation files
├── hack # Various scripts that are used by Helm Broker developers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
├── hack # Various scripts that are used by Helm Broker developers
├── hack # Scripts used by the Helm Broker developers

├── internal # Private application and library code
├── pkg # Library code to use by external applications
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add also short readme to pkg, similar to this one: https://github.com/kyma-project/helm-broker/tree/master/hack

this folder is quite important and IMO is good to have a clear statement about its purpose

same thing for test folder, so it's dedicated for integrations/e2e etc. do not store there e.g. verify-gofmt.sh script, or sth similar because such thing should be placed under /hack dir.

└── test # Additional external test apps and test data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
└── test # Additional external test apps and test data
└── test # Additional external test applications and test data

```

### Run tests

Before each commit, use the `before-commit.sh` script. The script runs unit tests that check your changes and build binaries. If you want to run the Helm Broker locally, read [this](/docs/run-local.md) document.

You can also run integration tests that check if all parts of the Helm Broker work together.
These are the prerequisites for integration tests:

- [Kubebuilder](https://github.com/kubernetes-sigs/kubebuilder)
- [Etcd](https://github.com/etcd-io/etcd/releases/tag/v3.4.0)
- [Minio](https://min.io/download)
- [Kubebuilder](https://github.com/kubernetes-sigs/kubebuilder) 1.0.8
- [Etcd](https://github.com/etcd-io/etcd#etcd) 3.4
- [Minio](https://min.io/download) RELEASE.2019-10-12T01-39-57Z

Run integration tests using this command:

Expand Down