Skip to content

Commit

Permalink
Extend contributing.md with more examples (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
alenkacz authored Dec 4, 2019
1 parent f873094 commit a691658
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,24 @@ Please see [https://git.k8s.io/community/CLA.md](https://git.k8s.io/community/CL
- Get the KUDO repo: `git clone https://github.com/kudobuilder/kudo.git`
- `cd kudo`
- Export `GOPATH` (this is necessary because of an issue in [codegenerator](https://github.com/kubernetes/code-generator/issues/87))
- `make all` to build project
- [optionally] `make docker-build` to build the Docker images
- `make all` to build manager as well as CLI
- [optionally] `make docker-build` to build the manager Docker images

When updating the structs under [APIs](https://github.com/kudobuilder/kudo/blob/master/pkg/apis/), or any other code generated item, use `make generate` to generate the new DeepCopy structs. Use `make manifests` to generate out new YAML manifests representing these CRDs.
When updating the structs under [APIs](https://github.com/kudobuilder/kudo/blob/master/pkg/apis/), or any other code generated item, use `make generate` to generate the new DeepCopy structs.

After updating CRD manifests, use `make deploy` to apply the new CRDs to your cluster.
#### Running manager locally
The most convenient way to test new controller code is to run the manager locally. It will use kubernetes cluster defined via your local kubeconfig to talk to API server and resolve CRDs. You can run manager locally via `make run`.

Make sure your local cluster has up to date CRDs. You can deploy new CRDs with `make deploy`. Beware that `make deploy` also deploys manager into your cluster (`kubectl get deployments -n kudo-system`) and it will be the latest stable manager, not the one from your current git. If you plan to run your own manager, just delete the one in your cluster via `kubectl delete deployment kudo-controller-manager -n kudo-system`

#### Testing new CLI
You can build CLI locally via `make cli`. After running that command, CLI will be available in `bin/kubectl-kudo` and you can invoke the command for example like this `bin/kubectl-kudo init` (no need to install it as kubectl plugin).

#### Running new manager inside cluster
For some situations, it might make sense to test your manager inside a real cluster running in a pod (not just running the binary locally). To do that you need:
- build a docker image with the manager locally `DOCKER_IMG=nameofyourimage make docker-build`
- push the image to a remote repository `DOCKER_IMG=nameofyourimage make docker-push`
- run `kubectl kudo init --kudo-image nameofyourimage:tag`

### Testing

Expand Down

0 comments on commit a691658

Please sign in to comment.