IBM Developer

Tutorial

Deploying Sterling Order Management v10 on Red Hat OpenShift Local v4.x

Running Sterling Order Management software v10 on a stand-alone Red Hat OpenShift server with Red Hat OpenShift Local (formerly Red Hat CodeReady Containers)

By Shoeb Bihari, Chiranjeevi Dasegowda

IBM Sterling Order Management System is the backbone of supply chain and commerce initiatives for large enterprises around the world. The product provides a robust platform that is designed to provide B2C and B2B organizations the power to innovate, differentiate, and drive their omnichannel businesses with less overhead. This rapid pace of innovation drives a lot of effort in deployment and automation practices. Tools such as Docker and Kubernetes bring exceptional speed and value to these enterprises to achieve their engineering excellence.

The Red Hat OpenShift Container Platform is a commercial offering of Kubernetes that provides a robust, portable, compliant, and rich ecosystem of open source and certified content of tools that enable you to complete the lifecycle management of production instances.

The Sterling Order Management certified containers have enhanced the deployment experience with an Operator that is designed for modernizing your enterprise application landscape in a hybrid cloud platform that spans public, private, and in-datacenter clouds. The operators are available on the IBM Operator Catalog for Red Hat OpenShift as IBM Sterling Order Management Professional and Enterprise editions. The Sterling Order Management Operator follows the Kubernetes Operator paradigm to simplify the management of the Sterling Order Management ecosystem by using purpose-driven Custom Resources (CRs). A primary CR named "OMEnvironment" is introduced to act as a single window of configuration for setting up a Sterling Order Management ecosystem. All of the necessary configurations such as images, storage, database, network policy, JVM parameters, and customer overrides are accepted through the CR to set up a fully functional integrated Sterling Order Management environment.

  • The Red Hat OpenShift Local brings a minimal Red Hat OpenShift Container Platform cluster and Podman container runtime to your local computer. These runtimes provide minimal environments for development and testing purposes. The Red Hat OpenShift Local is mainly targeted at running on the developers' desktops.
  • The Red Hat OpenShift Local cluster and samples provided in this tutorial are for development and testing purposes only. Do not use it for production.
  • For Sterling Order Management production deployment, see the documentation website.
  • For Sterling Order Management v10-compatible databases and other supported software, see the compatibility report.

Learning objectives

This tutorial demonstrates how you can deploy Sterling Order Management Enterprise and a dependent stack (IBM Db2 and MQ) through the Operator on a desktop machine by using a Red Hat OpenShift server with Red Hat OpenShift Local (formerly Red Hat CodeReady Containers).

Prerequisites

The CodeReady Containers support native hypervisors for Linux®, macOS, and Windows™ 10 operating systems. You can download the CodeReady Containers (CRC) from the Red Hat site, and use it for free. You must sign up for Red Hat Developers to gain access to the code. When you use Red Hat Enterprise Linux, the machine that runs Red Hat OpenShift Local must be registered with the Red Hat Customer Portal.

For the purposes of portability and workload isolation, we deployed using a virtual machine that runs Linux (REHL 8.6) as the CRC host, but this also works on Windows and macOS. For OS requirements, see Operating system requirements. Follow the guidelines for using CRC on your chosen platform. When you download and install CRC, follow the instructions carefully, and place the downloaded pull secret file in your home directory. You will need it when you create a new CRC instance.

Before you begin, download the sample files referenced in this tutorial.

Hardware requirements

  • 100 GB+ of storage (The default, 35 GB will work, but you might run out of space quickly.)
  • 24 GB+ of memory (preferably 32+)
  • 8 available virtual CPUs (preferably 16)

Stack used for demonstration purpose

  • OS version: Red Hat Enterprise Linux release 8.7 (Ootpa)
  • CRC version: 2.15.0+cc05160
  • OMS operator version, image: 10.0.2209.0-amd64
  • Db2 version: s11.5.8.0
  • MQ version: 9.3.1.1-r1

  • For Sterling Order Management v10-compatible databases and other supported software, see the compatibility report.

Estimated time

This tutorial should take a few hours to complete.

Steps

Step 1. Installing Red Hat CodeReady Containers

