Using a sandbox instance

You can connect client applications to a sandbox instance for development and testing. Depending on how the cluster administrator has directed you to create the Service and on details of the cluster setup, the ports to be used vary.

After you create a sandbox instance, it is visible in Red Hat® OpenShift® or Kubernetes as a WaziSandboxSystem object and can be queried or manipulated from the command line like any Kubernetes object. An example is shown as below.

$ oc get wazisandboxsystems
NAME          AGE
sample-adcd   36m

Each sandbox instance creates one or more Service resources that have a name similar to the name of the sandbox. Depending on the configuration of the portProfiles, zPorts, and service configuration parameters, the created services vary. But all the created services are labeled with app.kubernetes.io/name=ibm-wazi-developer-sandbox-system and app.kubernetes.io/instance where the value is the name of the sandbox instance.

For example, for an instance named sample, the following services might be created:

  • A ClusterIP service named the same as the sandbox instance, sample
  • A NodePort service named with the name of the instance followed by -nodeport, for instance, sample-nodeport. The name might be truncated if the name is too long.
  • A NodePort service created by the deprecated service parameter, named svc- and the name of the instance, for instance, svc-sample. The name might be truncated if the name is too long.

Each service has the label app.kubernetes.io/instance=sample.

One or more Route resources might also be created, which have the name of the instance followed by the name of the port that the route connects to. For example, sample-rse-api. The name might be truncated.

You can get the information in the Red Hat OpenShift web console by the Developer perspective.

  1. Select Developer, and click Topology.
    Topology
  2. Click the deployment for the Sandbox.

    Sandbox deployment
  3. Use one of the following methods to connect to the sandbox instance:
    • From another Pod in the cluster to a port in the ClusterIP service: easy.

      Use the service name (possibly qualified with namespace if you are connecting from a different namespace), or Cluster IP and the port that are shown in the deployment to connect. For example, if you use CodeReady Workspaces, you can use this method.

    • Externally via a Route: relatively easy.

      Use the Location that is shown in the deployment and port 443. If developers use Zowe™ from their own computer with zosmf or rse-api profiles, they can use this method. For more information about the connection, see Example: Connecting to a sandbox instance.

    • Externally via NodePort.

      Click the Resources, and click the link for the named service.

      The following sample shows the information of a NodePort type Service.

      $ oc describe service sample-adcd-nodeport
      Name:                     sample-adcd-nodeport
      Namespace:                wazi-sandbox
      Labels:                   app.kubernetes.io/instance=sample-adcd
                                app.kubernetes.io/managed-by=ansible
                                app.kubernetes.io/name=ibm-wazi-developer-sandbox-system
                                app.kubernetes.io/part-of=ibm-wazi-developer-sandbox
                                app.kubernetes.io/version=v1.4.0
      Annotations:              <none>
      Selector:                 app.kubernetes.io/instance=sample-adcd,app.kubernetes.io/name=ibm-wazi-developer-sandbox-system
      Type:                     NodePort
      IP:                       172.30.155.88
      Port:                     ssh  22/TCP
      TargetPort:               22/TCP
      NodePort:                 ssh  30459/TCP
      Endpoints:                10.254.12.188:22
      Port:                     local-vtam  3270/TCP
      TargetPort:               3270/TCP
      NodePort:                 local-vtam  30093/TCP
      Endpoints:                10.254.12.188:3270
      Session Affinity:         None
      External Traffic Policy:  Cluster
      Events:                   <none>
      

      In the sample above, the ports on the z/OS® map to the ports that are exposed on the cluster. The name of the port gives a brief description of the function of the port. The Port is the port on z/OS and the NodePort shows the port in the cluster. For example, ssh is the secure shell at port 22 on z/OS and is available through the NodePort Service at port 30459.

      The host or IP address to use to connect depends on the type of Service and where the access is from. Inside the cluster, the IP shown above, or the clusterIP in the YAML file for the Service can be used. Outside the cluster, if nodes are directly exposed, or for type: LoadBalancer this same address can be used.

      If the cluster is only exposed through a proxy, the cluster administrator must provide the proxy address to use.

      For more information about the well-known ports that Sandbox can expose, see the tables in the Configuration reference. For specific clients, see their documentation to determine which ports they use.

Example

If you need to connect an IDE client of Wazi Developer to the z/OS instance provisioned by the Sandbox, follow the instructions in the Connecting to a sandbox instance.