|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * updating/updating-restricted-network-cluster.adoc |
| 4 | + |
| 5 | +[id="update-mirror-repository_{context}"] |
| 6 | += Mirroring the {product-title} image repository |
| 7 | + |
| 8 | +Before you upgrade a cluster on infrastructure that you provision in a restricted network, you must mirror the required container images into that environment. You can also use this procedure in unrestricted networks to ensure your clusters only use container images that have satisfied your organizational controls on external content. |
| 9 | + |
| 10 | +.Procedure |
| 11 | + |
| 12 | +. Review the link:https://access.redhat.com/solutions/4583231[{product-title} upgrade paths] to confirm that there is an upgrade path between your current and intended cluster versions. |
| 13 | + |
| 14 | +. Set the required environment variables: |
| 15 | ++ |
| 16 | +---- |
| 17 | +$ OCP_RELEASE=<release_version> # <1> |
| 18 | +$ LOCAL_REGISTRY='<local_registry_host_name>:<local_registry_host_port>' # <2> |
| 19 | +$ LOCAL_REPOSITORY='<repository_name>' # <3> |
| 20 | +$ PRODUCT_REPO='openshift-release-dev' # <4> |
| 21 | +$ LOCAL_SECRET_JSON='<path_to_pull_secret>' # <5> |
| 22 | +$ RELEASE_NAME='ocp-release' # <6> |
| 23 | +$ ARCHITECTURE=<server_architecture> # <7> |
| 24 | +$ REMOVABLE_MEDIA_PATH=<path> <8> |
| 25 | +---- |
| 26 | +<1> For `<release_version>`, specify the tag that corresponds to the version of {product-title} to which you want to upgrade, such as `4.5.0`. |
| 27 | +<2> For `<local_registry_host_name>`, specify the registry domain name for your mirror |
| 28 | +repository, and for `<local_registry_host_port>`, specify the port that it |
| 29 | +serves content on. |
| 30 | +<3> For `<repository_name>`, specify the name of the repository to create in your |
| 31 | +registry, such as `ocp4/openshift4`. |
| 32 | +<4> The repository to mirror. For a production release, you must specify |
| 33 | +`openshift-release-dev`. |
| 34 | +<5> For `<path_to_pull_secret>`, specify the absolute path to and file name of |
| 35 | +the pull secret for your mirror registry that you created. |
| 36 | +<6> For a production release, you must specify |
| 37 | +`ocp-release`. |
| 38 | +<7> For `<server_architecture>`, specify the architecture of the server, such as `x86_64`. |
| 39 | +<8> For `<path>`, specify the path to the directory to host the mirrored images. |
| 40 | + |
| 41 | +. Review the images and configuration manifests to mirror: |
| 42 | ++ |
| 43 | +---- |
| 44 | +$ oc adm release mirror -a ${LOCAL_SECRET_JSON} --to-dir=${REMOVABLE_MEDIA_PATH}/mirror quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}-${ARCHITECTURE} --dry-run |
| 45 | +---- |
| 46 | +. Mirror the version images to the internal container registry. |
| 47 | +** If your mirror host does not have internet access, take the following actions: |
| 48 | +... Connect the removable media to a system that is connected to the internet. |
| 49 | +... Mirror the images and configuration manifests to a directory on the removable media: |
| 50 | ++ |
| 51 | +---- |
| 52 | +$ oc adm release mirror -a ${LOCAL_SECRET_JSON} --to-dir=${REMOVABLE_MEDIA_PATH}/mirror quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}-${ARCHITECTURE} |
| 53 | +---- |
| 54 | +... Take the media to the restricted network environment and upload the images to the local container registry. |
| 55 | ++ |
| 56 | +---- |
| 57 | +$ oc image mirror -a ${LOCAL_SECRET_JSON} --from-dir=${REMOVABLE_MEDIA_PATH}/mirror 'file://openshift/release:${OCP_RELEASE}*' ${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} |
| 58 | +---- |
| 59 | +** If the local container registry and the cluster are connected to the mirror host, directly push the release images to the local registry and apply the ConfigMap to the cluster by using following command: |
| 60 | ++ |
| 61 | +---- |
| 62 | +$ oc adm release mirror -a ${LOCAL_SECRET_JSON} --from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE}-${ARCHITECTURE} \ |
| 63 | + --to=${LOCAL_REGISTRY}/${LOCAL_REPOSITORY} --apply-release-image-signature |
| 64 | +---- |
| 65 | ++ |
| 66 | +[NOTE] |
| 67 | +==== |
| 68 | +If you include the `--apply-release-image-signature` option, do not create the ConfigMap for image signature verification. |
| 69 | +==== |
0 commit comments