mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
113 lines
3.7 KiB
Plaintext
113 lines
3.7 KiB
Plaintext
//Module included in the following assemblies:
|
|
//
|
|
// * microshift_running_apps/microshift_operators/microshift-operators-oc-mirror.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="microshift-oc-mirror-install-catalog-in-node_{context}"]
|
|
= Installing a custom catalog created with the oc-mirror plugin
|
|
|
|
[role="_abstract"]
|
|
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.
|
|
|
|
.Prerequisites
|
|
|
|
* You mirrored the image set to your registry mirror.
|
|
* You added image reference information to the CRI-O container runtime configuration.
|
|
|
|
.Procedure
|
|
|
|
. Apply the catalog source configuration file from the results directory to create the catalog source object by running the following command:
|
|
+
|
|
[source,terminal,subs="+quotes"]
|
|
----
|
|
$ oc apply -f ./_<v2_workspace>_/working-dir/cluster-resources/catalogSource-cs-redhat-catalog.yaml <1>
|
|
----
|
|
<1> Replace _<v2_workspace>_ with the directory you used to store custom resources for the mirroring process.
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
catalogsource.operators.coreos.com/cs-redhat-catalog created
|
|
----
|
|
|
|
. For reference, see the following example file:
|
|
+
|
|
.Example catalog source configuration file
|
|
[source,yaml,subs="+attributes"]
|
|
----
|
|
apiVersion: operators.coreos.com/v2alpha1
|
|
kind: CatalogSource
|
|
metadata:
|
|
name: redhat-catalog
|
|
namespace: openshift-marketplace <1>
|
|
spec:
|
|
sourceType: grpc
|
|
image: registry.example.com/redhat/redhat-catalog:v{ocp-version}
|
|
updateStrategy:
|
|
registryPoll:
|
|
interval: 60m
|
|
----
|
|
<1> Specifies the global namespace. Setting the `metadata.namespace` to `openshift-marketplace` enables the catalog to reference catalogs in all namespaces. Subscriptions in any namespace can reference catalogs created in the `openshift-marketplace` namespace.
|
|
|
|
. Verify that the `CatalogSource` resources were successfully installed by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get catalogsource --all-namespaces
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
NAMESPACE 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:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get pods -n openshift-marketplace
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
NAME READY STATUS RESTARTS AGE
|
|
cs-redhat-catalog-4227b 2/2 Running 0 2m5s
|
|
----
|
|
|
|
. Create a `Subscription` CR, similar to the following example:
|
|
+
|
|
.Example `Subscription` CR
|
|
[source,yaml]
|
|
----
|
|
apiVersion: 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:
|
|
+
|
|
[source,terminal,subs="+quotes"]
|
|
----
|
|
$ oc apply -f ./_<subscription_cr.yaml>_ <1>
|
|
----
|
|
<1> Specify the name of your subscription in _<subscription_cr.yaml>_, for example `amq--broker-subscription-cr.yaml`.
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
subscription.operators.coreos.com/amq-broker created
|
|
----
|