This doc explains how to setup a development environment so you can get started
contributing
to Knative net-contour
. Also take a look at:
- Create a GitHub account
- Setup GitHub access via SSH
- Install requirements
- Set up your shell environment
- Create and checkout a repo fork
Before submitting a PR, see also CONTRIBUTING.md.
You must install these tools:
go
: The language Knativenet-contour
is built ingit
: For source controldep
: For managing external dependencies.ko
: For development.kubectl
: For managing development environments.
To get started you'll need to set these environment variables (we recommend
adding them to your .bashrc
):
GOPATH
: If you don't have one, simply pick a directory and addexport GOPATH=...
$GOPATH/bin
onPATH
: This is so that tooling installed viago get
will work properly.
.bashrc
example:
export GOPATH="$HOME/go"
export PATH="${PATH}:${GOPATH}/bin"
The Go tools require that you clone the repository to the
src/knative.dev/net-contour
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/knative.dev
cd ${GOPATH}/src/knative.dev
git clone [email protected]:${YOUR_GITHUB_USERNAME}/net-contour.git
cd net-contour
git remote add upstream https://knative.dev/net-contour.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 described below.
If you want to develop locally ensure that you follow the Knative getting started guide or Manually setup serving first.
If you use the konk script to setup your cluster, your cluster will be named knative
.
However, most of the scripts expect it to be the default kind
name. Set the kind cluster
name env export KIND_CLUSTER_NAME=knative
to point to knative
cluster. KO requires a
registry which if you are developing locally you could use export KO_DOCKER_REPO=kind.local
to use the local one on kind. Please see official
KO documentation for more information.
Before deploying the net-contour
controller you will need a properly
configured installation of Contour. We provide a version of this that can be
built from source via:
ko apply -f config/contour
Once you have a knative/serving installation, and an appropriately configured
Contour installation, you can install the net-contour
controller via:
ko apply -f config/
You can configure Serving to use Contour by default with the following command:
kubectl patch configmap/config-network \
--namespace knative-serving \
--type merge \
--patch '{"data":{"ingress.class":"contour.ingress.networking.knative.dev"}}'