Installing the IBM MQ Operator using the OpenShift CLI
The IBM MQ Operator can be installed onto OpenShift using the Operator Hub.
Before starting
Log into the OpenShift command line interface (CLI) using oc login. For these steps, we will need to be a cluster administrator.
Procedure
-
Create an OperatorSource for the IBM Common Services operators
-
Create a YAML file defining the OperatorSource 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: docker.io/ibmcom/ibm-common-service-catalog:latest updateStrategy: registryPoll: interval: 45m
-
Apply the OperatorSource to the server.
oc apply -f operator-source-cs.yaml -n openshift-marketplace
-
Create a YAML file defining the OperatorSource resource
Create a file called "operator-source-cs.yaml" with the following contents:
-
Create an OperatorSource for the IBM operators
-
Create a YAML file defining the OperatorSource 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 publisher: IBM Content sourceType: grpc image: docker.io/ibmcom/ibm-operator-catalog updateStrategy: registryPoll: interval: 45m
-
Apply the OperatorSource to the server.
oc apply -f operator-source-ibm.yaml -n openshift-marketplace
-
Create a YAML file defining the OperatorSource resource
Create a file called "operator-source-ibm.yaml" with the following contents:
-
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 we 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-operators namespace already has an appropriate OperatorGroup in place.
However, if the Operator uses the SingleNamespace mode and we do not already have an appropriate OperatorGroup in place, 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> spec: targetNamespaces: - <namespace>
-
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 MQ Operator
-
Create a file called "mq-sub.yaml" with the following contents:
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: ibm-mq namespace: openshift-operators spec: channel: v1.0 name: ibm-mq source: ibm-operator-catalog sourceNamespace: openshift-marketplace
For AllNamespaces InstallMode usage, specify the openshift-operators namespace. Otherwise, specify the relevant single namespace for SingleNamespace InstallMode usage. -
Create the Subscription object
oc apply -f mq-sub.yaml
-
Create a file called "mq-sub.yaml" with the following contents: