This describes how to run the cluster-network-operator for development purposes, using the ./hack/run-locally.sh
script.
You'll need:
- A recent install of openshift, here's Doug's cheat sheet
- A clone of the cluster-network-operator.
Once that's in place you'll need to know:
- Your cluster installation directory
- Where your
oc
binary is - Where your
kubeconfig
is (likely in the installation dir)
Most of the instructions come from the HACKING.md from the cluster-network-operator.
Specifically the attach mode section.
Firstly, make sure your oc
binary is in your PATH
.
In my case I keep the most recent one in my ~/Downloads
, so I add it to my path with:
export PATH=$PATH:~/Downloads/installer21
You'll also want to set your KUBECONFIG
environment variable to where your kubeconfig is.
export KUBECONFIG=/tmp/ocpinstall/auth/kubeconfig
Then you'll want to set one that's specifically for the CNO, which is:
export CLUSTER_DIR=/tmp/ocpinstall/
First, make sure you do a recent build:
./hack/build-go.sh
Now you can interactively run the CNO with:
./hack/run-locally.sh
It'll attach to an already running cluster and it'll scale down the instances and then launch it locally.