Skip to content

Instantly share code, notes, and snippets.

@dougbtv
Created October 15, 2019 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dougbtv/487ef1ba1f0daa51712be6b4f9eedcdb to your computer and use it in GitHub Desktop.
Save dougbtv/487ef1ba1f0daa51712be6b4f9eedcdb to your computer and use it in GitHub Desktop.
Running the cluster network operator against a running openshift cluster

Interactively running the cluster-network-operator

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.

Basic setup

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/

Running interactively...

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment