Configuring your cluster to use the resources generated by oc-mirror plugin v2

After you have mirrored your image set to the mirror registry, you must apply the generated ImageDigestMirrorSet (IDMS), ImageTagMirrorSet (ITMS), CatalogSource, and UpdateService resources to the cluster.

Important

In oc-mirror plugin v2, the IDMS and ITMS files cover the entire image set, unlike the ImageContentSourcePolicy (ICSP) files in oc-mirror plugin v1. Therefore, the IDMS and ITMS files contain all images of the set even if you only add new images during incremental mirroring.

Prerequisites
  • You have access to the cluster as a user with the cluster-admin role.

Procedure
  1. Log in to the OpenShift CLI as a user with the cluster-admin role.

  2. Apply the YAML files from the results directory to the cluster by running the following command:

    $ oc apply -f <path_to_oc_mirror_workspace>/working-dir/cluster-resources
  3. If you mirrored release images, apply the release image signatures to the cluster by running the following command:

    $ oc apply -f working-dir/cluster-resources/signature-configmap.json
    Important

    If you are mirroring Operators instead of clusters, do not run the preceding command. Running the command results in an error because there are no release image signatures to apply.

    Additionally, a YAML file is available in the same directory working-dir/cluster-resources/. You can use either the JSON or YAML format.

Verification
  1. Verify that the ImageDigestMirrorSet resources are successfully installed by running the following command:

    $ oc get imagedigestmirrorset

    To view only the resources created by oc-mirror, run the following command:

    $ oc get imagedigestmirrorset -o jsonpath='{.items[?(@.metadata.annotations.createdBy=="oc-mirror v2")].metadata.name}'
  2. Verify that the ImageTagMirrorSet resources are successfully installed by running the following command:

    $ oc get imagetagmirrorset

    To view only the resources created by oc-mirror, run the following command:

    $ oc get imagetagmirrorset -o jsonpath='{.items[?(@.metadata.annotations.createdBy=="oc-mirror v2")].metadata.name}'
  3. Verify that the CatalogSource resources are successfully installed by running the following command:

    $ oc get catalogsource -n openshift-marketplace

    To view only the resources created by oc-mirror, run the following command:

    $ oc get catalogsource -o jsonpath='{.items[?(@.metadata.annotations.createdBy=="oc-mirror v2")].metadata.name}'
  4. Verify that the ClusterCatalog resources are successfully installed by running the following command:

    $ oc get clustercatalog

    To view only the resources created by oc-mirror, run the following command:

    $ oc get clustercatalog -o jsonpath='{.items[?(@.metadata.annotations.createdBy=="oc-mirror v2")].metadata.name}'