Mirroring OpenShift Container Platform images
You must mirror container images onto a mirror registry to update a cluster in a disconnected environment. In connected environments, mirroring images ensures that your clusters run only approved container images that meet your organizational controls for external content.
Your mirror registry must be running at all times while the cluster is running.
The following steps outline the high-level workflow about mirroring images to a mirror registry:
- Install the OpenShift CLI (
oc) on all devices that you use to retrieve and push release images. - Download the registry pull secret and add it to your cluster.
- Choose the appropriate method to mirror your images:
- Method 1: If you use the oc-mirror OpenShift CLI (
oc) plugin:- Install the oc-mirror plugin on all devices that you use to retrieve and push release images.
- Create an image set configuration file for the plugin to use when determining which release images to mirror. You can edit this configuration file later to change which release images that the plugin mirrors.
- Mirror your targeted release images directly to a mirror registry, or to removable media and then to a mirror registry.
- Configure your cluster to use the resources generated by the oc-mirror plugin.
- Repeat these steps as needed to update your mirror registry.
- Method 2: If you use the
oc adm release mirrorcommand:- Set environment variables that correspond to your environment and the release images you want to mirror.
- Mirror your targeted release images directly to a mirror registry, or to removable media and then to a mirror registry.
- Repeat these steps as needed to update your mirror registry.
- Method 1: If you use the oc-mirror OpenShift CLI (
The oc adm release mirror command is deprecated as of OpenShift Container Platform 4.22 and will be removed in a future release.
As an alternative, use the oc-mirror plugin v2.
The oc-mirror plugin offers the following advantages over the oc adm release mirror command:
- Mirrors content other than container images.
- Simplifies updating images in the registry after the initial mirror.
- Automates mirroring the release payload from Quay and builds the latest graph data image for the OpenShift Update Service in disconnected environments.
Mirror resources using the oc-mirror plugin
You can use the oc-mirror OpenShift CLI (oc) plugin to mirror images to a mirror registry in your fully or partially disconnected environments. You must run oc-mirror from a system with internet connectivity to download the required images from the official Red Hat registries.
For more information, see "Mirroring images for a disconnected installation by using the oc-mirror plugin v2".
Additional resources
Mirror images using the oc adm release mirror command
You can use the oc adm release mirror command to mirror images to your mirror registry.
The oc adm release mirror command is deprecated as of OpenShift Container Platform 4.22 and will be removed in a future release.
As an alternative, use the oc-mirror plugin v2.
The requirements for a mirror registry are:
-
You must have a container image registry that supports Docker v2-2 in the location that will host the OpenShift Container Platform cluster, such as Red Hat Quay.
noteIf you use Red Hat Quay, you must use version 3.6 or later with the oc-mirror plugin. If you have an entitlement to Red Hat Quay, see the documentation on "Deploying Red Hat Quay for proof-of-concept purposes" or "Deploying Red Hat Quay by using the Quay Operator". If you need additional information about selecting and installing a registry, contact your sales representative or Red Hat Support.
-
If you do not have an existing solution for a container image registry, see the "Mirror registry for Red Hat OpenShift" in OpenShift Container Platform subscriptions. The mirror registry for Red Hat OpenShift is a small-scale container registry that you can use to mirror OpenShift Container Platform container images in disconnected installations and updates.
Additional resources
- Deploying Red Hat Quay for proof-of-concept purposes
- Deploying Red Hat Quay by using the Quay Operator
- Mirror registry for Red Hat OpenShift