Configuring the Db2 NodePort with an Ingress Controller

If you use an external infrastructure node to route external Db2® traffic into the Red Hat® OpenShift® cluster, the cluster might be in a private zone and you need to configure an external-facing Ingress Controller to route the traffic to the OpenShift nodes.

About this task

Because Db2 is externally exposed through a NodePort, the Ingress Controller also needs to expose the NodePort in order to allow traffic into the cluster.

The configuration below is only applicable with an HAProxy Ingress Controller. For more detail about configuring networking, see Understanding networking in the OpenShift documentation.

Procedure

  1. On the infrastructure node, open the HAProxy configuration file located at /etc/haproxy/haproxy.cfg.
  2. Modify the haproxy.cfg file to include the OpenShift NodePort:
    frontend db2
            bind *:Db2 NodePort
            default_backend db2u
            mode tcp
            option tcplog
    backend db2u
            balance source
            mode tcp
            server master0 Master0-privateIP:Db2 NodePort check
            server master1 Master1-privateIP:Db2 NodePort check
            server master2 Master3-privateIP:Db2 NodePort check
  3. Reload HAProxy:
    systemctl reload haproxy