Apply catalogs and Operators in a disconnected-deployment RHEL for Edge image
After you have created a RHEL for Edge image for a disconnected environment and configured MicroShift networking settings for disconnected use, you can configure the namespace and create catalog and Operator custom resources (CR) for running your Operators.
-
You have a RHEL for Edge image.
-
Networking is configured for disconnected use.
-
You completed the oc-mirror plugin dry run procedure.
-
Create a
CatalogSourcecustom resource (CR), similar to the following example:Examplemy-catalog-source-cr.yamlfileapiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: cs-redhat-operator-index namespace: openshift-marketplace spec: image: registry.example.com/redhat/redhat-operator-index:v4.17 sourceType: grpc displayName: publisher: updateStrategy: registryPoll: interval: 60mwhere:
metadata.namespace-
Specifies the global namespace. Setting the
metadata.namespacetoopenshift-marketplaceenables the catalog to run in all namespaces. Subscriptions in any namespace can reference catalogs created in theopenshift-marketplacenamespace.
The default pod security admission definition for
openshift-marketplaceisbaseline, therefore a catalog source custom resource (CR) created in that namespace does not require aspec.grpcPodConfig.securityContextConfigvalue to be set. You can set alegacyorrestrictedvalue if required for the namespace and Operators you want to use. -
Add the SHA of the catalog index commit to the Catalog Source (CR), similar to the following example:
Example namespacespec.imageconfigurationapiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: cs-redhat-operator-index namespace: openshift-marketplace spec: image: registry.example.com/redhat/redhat-operator-index@sha256:7a76c0880a839035eb6e896d54ebd63668bb37b82040692141ba39ab4c539bc6sourceType: grpc displayName: publisher: updateStrategy: registryPoll: interval: 60m
where:
spec.image-
Specifies the SHA of the image commit. Use the same SHA you added to the image builder blueprint.
You must use the SHA instead of a tag in your catalog CR or the pod fails to start.
-
Apply the YAML file from the oc-mirror plugin dry run results directory to the node by running the following command:
$ oc apply -f ./oc-mirror-workspace/results-1708508014/catalogSource-cs-redhat-operator-index.yamlExample outputcatalogsource.operators.coreos.com/cs-redhat-operator-index created -
Verify that the
CatalogSourceresources were successfully installed by running the following command:$ oc get catalogsource --all-namespaces -
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-operator-index-4227b 2/2 Running 0 2m5s -
Create a
SubscriptionCR, similar to the following example:Examplemy-subscription-cr.yamlfileapiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: amq-broker namespace: openshift-operators spec: channel: 7.11.x name: amq-broker-rhel8 source: cs-redhat-operator-index sourceNamespace: openshift-marketplace -
Apply the
SubscriptionCR by running the following command:$ oc apply -f ./<my-subscription-cr.yaml>where:
<my-subscription-cr.yaml>-
Specifies the name of your
SubscriptionCR, such asmy-subscription-cr.yaml.Example outputsubscription.operators.coreos.com/amq-broker created