Deploy CICS TG container on OCP

Before you begin
Log in to the OpenShift® command-line interface (CLI) by using oc login. To perform these steps, you need to be a cluster administrator.
This scenario describes the steps that are involved to deploy CICS® TG on an OpenShift Container Platform (OCP) by using the deployment yaml file.
To deploy CICS TG on OCP, as the first step you need to load the CICS TG container image on the OCP container registry. After successfully loading and tagging the image name according to your OCP cluster, deploy the CICS TG image by using the deployment yaml file.
  1. Log in to the OCP cluster and verify the contents of the CICS Transaction Gateway installer package.
    1. Log in to the namespace on OCP cluster.
      oc login -u <username> -p <password> -n <namespace>
    2. Log in to the OCP container registry by using Podman command.
      podman login -u <username> -p <password> <OCP_container_registry_url>
    3. Download the CICS TG Container image.
      tar -xvf <cicstg_tar_file_name>
      After extraction of CICS TG, the installation package contains the following files:
      • ibm-cicstg-container-linux-x86:9.3: CICS TG Container image
      • README.text: Readme file
  2. Load CICS Transaction Gateway container image to OCP registry.
    1. Load IBM® CICS TG docker image into OCP local container registry.
      podman load ibm-cicstg-container-linux-x86:9.3
    2. Verify that the image is loaded into OCP local registry.
      podman images
    3. Tag the image into an OCP container registry-compliant format of your OCP cluster.
      podman tag <image_name>:<image_tag> image-registry.openshift-image- 
      registry.svc:5000/<namespace>/<image_name>:<image_tag>
    4. Push the image to OCP container registry.
      podman push image-registry.openshift-image-registry.svc:5000/<namespace>/<image_name>:<image_tag>
    5. Verify that the image is pushed to OCP registry.
      oc get imagestream -n <namespace>
  3. Deploying CICS Transaction Gateway application on OCP.
    1. To deploy CICS TG container, save the following sample CICS TG deployment yaml as ctcstg_deployment.yaml file by replacing image name, namespace, port details.
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: cicstg-container  
        namespace: default # change according to your namespace
        labels:
          app: cicstg-container
      spec:
        replicas: 2
        selector:
          matchLabels:
            app: cicstg-container
        template:
          metadata:
            labels:
              app: cicstg-container
          spec:
            containers:
            - name: cicstg-container    # change according to your namespace
              image: <image>
              imagePullPolicy: IfNotPresent
              env:
              - name: LICENSE
                value: "accept"
              ports:
              - name: cicstglistener
                containerPort: 2006
      ​
      ---
      kind: Service
      apiVersion: v1
      metadata:
        name: cicstg-container
        namespace: default # change according to your namespace
        labels:
          app: cicstg-container
      spec:
        selector:
          app: cicstg-container
        ports:
        - name: cicstg
          port: 2006
          nodePort: 30443
        type: NodePort
    2. Deploy CICS TG application by applying the configuration from ctcstg_cloud.yaml file.
      oc apply -f ctcstg_deployment.yaml
    3. To verify the deployment of CICS TG pods and service for the CICS TG application.
      oc get deployment cicstg-container
      oc get pods | grep cicstg-container
      oc get service  | grep cicstg-container
      
      The created ReplicaSet from this output ensures that two cicstg pods are running.
    4. Run the "oc logs” command to check the CICS TG logs in running pods.

      For example,

      oc logs cicstg-container-88769df74-6n2bw
  4. Running CICS Transaction Gateway application on Red Hat OpenShift Cluster.

    To verify CICS TG deployments, you can run the CICS TG client EC01 application. You can run the "oc describe pod" command to get the CICS TG Gateway IP address and port number.

    For example,
    oc describe pod cicstg-container-88769df74-6n2bw

    Now run the ECI application with CICS TG pod Node IP address and nodePort number.

    For example,
    java com.ibm.ctg.samples.eci.EciB2 jgate=tcp://< IPAddress > 
    jgateport= < node port number > server=TXAOR1 prog0=EC01 COMMAREAlength=18