From ea41fb968c15407821b3c6e4b18b1e5d9b4d8d6b Mon Sep 17 00:00:00 2001 From: Oleg Bulatov Date: Thu, 22 Jul 2021 15:55:33 +0200 Subject: [PATCH] docs: How to deploy development build --- docs/how-to-deploy-dev-build.md | 64 +++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 docs/how-to-deploy-dev-build.md diff --git a/docs/how-to-deploy-dev-build.md b/docs/how-to-deploy-dev-build.md new file mode 100644 index 000000000..bb25bbebe --- /dev/null +++ b/docs/how-to-deploy-dev-build.md @@ -0,0 +1,64 @@ +# How to deploy development build of image registry + +## Prerequisites + + * An OpenShift cluster. + * Credentials from [the app.ci cluster](https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/). + * A public image repository (for example, you can create a public repository on [quay.io](https://quay.io/)). + +## Logging into the app.ci cluster and its registry + +1. Copy the login command from and run it +2. Rename the context for the `app.ci` cluster + + ``` + oc config rename-context "$(oc config current-context)" app.ci + ``` + +3. Login into the registry `registry.ci.openshift.org` + + ``` + oc --context=app.ci whoami -t | docker login -u unused --password-stdin "$(oc --context=app.ci registry info --public=true)" + ``` + +## Switching the image registry operator into the Unmanaged mode + +1. You'll need to change the image registry deployment manually, so disable the image registry operator + + ``` + oc patch configs.imageregistry cluster --type=merge -p '{"spec":{"managementState":"Unmanaged"}}' + ``` + +## Building and deploying a new container image + +1. Go to the directory with the image registry sources + + ``` + cd ./openshift/image-registry + ``` + +2. Build a new image + + ``` + docker build -f Dockerfile.rhel7 -t quay.io/rh-obulatov/image-registry . + ``` + +3. Push the new image + + ``` + docker push quay.io/rh-obulatov/image-registry + ``` + +4. Deploy the new build + + ``` + oc -n openshift-image-registry set image deploy/image-registry registry="$(docker inspect --format='{{index .RepoDigests 0}}' quay.io/rh-obulatov/image-registry)" + ``` + +5. Wait until the pods use the new image + + ``` + oc -n openshift-image-registry get pods -l docker-registry=default -o custom-columns="NAME:.metadata.name,STATUS:.status.phase,IMAGE:.spec.containers[0].image" + ``` + +6. Enjoy your registry!