Skip to content
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

Extend contributing.md with more examples #1134

Merged
merged 1 commit into from
Dec 4, 2019
Merged
Changes from all commits
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
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