[OpenShift Container Platform][IBM Cloud Pak for Integration]

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

This task assumes that you have completed Steps 1-4 of Installing the IBM MQ Operator.

Procedure

  1. Log into the Red Hat OpenShift command line interface (CLI) using oc login.
  2. 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:
    oc create namespace <namespace_name>
    Where <namespace_name> is the name of the namespace that you want to create.
  3. View the list of operators available to the cluster from the OperatorHub:
    oc get packagemanifests -n openshift-marketplace
  4. Inspect the IBM MQ Operator to verify its supported InstallModes and available Channels.
    oc describe packagemanifests ibm-mq -n openshift-marketplace
  5. 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-operators namespace 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
  6. Review Version support for the IBM MQ Operator to determine which operator channel to choose.
  7. 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
  8. After a few minutes, the operator is installed. Run the following command to verify that all of the components are in the Succeeded state:
    oc get csv -n <namespace_name> | grep ibm-mq
    Where <namespace_name> is openshift-operators if you are using "AllNamespaces" mode, or the project (namespace) name if you are using "SingleNamespace" mode.

What to do next

You are now ready to Create the entitlement key secret (step 6 of Installing the IBM MQ Operator).