Before you begin, deploy your Red Hat OpenShift CRC environment. Typically, it is a best practice to update your CRC environment regularly to keep up with the monthly release cycle.

  1. Set up the OS prequisites and prepare for installation.

    a. Install and enable the Network Manager.

    yum update
    yum install NetworkManager
    systemctl start NetworkManager
    

    b. Create a non-root user.

    useradd -m ibmadmin
    usermod -a -G wheel ibmadmin
    passwd ibmadmin
    

    c. ssh into VM by using non-root users. (You can skip this step if you are using your local desktop.)

    ssh ibmadmin@<server host/ip>
    

    d. Browse to the user home directory, and set up "crc" for installation.

    cd /home/ibmadmin
    mkdir ~/bin
    wget https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz
    tar xf crc-linux-amd64.tar.xz
    cp crc-linux-*-amd64/crc ~/bin
    export PATH=$PATH:$HOME/bin
    echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc
    

    e. Download the pull secret file from the Red Hat Console.

    f. After the setup is complete, add the required configurations by running the oc config set config_name value command.

    crc config set cpus 16
    crc config set memory 36836
    crc config set disk-size 200
    crc config set enable-cluster-monitoring true
    crc config set pull-secret-file <qualified pull secret file>
    crc config set skip-check-daemon-systemd-sockets true
    crc config set skip-check-daemon-systemd-unit true
    crc config set consent-telemetry no
    

    g. List the "crc" config to confirm the setup.

    crc config view
    

    The following code shows the expected output.

    [ibmadmin@omcrc1 bin]$ crc config view
    - consent-telemetry                                   : no
    - cpus                                                             : 16
    - disk-size                                                      : 200
    - enable-cluster-monitoring                      : true
    - memory                                                        : 36836
    - pull-secret-file                                            : /home/ibmadmin/pull-secret.txt
    - skip-check-daemon-systemd-sockets  : true
    - skip-check-daemon-systemd-unit         : true
    
  2. After CRC is installed, run the following command.

    crc setup
    
  3. Start the system by running the following command.

    crc start
    

    The following code shows the expected output.

    INFO Checking if running as non-root              
    ...
    Started the OpenShift cluster.
    The server is accessible via web console at:
      https://console-openshift-console.apps-crc.testing
    Log in as administrator:
      Username: kubeadmin
      Password: **********
    Log in as user:
      Username: developer
      Password: *********
    Use the 'oc' command line interface:
      $ eval $(crc oc-env)
      $ oc login -u developer https://api.crc.testing:6443
    

When started, access the Red Hat OpenShift web console by using https://console-openshift-console.apps-crc.testing from your local machine. If you are using Linux VM, then follow Step 2.

Step 2. Accessing CodeReady Containers on a remote server (Optional)

Note: You can skip this step, if you are using your local desktop.

After you complete Step 1, the CRC is successfully installed. As the CRC is deployed on a virtual machine, you need a way to get to that VM from any other machine on the home network. The following steps describe how to configure HAProxy on the host machine to allow access to the CRC from elsewhere on the network.

  1. Complete configuring the Host Machine (Configuring the Firewall, Configuring HA Proxy) step.

    Note: The sample haproxy.cfg file is attached. Before using this file, make sure to replace the SERVER_IP with the host IP, and CRC_IP with the CRC IP as discussed in the referenced document.

  2. Update "/etc/hosts" of your Windows or Mac server.

    <Public SERVER_IP> console-openshift-console.apps-crc.testing
    <Public SERVER_IP> api.crc.testing
    <Public SERVER_IP> oauth-openshift.apps-crc.testing
    <Public SERVER_IP> apps-oms.console-openshift-console.apps-crc.testing
    <Public SERVER_IP> orderhub-oms.console-openshift-console.apps-crc.testing
    <Public SERVER_IP> orderservice-oms.console-openshift-console.apps-crc.testing
    <Public SERVER_IP> server1-oms.console-openshift-console.apps-crc.testing
    

    Post the changes and access the Red Hat OpenShift web console by using https://console-openshift-console.apps-crc.testing from the remote machine.

