This doc explains how to setup a development environment so you can get started contributing to Knative Eventing. Also take a look at the development workflow and the test docs.
Once you meet these requirements, you can start the eventing-controller and install a channel provisioner!
Before submitting a PR, see also CONTRIBUTING.md.
You must have the core of Knative running on your cluster.
You must have ko
installed.
The Go tools require that you clone the repository to the
src/github.com/knative/eventing
directory in your
GOPATH
.
To check out this repository:
- Create your own fork of this repo
- Clone it to your machine:
mkdir -p ${GOPATH}/src/github.com/knative
cd ${GOPATH}/src/github.com/knative
git clone [email protected]:${YOUR_GITHUB_USERNAME}/eventing.git
cd eventing
git remote add upstream [email protected]:knative/eventing.git
git remote set-url --push upstream no_push
Adding the upstream
remote sets you up nicely for regularly
syncing your fork.
Once you reach this point you are ready to do a full build and deploy as follows.
Once you've setup your development environment, stand up
Knative Eventing
with:
ko apply -f config/
You can see things running with:
$ kubectl -n knative-eventing get pods
NAME READY STATUS RESTARTS AGE
eventing-controller-59f7969778-4dt7l 1/1 Running 0 2h
You can access the Eventing Controller's logs with:
kubectl -n knative-eventing logs $(kubectl -n knative-eventing get pods -l app=eventing-controller -o name)
You'll need a ClusterChannelProvisioner
installed before you can use any
Channels. Eventing release artifacts include the
in-memory-channel out of the box.
You can install it during development with:
ko apply -f config/provisioners/in-memory-channel/
There are other ClusterChannelProvisioner
implementations available under the
contrib subdirectory, but those likely aren't needed for
development unless you're working on one of them directly.
As you make changes to the code-base, there are two special cases to be aware of:
- If you change a type definition (pkg/apis/), then you must
run
./hack/update-codegen.sh
. - If you change a package's deps (including adding external dep), then you
must run
./hack/update-deps.sh
.
These are both idempotent, and we expect that running these at HEAD
to have no
diffs.
Once the codegen and dependency information is correct, redeploying the controller is simply:
ko apply -f config/controller.yaml
Or you can clean it up completely and start again.
Running tests as you make changes to the code-base is pretty simple. See the test docs.
You can delete Knative Eventing
with:
ko delete -f config/
To access Telemetry see: