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

Document steps to build and run CVO locally #381

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/dev/run-cvo-locally.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# How to Build and Run CVO Locally

This document provides the instructions to build and run the CVO executable locally. Local execution of CVO, for example executing CVO on your development laptop, allows a "quick-turn" test capability whereby the CVO executable can be quickly rebuilt with changes and launched again without the need of starting a new OCP cluster.

## Preconditions

Build the CVO executable using the standard procedure:

```console
jottofar marked this conversation as resolved.
Show resolved Hide resolved
$ cd ~/go/src/github.com/openshift/cluster-version-operator
$ make
```

Start an OCP cluster of the appropriate version. One that is compatiable with the version of CVO with which you're working.

Login to the cluster using `oc`.

Extract and download the OCP cluster release:

```console
$ oc image extract -a ~/pull-secret-internal quay.io/openshift-release-dev/ocp-release:4.4.0-rc.4-x86_64 --path /:/tmp/release/
```

## Steps to Run CVO Locally

Scale down the CVO pod on the cluster:

```console
$ oc scale --replicas=0 deployment.apps/cluster-version-operator -n openshift-cluster-version
```

Set the following environment variables used by CVO:

```console
# Set to anything
$ export NODE_NAME=foobar

# Set to release extracted above
$ export PAYLOAD_OVERRIDE=/tmp/release/

Run the CVO executable specifying `start`, the appropriate release image and, optionally, logging verbosity:

```console
$ ./_output/linux/amd64/cluster-version-operator -v5 start --release-image 4.4.0-rc.4
```

## Limitations

If the CVO is running locally using a binary it will not be able to handle upgrades since the upgrade process relies on starting another pod that mounts the same hostpath as the original CVO pod.