Connecting to Db2 Warehouse with an OpenShift TLS route

You can set up an OpenShift TLS route to connect to the Db2 Warehouse service on Cloud Pak for Data from a Db2 Warehouse client.

About this task

In order to externally access the Db2 Warehouse database with a supported Db2 Warehouse client (such as a JDBC client), you can use the NodePort. But in cases where the NodePort is not desired, you can edit the service that exposes the NodePort to transform the NodePort back into a ClusterIP. In place, you can define an OpenShift route over the Db2 Warehouse TLS port.

Procedure

The following command creates an OpenShift TLS route with the following settings:
  • Passthrough route
  • insecureEdgeTerminationPolicy set to None
  • Use service c-${DB2UCLUSTER_CR_NAME}-db2u-engn-svc, for example:
    c-db2ucluster-sample-db2u-engn-svc
  • Target port 50001 or label associated with the port ssl-server

Substitute the hostname of the node where the Db2 Warehouse service is running for <hostname> and where <route_name> is any Kubernetes supported object name.

cat << EOF | oc apply -f -
apiVersion: route.openshift.io/v1
kind: Route
metadata:
 name: <route_name>
 labels:
   formation_id: db2ucluster-sample
spec:
 host: <hostname>
 port:
   targetPort: 50001
 tls:
   insecureEdgeTerminationPolicy: None
   termination: passthrough
 to:
   kind: Service
   name: c-db2ucluster-sample-db2u-engn-svc
   weight: 100
 wildcardPolicy: None
EOF