![[OpenShift Container Platform]](ngocp.gif)
Installing the IBM MQ Operator using the Red Hat OpenShift CLI
The IBM® MQ Operator can be installed onto Red Hat® OpenShift® using the Operator Hub.
Before you begin
Log into the Red Hat OpenShift command line interface (CLI) using oc login. For these steps, you will need to be a cluster administrator.
Procedure
- Optional:
Create a CatalogSource for the IBM Common Services Operators.
Note:This step applies to releases of IBM MQ Operator 1.5 and earlier. The step adds a separate Common Services catalog. For later releases of the Operator, the Common Services are included in the IBM catalog.
-
Create a YAML file defining the CatalogSource resource.
Create a file called "operator-source-cs.yaml" with the following contents:
apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: opencloud-operators namespace: openshift-marketplace spec: displayName: IBMCS Operators publisher: IBM sourceType: grpc image: icr.io/cpopen/ibm-common-service-catalog:latest updateStrategy: registryPoll: interval: 45m -
Apply the CatalogSource to the server.
oc apply -f operator-source-cs.yaml -n openshift-marketplace
-
Create a YAML file defining the CatalogSource resource.
-
Create a CatalogSource for the IBM Operators
-
Create a YAML file defining the CatalogSource resource
Create a file called "operator-source-ibm.yaml" with the following contents:
apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: ibm-operator-catalog namespace: openshift-marketplace spec: displayName: IBM Operator Catalog image: icr.io/cpopen/ibm-operator-catalog:latest publisher: IBM sourceType: grpc updateStrategy: registryPoll: interval: 45m -
Apply the CatalogSource to the server.
oc apply -f operator-source-ibm.yaml -n openshift-marketplace
-
Create a YAML file defining the CatalogSource resource
-
Create a namespace to use for the IBM MQ Operator
The IBM MQ Operator can be installed scoped to a single namespace or all namespaces. This step is only needed if you want to install into a particular namespace which does not already exist.
oc new-project ibm-mq -
View the list of Operators available to the cluster from the OperatorHub
oc get packagemanifests -n openshift-marketplace -
Inspect the IBM MQ Operator to verify its supported InstallModes and available Channels
oc describe packagemanifests ibm-mq -n openshift-marketplace -
Create an OperatorGroup object YAML file
An OperatorGroup is an OLM resource that selects target namespaces in which to generate required RBAC access for all Operators in the same namespace as the OperatorGroup.
The namespace to which you subscribe the Operator must have an OperatorGroup that matches the Operator's InstallMode, either the AllNamespaces or SingleNamespace mode. If the Operator you intend to install uses the AllNamespaces, then the
openshift-operatorsnamespace already has an appropriate OperatorGroup in place.However, if the Operator uses the SingleNamespace mode and you do not already have an appropriate OperatorGroup in place, you must create one.
-
Create a file called "mq-operator-group.yaml" with the following contents:
apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: <operatorgroup_name> namespace: <namespace_name> spec: targetNamespaces: - <namespace_name> -
Create the OperatorGroup object
oc apply -f mq-operator-group.yaml
-
Create a file called "mq-operator-group.yaml" with the following contents:
-
Create a Subscription object YAML file to subscribe a namespace to the IBM MQ Operator
- Review Version support for the IBM MQ Operator to determine which operator channel to choose.
-
Create a file called "mq-sub.yaml" with the following contents, but changing channel to match the channel for the version of the IBM MQ Operator you want to install.
For AllNamespaces InstallMode usage, specify openshift-operators in the namespace. Otherwise, specify the relevant single namespace for SingleNamespace InstallMode usage. Note you should only change the namespace field, leaving the sourceNamespace field as is.apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: ibm-mq namespace: openshift-operators spec: channel: <ibm-mq-operator-channel> name: ibm-mq source: ibm-operator-catalog sourceNamespace: openshift-marketplace -
Create the Subscription object
oc apply -f mq-sub.yaml
- Check the status of the Operator Once the installation of the Operator has succeeded, the pod status shows as Running. For AllNamespaces InstallMode usage, specify openshift-operators as the namespace. Otherwise, specify the relevant single namespace for SingleNamespace InstallMode usage.
oc get pods -n <namespace_name>