diff --git a/INSTALLER-HACKING.md b/INSTALLER-HACKING.md index 0dd2c39ef7..3a06e2b856 100644 --- a/INSTALLER-HACKING.md +++ b/INSTALLER-HACKING.md @@ -67,3 +67,42 @@ To reduce memory usage, you can remove some non-essential components from the cl ``` export HACK_MINIMIZE=1 ``` + +### Developing with a local copy of openshift-sdn + +Origin images are difficult to build correctly. If you want to test some binary changes with openshift-sdn, there's an easier way. + +#### One-time setup: +1. Set up your API credentials: + - Log on to https://api.ci.openshift.org/ with your GitHub credentials + - On the top right, click copy login command. Execute it in a terminal + - Execute `oc registry login`, which will install credentials for your local podman and docker clients +2. Create the following dockerfile in your origin repo: +``` +cat < Dockerfile.node-hacking +FROM docker.io/openshift/origin-node:v4.0.0 +COPY _output/local/bin/linux/amd64/openshift-sdn /usr/bin/openshift-sdn +EOF +``` + +#### Building a development sdn image +1. Pick a registry. You can use the Openshift CI one if you are a member of the organization. +``` +export REGISTRY=registry.svc.ci.openshift.org/ +``` + +2. Build the sdn process +``` +make WHAT=./cmd/openshift-sdn +``` + +3. Build and push the node image +``` +podman build -t ${REGISTRY}/origin-node:latest -f Dockerfile.node-hacking . +podman push ${REGISTRY}/origin-node:latest +``` + +4. Follow the steps above, but override the node image reference in step 3. +``` +echo "NODE_IMAGE=${REGISTRY}/origin-node:latest" >> ${CLUSTER_DIR}/env.sh +```