Mirror the images and configure the Red Hat OpenShift cluster
Mirror the images to the target registry that is on your Red Hat® OpenShift® cluster and configure the cluster for your FTM solution.
The following sections describe how to mirror the images and configure the cluster.
Generate the mirror manifests
Use the following steps to generate the mirror manifests.
- Define the
$TARGET_REGISTRY
environment variable. The target registry refers to the registry that the images are mirrored to and that the Red Hat OpenShift cluster can access. Configure the environment variable by running the following command:export TARGET_REGISTRY=target-registry
- Generate the mirror manifests to be used when mirroring from a bastion host. Run the following command:
Theoc ibm-pak generate mirror-manifests \ ${CASE_NAME} ${TARGET_REGISTRY} \ --version ${CASE_VERSION} \ --filter ${IMAGE_GROUP}
--filter
argument can be used to customize which images are mirrored during an air-gapped installation. The filtering can be applied for groups and architectures. The command creates the ~/.ibm-pak/data/mirror directory to store the mirror and catalog files. - Verify that the mirror manifests were generated successfully. You can use the following command to list
all the images that are to be mirrored and the publicly accessible registries where those images are pulled
from:
The output of this command usually has the following parts:oc ibm-pak describe $CASE_NAME --version $CASE_VERSION --list-mirror-images
- Mirroring Details from Source to Target Registry. A connected mirroring path that does not involve an intermediate registry has only this part.
- Mirroring Details from Target to Final Registry.
Mirror the images
Use the following steps to mirror the images from the internet to the air gap registry.
- Mirror the images to the target registry on your cluster by running the
following command on the host that is connected to both the local container registry and the Red Hat OpenShift cluster.
oc image mirror \ -f ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/images-mapping.txt \ --filter-by-os '.*' \ -a $REGISTRY_AUTH_FILE \ --insecure \ --skip-multiple-scopes \ --max-per-registry=1
Based on the number and the size of the images to be mirrored, this mirror command might take a long time. If you are running the command on a remote computer, consider running the command in the background by using
nohup
. By using this method, the mirroring continues even if network connection to your remote computer is lost or you close the connection.
Configure the cluster
Use the following steps to configure the Red Hat OpenShift cluster.
- Log in to the Red Hat OpenShift cluster.
- Update the global image pull secret for your cluster. Your cluster needs to have the proper authentication credentials to pull images from your target registry, which is specified in the image-content-source-policy.yaml file. For more information, see Updating the global cluster pull secret.
- Apply the
imageContentSourcePolicy
manifests to your cluster by running the following command.oc apply -f ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/image-content-source-policy.yaml
- Verify that the
imageContentSourcePolicy
was applied by running the following command.oc get imageContentSourcePolicy
- Verify your cluster node status by running the following
command.
oc get nodes
After the
imageContentsourcePolicy
and global image pull secret are applied, you might see the node status asReady
,Scheduling
, orDisabled
. Wait until all the nodes show aReady
status.