Skip to content

Commit 5fa2fd1

Browse files
committed
Document steps to build and run CVO locally
Document instructions to build and run the CVO executable locally,for example on your development laptop, allowing a "quick-turn" test capability.
1 parent cb8241a commit 5fa2fd1

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

docs/dev/run-cvo-locally.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# How to Build and Run CVO Locally
2+
3+
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.
4+
5+
## Preconditions
6+
7+
Build the CVO executable using the standard procedure:
8+
9+
```console
10+
$ cd ~/go/src/github.com/openshift/cluster-version-operator
11+
$ make
12+
```
13+
14+
Start an OCP cluster of the appropriate version. One that is compatiable with the version of CVO with which you're working.
15+
16+
Login to the cluster using `oc`.
17+
18+
Extract and download the OCP cluster release:
19+
20+
```console
21+
$ oc image extract -a ~/pull-secret-internal quay.io/openshift-release-dev/ocp-release:4.4.0-rc.4-x86_64 --path /:/tmp/release/
22+
```
23+
24+
## Steps to Run CVO Locally
25+
26+
Scale down the CVO pod on the cluster:
27+
28+
```console
29+
$ oc scale --replicas=0 deployment.apps/cluster-version-operator -n openshift-cluster-version
30+
```
31+
32+
Set the following environment variables used by CVO:
33+
34+
```console
35+
# Set to anything
36+
$ export NODE_NAME=foobar
37+
38+
# Set to release extracted above
39+
$ export PAYLOAD_OVERRIDE=/tmp/release/
40+
41+
Run the CVO executable specifying `start`, the appropriate release image and, optionally, logging verbosity:
42+
43+
```console
44+
$ ./_output/linux/amd64/cluster-version-operator -v5 start --release-image 4.4.0-rc.4
45+
```
46+
47+
## Limitations
48+
49+
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.

0 commit comments

Comments
 (0)