![[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 command line interface (CLI).
Before you begin
Procedure
- Log into the Red Hat OpenShift command line interface (CLI) using oc login.
- Optional:
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 that does not already exist.
To create a new namespace in the CLI, run the following command:
Where <namespace_name> is the name of the namespace that you want to create.oc create namespace <namespace_name> -
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 - Optional:
Create an OperatorGroup.
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 want to install uses AllNamespaces mode, then the
openshift-operatorsnamespace already has an appropriate OperatorGroup in place, and you can skip this step.If the Operator uses the SingleNamespace mode and you do not already have an appropriate OperatorGroup in place, create one by running the following command:
cat << EOF | oc apply -f - apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: <operatorgroup_name> namespace: <namespace_name> spec: targetNamespaces: - <namespace_name> EOF - Review Version support for the IBM MQ Operator to determine which operator channel to choose.
- Install the operator.
Use the following command, changing <ibm-mq-operator-channel> to match the channel for the version of the IBM MQ Operator you want to install, and changing <namespace_name> to openshift-operators if you are using "AllNamespaces" mode, or to the namespace you want to deploy the IBM MQ Operator to if you are using "SingleNamespace" mode.
cat << EOF | oc apply -f - apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: ibm-mq namespace: <namespace_name> spec: channel: <ibm-mq-operator-channel> installPlanApproval: Automatic name: ibm-mq source: ibm-operator-catalog sourceNamespace: openshift-marketplace EOF - After a few minutes, the operator is installed. Run the following command to verify that
all of the components are in the Succeeded state:
Where <namespace_name> is openshift-operators if you are using "AllNamespaces" mode, or the project (namespace) name if you are using "SingleNamespace" mode.oc get csv -n <namespace_name> | grep ibm-mq