Creating a CICS tutorial workspace in Red Hat OpenShift Dev Spaces

Creating the CICS® tutorial workspace in Red Hat OpenShift Dev Spaces or Red Hat OpenShift Wazi Dev Spaces.

Before you begin

zosConnect-3.0 Applies to zosConnect-3.0.

Containers Applies to z/OS® Connect container deployments.

Complete the following task.

You need:
  • Access to Red Hat OpenShift Dev Spaces (supports z/OS Connect Designer amd64 architecture).
  • A devfile to create z/OS Connect Red Hat OpenShift Dev Spaces. Learn more about devfiles at Opens in new window.Introduction to devfile in Dev Spaces in the Red Hat OpenShift Dev Spaces documentation. The provided sample project has devfiles included.
    Note: When using Red Hat OpenShift Dev Spaces, you do not need to download the z/OS Connect sample projects.

About this task

Note: Where the documentation refers to Red Hat OpenShift Dev Spaces, the instructions can also be applied to Red Hat OpenShift Wazi Dev Spaces.

Red Hat OpenShift Dev Spaces use Kubernetes and containers to provide any member of the development or IT team with a consistent, secure and zero-configuration development environment.

This topic describes how to create a Red Hat OpenShift Dev Spaces workspace for z/OS Connect Designer that uses the z/OS Connect CICS sample API project in GitHub. Opens in new window.https://github.com/zosconnect/sample-cics-api.

The following image gives an architectural overview of using z/OS Connect in Red Hat OpenShift Dev Spaces.
Figure 1. Using z/OS Connect in Red Hat OpenShift Dev Spaces
Using the API project template in Red Hat OpenShift Dev Spaces.

Procedure

  1. Mount the server configuration environment variables into the workspace by using the ConfigMap and Secret object.
    1. In the Red Hat OpenShift cluster, click the A plus icon icon in the navigation bar to create the ConfigMap.

      The Import YAML screen is displayed.

      In the Import YAML screen, copy and paste the following sample code into the blank YAML to create a ConfigMap. Replace the environment variables in the sample code with the environment variables for your environment.

      ConfigMap example,

      kind: ConfigMap
      apiVersion: v1
      metadata:
        name: cics-connection
        namespace: <USER_DEVSPACES_NAMESPACE>
        labels:
          controller.devfile.io/mount-to-devworkspace: 'true'
          controller.devfile.io/watch-configmap: 'true'
        annotations:
          controller.devfile.io/mount-as: env
      data:
        CICS_HOST: <CICS_HOST>
        CICS_PORT: '<CICS_PORT>'

      Where, <USER_DEVSPACES_NAMESPACE> is the namespace in which the Red Hat OpenShift Dev Spaces is hosted for the active user. You can go to https://<openshift_dev_spaces_fqdn>/api/kubernetes/namespace to get your Red Hat OpenShift Dev Spaces user namespace as name. For more information, see Opens in new window.Integrating with OpenShift in the Red Hat OpenShift Dev Spaces documentation.

      ConfigMap data values are accepted only as a string. All number data must be an input within quotations. For example, CICS_PORT : '1234'.

      Click Create. The ConfigMap details page is displayed as a confirmation. This page includes the details of the ConfigMap that you created and also displays a YAML tab, in case you need to create another one.

    2. In the Red Hat OpenShift cluster, click the A plus icon icon in the navigation bar to create a Secret object.

      The Import YAML screen is displayed.

      In the Import YAML screen, copy and paste the following sample code into the blank YAML to create a Secret object. Replace the environment variables in the sample code with the environment variables for your environment.

      Secret object example:

      kind: Secret 
      apiVersion: v1 
      metadata: 
        name: cics-credentials 
        namespace: <USER_DEVSPACES_NAMESPACE> 
        labels: 
          controller.devfile.io/mount-to-devworkspace: 'true' 
          controller.devfile.io/watch-secret: 'true' 
        annotations: 
          controller.devfile.io/mount-as: env 
      stringData: 
        CICS_USER: <CICS_USER> 
        CICS_PASSWORD: '<CICS_PASSWORD>'

      Where, <USER_DEVSPACES_NAMESPACE> is the namespace in which the Red Hat OpenShift Dev Spaces is hosted for the active user. You can go to https://<openshift_dev_spaces_fqdn>/api/kubernetes/namespace to get your Red Hat OpenShift Dev Spaces user namespace as name. For more information, see Opens in new window.Integrating with OpenShift in the Red Hat OpenShift Dev Spaces documentation.

      Secret object data values are accepted only as a string. All number data must be an input within quotations. For example, CICS_PASSWORD : '1234'.

      Click Create. The Secret object details page is displayed as a confirmation. This page includes the details of the Secret that you created and also displays a YAML tab, in case you need to create another one.

    For more information, see Opens in new window.Mounting ConfigMaps and Opens in new window.Mounting Secrets.

  2. Access your Red Hat OpenShift Dev Spaces workspace by clicking the A plus icon icon and select your Red Hat OpenShift Dev Spaces workspace from the drop-down.

    The Create Workspace page is displayed.

    Figure 2. Red Hat OpenShift Dev Spaces Create Workspace page
    Red Hat OpenShift Dev Spaces home page

  3. Use the Import from Git panel to import the forked z/OS Connect CICS sample API project.
    1. In the Git Repo URL field, enter the repository URL for the forked z/OS Connect CICS sample API project. For example,
      https://github.com/<yourAccountName>/sample-cics-api

      Where, <yourAccountname> refers to the account that you used to fork the CICS API project.

      For more information about forking, see Forking the z/OS Connect Designer CICS sample project using Red Hat OpenShift Dev Spaces.

      The Git Repo Options is displayed.

    2. Expand the Git Repo Options menu to enter the repository details.
      Note: The URL example is for the base repository. Replace the repository URL to your forked project.
      Figure 3. Options in the Import from Git panel in the Create Workspace page
      Red Hat OpenShift Dev Spaces Create workspace page
      1. In the Git Branch field, enter the branch of the repository where the devfile is located. For example,
        main
        Note: The Remote Name and the Remote URL are not mandatory fields. The Import from Git function works as expected even when these fields are left blank.
      2. In the Path to Devfile field, enter the relative path to the devfile in the Git repository.
        Note: The devfile required for this z/OS Connect Red Hat OpenShift Dev Spaces tutorial is devfileV2.yaml.
        start/devfileV2.yaml
      The Git repo URL is then constructed. For example,
      https://github.com/<yourAccountName>/sample-cics-api/tree/main?devfilePath=start/devfileV2.yaml
    3. Click Create & Open.
      The workspace starts to initialize. The following image gives you an example of the progress window before the workspace opens.
      Figure 4. Red Hat OpenShift Dev Spaces workspace initialization window
      Red Hat OpenShift Dev Spaces workspace initialization window

      The new Red Hat OpenShift Dev Spaces workspace opens after the initialization is complete.

      Figure 5. Red Hat OpenShift Dev Spaces workspace home page
      Red Hat OpenShift Dev Spaces workspace home page

Results

You successfully created a Red Hat OpenShift Dev Spaces workspace for the z/OS Connect CICS sample API project.

What to do next

Configure IPIC connections to CICS with Red Hat OpenShift Dev Spaces and basic authentication. For more information, see Configuring IP interconnectivity (IPIC) connections to CICS with Red Hat OpenShift Dev Spaces and Basic Authentication.