Installing the Operators by using command-line interface (CLI)

Install the Operators by using any of the command-line interface tools, oc or kubectl.

Procedure

Note: In the following procedure, oc commands are used. The oc commands are interchangeable with kubectl. If you are connected to a Kubernetes cluster, ensure that you replace the oc commands with kubectl counterparts.

  1. Log in to the Red Hat® OpenShift® Container Platform or Kubernetes cluster. Ensure that you run the oc cluster-info sub-command to verify that the correct cluster information is displayed.
  2. If you are using a Kubernetes cluster, create an OperatorGroup for the required scope (cluster or one or more namespaces), by completing the following steps. For Red Hat OpenShift Container Platform cluster, an OperatorGroup is not required.
    An OperatorGroup is a resource that helps in managing the scope of an Operator and controlling namespaces that the Operator should watch and manage resources of.
    1. Create an operator group YAML file for the required scope as shown in the following sample snippets.
      # Install the Operator group with cluster scope, so that it monitors the change in resources like catalog source, subscription across all the namespaces in the cluster.
      apiVersion: operators.coreos.com/v1
      kind: OperatorGroup
      metadata:
        name: sip-operator-global
        namespace: <any_namespace> 
      spec: {}
      
      # Install the Operator group with namespace scope, so that it monitors the change in resources like subscription in only those namespaces that are mentioned in the cluster.
      apiVersion: operators.coreos.com/v1
      kind: OperatorGroup
      metadata:
        name: sip-operator-local
        namespace: <any_namespace>
      spec:
        # Provide one namespace or none for cluster wide) which will be monitored by the operator.
        targetNamespaces:
        - <target_namespace1>  
      
    2. Run the following command to create the operator group.
      oc create -f <operator_group>.yaml -n <sip_installation_namespace>
  3. Create a Subscription YAML.
    A Subscription is created to subscribe to a particular Operator from a CatalogSource, by specifying details such as the name of the Operator, the source (CatalogSource), the channel to subscribe to, and the target namespace.
    1. Configure the YAML as shown in the following sample snippet:
      For OMS Gateway Operator:
      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        name: <subscription_name>
        namespace: <sip_installation_namespace>
      spec:
        channel: v1.0
        installPlanApproval: <plan_approval>
        name: ibm-oms-gateway
        source: ibm-oms-gateway-catalog
        sourceNamespace: <catalog_source_namespace>
        startingCSV: ibm-oms-gateway.<version>

      For the IBM® Sterling Intelligent Promising Operator:

      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        name: <subscription_name>
        namespace: <sip_installation_namespace>
      spec:
        channel: v1.0
        installPlanApproval: <plan_approval>
        name: ibm-sip
        source: ibm-sip-catalog
        sourceNamespace: <catalog_source_namespace>
        startingCSV: ibm-sip.<version>
      • If you want to use the IBM Operator Catalog, ensure that the source name matches the metadata name that is provided for the catalog source, which is ibm-sip-catalog in the given example.
      • Set <plan_approval> to either Manual or Automatic. If the approval strategy is Automatic, the upgrade process is initiated as soon as a new Operator version is available in the selected channel. If the approval strategy is Manual, you must manually approve a pending upgrade.
      • Set <catalog_source_namespace> to the namespace where the catalog source is present.
      • Set <package> to enterprise.
      • Set <version> of the Operator that you want to install. For example, v1.0.10.
    2. Run the following command to create the subscription:
      oc create -f Subscription.yaml -n <sip_installation_namespace>
  4. View the Operator installation status by running the following command:
    oc describe sub <subscription_name> -n <sip_installation_namespace>
    Once the Operator installation is successful, ensure that the ibm-sip-controller-manager and ibm-oms-gateway-controller-manager pods are running in the same namespace that you selected.
  5. View the version of the installed OMS Gateway Operator by running the following command:
    oc get sub <subscription_name> -o jsonpath=“{.status.installedCSV}” -n <sip_installation_namespace>