Install a custom catalog created with the oc-mirror plugin
After you mirror your image set to the mirror registry, you must apply the generated CatalogSource custom resource (CR) into the node. Operator Lifecycle Manager (OLM) uses the CatalogSource CR to retrieve information about the available Operators in the mirror registry. You must then create and apply a subscription CR to subscribe to your custom catalog.
-
You mirrored the image set to your registry mirror.
-
You added image reference information to the CRI-O container runtime configuration.
-
Apply the catalog source configuration file from the results directory to create the catalog source object by running the following command:
$ oc apply -f ./<v2_workspace>/working-dir/cluster-resources/catalogSource-cs-redhat-catalog.yamlReplace <v2_workspace> with the directory you used to store custom resources for the mirroring process.
Example outputcatalogsource.operators.coreos.com/cs-redhat-catalog created -
For reference, see the following example file:
Example catalog source configuration fileapiVersion: operators.coreos.com/v2alpha1 kind: CatalogSource metadata: name: redhat-catalog namespace: openshift-marketplace spec: sourceType: grpc image: registry.example.com/redhat/redhat-catalog:v4.20 updateStrategy: registryPoll: interval: 60mwhere
metadata.namespace-
Specifies the global namespace. Setting the
metadata.namespacetoopenshift-marketplaceenables the catalog to reference catalogs in all namespaces. Subscriptions in any namespace can reference catalogs created in theopenshift-marketplacenamespace.
-
Verify that the
CatalogSourceresources were successfully installed by running the following command:$ oc get catalogsource --all-namespacesExample outputNAMESPACE NAME DISPLAY TYPE PUBLISHER AGE openshift-marketplace certified-operators Certified Operators grpc Red Hat 37m openshift-marketplace community-operators Community Operators grpc Red Hat 37m openshift-marketplace redhat-marketplace Red Hat Marketplace grpc Red Hat 37m openshift-marketplace redhat-catalog Red Hat Catalog grpc Red Hat 37m -
Verify that the catalog source is running by using the following command:
$ oc get pods -n openshift-marketplaceExample outputNAME READY STATUS RESTARTS AGE cs-redhat-catalog-4227b 2/2 Running 0 2m5s -
Create a
SubscriptionCR, similar to the following example:ExampleSubscriptionCRapiVersion: operators.coreos.com/v2alpha1 kind: Subscription metadata: name: amq-broker namespace: openshift-operators spec: channel: 7.13.x name: amq-broker-rhel9 source: cs-redhat-catalog sourceNamespace: openshift-marketplace -
Apply the Subscription CR configuration by running the following command:
$ oc apply -f ./<subscription_cr.yaml>Specify the name of your subscription in <subscription_cr.yaml>, for example
amq—broker-subscription-cr.yaml.Example outputsubscription.operators.coreos.com/amq-broker created