Chapter 2. Building and mirroring the Red Hat operator catalog

Follow this process on a host that has access to Red Hat registries to create a mirror of those registries.

Prerequisites

  • Run these commands as a cluster administrator.
  • Be aware that mirroring the redhat-operator catalog can take hours to complete, and requires substantial available disk space on the mirror host.

Procedure

  1. Build the catalog for redhat-operators.

    Match the tag of the ose-operator-registry in the --from flag to the major and minor versions of the OpenShift Container Platform cluster (for example, 4.6).

    $ oc adm catalog build --appregistry-org redhat-operators \
      --from=registry.redhat.io/openshift4/ose-operator-registry:v4.6 \
      --to=${MIRROR_REGISTRY_DNS}/olm/redhat-operators:v1 \
      --registry-config=${AUTH_FILE} \
      --filter-by-os="linux/amd64" --insecure
  2. Mirror the catalog for redhat-operators.

    This is a long operation and can take 1-5 hours. Make sure there is 100 GB available disk space on the mirror host.

    $ oc adm catalog mirror ${MIRROR_REGISTRY_DNS}/olm/redhat-operators:v1 \
    ${MIRROR_REGISTRY_DNS} --registry-config=${AUTH_FILE} --insecure
  3. Disable the default OperatorSources by adding disableAllDefaultSources: true to the spec file for the Operator Hub.

    $ oc patch OperatorHub cluster --type json -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'