Step 3. Enabling the IBM Operator catalog

  1. From the command prompt, log on to your Red Hat OpenShift cluster by using the oc login command.

    eval $(crc oc-env)
    oc login -u kubeadmin https://api.crc.testing:6443
    
  2. Create the catalog_source.yaml file, browse to the folder where the catalog_source.yaml file exists, and run the following command.

    oc apply -f catalog_source.yaml -n openshift-marketplace
    
  3. Verify the installation by running the following command.

    oc get CatalogSources ibm-operator-catalog -n openshift-marketplace
    

    If the installation is successful, you should see output that is similar to the following.

    NAME                   DISPLAY                 TYPE   PUBLISHER      AGE
    ibm-operator-catalog   IBM Operator Catalog    grpc   IBM            50s
    
  4. View the list of Operators that are available to the cluster from the OperatorHub.

    oc get packagemanifests -n openshift-marketplace | grep -E '(ibm-oms|ibm-db2oltp|ibm-mq)'
    

    You should see the IBM Sterling Order Management, IBM MQ, and IBM Db2 Operator Catalog Source in this list. For example,

    ibmadmin@eggnog1 bin]$ oc get packagemanifests -n openshift-marketplace | grep -E '(ibm-oms|ibm-db2oltp|ibm-mq)'
    ibm-oms-ent                                          IBM Operator Catalog   40s
    ibm-db2oltp-cp4d-operator                            IBM Operator Catalog   40s
    ibm-oms-pro                                          IBM Operator Catalog   40s
    ibm-mq                                               IBM Operator Catalog   40s
    [ibmadmin@eggnog1 bin]$
    
  5. Create a project in which you want to deploy Sterling Order Management and the dependency stack (Db2, IBM MQ, and so on) by using the console from the Home menu or from the command prompt by running the following command.

    oc new-project oms
    
  6. Export the entitlement key.

    An image pull secret named ibm-entitlement-key must be created with the IBM entitlement registry credentials in the namespace (project) where you are configuring OMEnvironment. For more information, see the corresponding documentation.

    a. Go to https://myibm.ibm.com/products-services/containerlibrary and copy your entitlement key.

    c. Export the entitlement key and namespace variables.

    export ENTITLEDKEY="<Entitlement Key from MyIBM> "
    export NAMESPACE="<project or Namespace Name for OMS deployment>"
    

    b. Create ibm-entitlement-key under the oms (namespace) project by running the following command.

    oc create secret docker-registry ibm-entitlement-key   \
        --docker-server=cp.icr.io                   \
        --docker-username=cp                        \
        --docker-password=${ENTITLEDKEY}            \
        --namespace=${NAMESPACE}
    

    Note: The Operator is from open registry. However, most container images are commercial. Contact your IT or Enterprise Administrator to get access to the entitlement key.

Step 4. Install IBM Sterling Order Management, IBM Db2, and IBM MQ operator catalog

  1. Log on to the Red Hat OpenShift Container Platform web console.

  2. Open the Red Hat OpenShift Operator Hub on the left-hand side of your console, and go to the IBM Operator Catalog. Click the edition that you are entitled to IBM Sterling Order Management Enterprise Edition/IBM Sterling Order Management Professional Edition, and click Install.

    Installing

  3. Go back to the Red Hat OpenShift Operator Hub on the left-hand side of your console, go to the IBM Operator Catalog, and install IBM Db2 and IBM MQ.

    a. Click IBM Db2, and click Install. b. Click IBM MQ, and click Install.

    Note: Ensure that you install all three operators under the "oms" namespace.

  4. Go to Operators > Installed Operators, and select the oms Project. You can view all three operators that are installed, and in succeeded status for further deployment.

    Viewing installed operators

Step 5. Create a Storage Class

A sample storage_class.yaml file is provided.

oc apply -f storage_class.yaml

Step 6. Create Persistent volume claims for the storage

Required storage:

PVC Recommended Size Purpose
oms-pvc 10 GB OMS shared storage for logs and configuration files.
oms-pvc-ordserv 20 GB Order Service storage, for Elasticsearch and Cassandra.

A sample "oms-pvc.yaml" is shared.

oc apply -f oms-pvc.yaml

Note: We use the crc-csi-hostpath-provisioner1 storage class (created in Step 5) to dynamically provision the persistent volume (PV).

