How to upgrade OCP4 in the restricted network ?
I’d like to demonstrate you how to upgrade OCP4.3 cluster from 4.3.0 to 4.3.13 in the restricted network.
Mirror the release images from 4.3.0 to 4.3.13
Before proceeding the following upgrade tasks, as the prerequisites you should sync all the mirror images of the target version v4.3.13 at the client host which can access to both Internet and your private mirror registry.
Refer Creating a mirror registry for installation in a restricted network for more details of the mirroring images.
Change to 4.3.0-x86_64 to 4.3.13-x86_64 before exporting “OCP_RELEASE” variable
$ export OCP_RELEASE=4.3.13-x86_64
Mirror the target version images using ENV variables
$ export LOCAL_REGISTRY='mirror.priv.example.com:5000'
$ export LOCAL_REPOSITORY='ocp4/openshift4'
$ export PRODUCT_REPO='openshift-release-dev'
$ export LOCAL_SECRET_JSON='pull-secret.txt'
$ export RELEASE_NAME="ocp-release"
$ oc adm -a ${LOCAL_SECRET_JSON} release mirror \
--from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE} \
--to=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} \
--to-release-image=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY}:${OCP_RELEASE}
Take a note the digest of your target version release image from the above command output
info: Mirroring 103 images to mirror.priv.example.com:5000/ocp4/openshift4 ...
mirror.priv.example.com:5000/
ocp4/openshift4
manifests:
:
sha256:xxx...xxx -> 4.3.13-x86_64
:
sha256:xxx...xxx mirror.priv.example.com:5000/ocp4/openshift4:4.3.13-x86_64
:
Upgrade OCP4 cluster manually using oc CLI
You can upgrade the following command and options.
oc adm upgrade \
--to-image mirror.priv.example.com:5000/ocp4/openshift4@sha256:xxx...xxx \
--allow-explicit-upgrade \
--force
Progress states in OCP4 Web console during upgrade
Look at the desired image digest, it’s same with above “ — to-image” digest.
You can see progress percentage to complete at the “Cluster Operators” tab.
You can finally upgrade after taking some times, then the “Last Completed Version” will be changed target version, such as “4.3.13” here.
Thank you for reading.