Step 7. Create and configure the database (IBM Db2) instance

  1. From the command prompt, log on to your Red Hat OpenShift cluster by running the oc login command.

    eval $(crc oc-env)
    oc login -u kubeadmin https://api.crc.testing:6443
    
  2. Run the following command:

    oc apply -f db2_setup.yaml -n oms
    
  3. Verify the database creation by running the following command.

    oc get Db2uCluster -n oms
    

    If it is successful, you should see the output that is similar to the following code.

    NAME       STATE   MAINTENANCESTATE   AGE
    db2inst1   Ready   None               40d
    
  4. Run the db2u container by running the following command.

    oc exec -it c-db2inst1-db2u-0 bash
    
  5. Run the following commands to prepare the database for Sterling Order Management deployment.

    su db2inst1
    db2 connect to omdb
    db2 CREATE BUFFERPOOL OMS32K_BP IMMEDIATE SIZE AUTOMATIC PAGESIZE 32k
    db2 CREATE BUFFERPOOL OMS_TMP_32K_BP IMMEDIATE SIZE AUTOMATIC PAGESIZE 32k
    db2 CREATE TABLESPACE OMS_32K_TS PAGESIZE 32k MANAGED BY AUTOMATIC STORAGE BUFFERPOOL OMS32K_BP
    db2 CREATE TEMPORARY TABLESPACE OMS_TMP_32K_TS PAGESIZE 32k MANAGED BY AUTOMATIC STORAGE BUFFERPOOL OMS_TMP_32K_BP
    db2 GRANT USE OF TABLESPACE OMS_32K_TS to public
    

    Note: The database hostname will be service-name.namespace.svc.cluster.local. For example:

    c-db2inst1-db2u.oms.svc.cluster.local

    Database service:

    Command: oc get service -n oms

    NAME TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)     AGE
    service/c-db2inst1-db2u                                    ClusterIP   10.217.5.14    <none>        50000/TCP,50001/TCP,25000/TCP,25001/TCP,25002/TCP,25003/TCP,25004/TCP,25005/TCP   40d
    

Step 8. Create and configure the queue manager (IBM MQ) instance

  1. Run the following command to create and configure the queue manager.

    oc apply -f mqsc_config.yaml -n oms
    oc apply -f qmgr_setup.yaml -n oms
    
  2. Verify the status of the queue manager by running the following command.

    oc get queuemanager.mq.ibm.com/qmgr  -n oms
    

    After the setup is complete, you should see the output that is similar to the following code.

       NAME     PHASE
       omqmgr   Running
    

    Note: IBM MQ hostname will be "service-name.namespace.svc.cluster.local". For example:

    qmgr-ibm-mq.oms.svc.cluster.local

    IBM MQ Service:

    Command: oc get service -n oms

    NAME                                                       TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                                                                           AGE
    service/qmgr-ibm-mq                                      ClusterIP   10.217.5.244   <none>        1414/TCP                                                                          40d
    

Step 9. Create OMS environment and load initial data

  1. Run the following command to add OMS secrete (oms-secret).

    oc apply -f oms-secret.yaml -n oms
    
  2. Run the following command to add the MQ bindings file (oms-bindings).

    Note: Before you run this command, make sure to replace the mq server host, if it's different from step 3.6.

    oc apply -f oms-bindings.yaml -n oms
    
  3. Run the following command to deploy Sterling Order Management Environment by using YAML.

    oc apply -f om-environment.yaml -n oms
    

Note: dataManagement.mode: create is needed only during the initial data load. You can delete the parameter or set it to the upgrade mode in the OMEnvironment post set up.

When completed, you should be able to view the output that is similar to the following image.

Check the status in the Red Hat OpenShift web console.

Status check

Step 10. Define the Order Service agent servers in Sterling Order Management

Note: For this tutorial, we only start the SSIDelayedSyncOSServer server. Before you proceed to the next step, ensure to configure the SSIDelayedSyncOSServer server in Sterling Order Management. For more information, see SSI delayed sync agent.

Step 11. Start the Order Service agent servers

  1. Launch the Red Hat OpenShift console home page.
  2. Click the + icon (available on the right-hand top menu), and enter the sample provided in om-server.yaml.
  3. Click Create.

This brings up the SSIDelayedSync agent server pod.

Step 12: Set up data in Sterling Order Management and validate

Go to the Networking > Routes screen, and view all the routes of the applications that are deployed.

image

Application URLs:

Summary

Now, you have successfully deployed IBM Order Management using Operators. You are able to access all the applications, including Order Service.

Additional resources