When connecting from within the same project of the OpenShift system
Service resources are used to connect to FEPCluster and FEPPgpool2 from within the same project.
A service resource provides a single endpoint for communicating with containers.
Service resources are created with the following naming conventions.
<FEPCluster name>-primary-svc
<FEPCluster name>-replica-svc
<FEPCluster name>-headless-svc
<FEPPgpool2 name>-feppgpool2-svc
Example of checking service resources of FEPCluster container and FEPpgpool2 container
$ oc get all
Check where the resource type is Service (Begin with "svc/").
You can also check with the oc get svc command. The following is an example.
$ oc get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE <FEPCluster name>-headless-svc ClusterIP None <none> 27500/TCP,25001/TCP 24h <FEPCluster name>-primary-svc ClusterIP xxx.xxx.xxx.xxx <none> 27500/TCP,25001/TCP 24h <FEPCluster name>-replica-svc ClusterIP yyy.yyy.yyy.yyy <none> 27500/TCP,25001/TCP 24h <FEPPgpool2 name>-feppgpool2-svc NodePort zzz.zzz.zzz.zzz <none> 9999:31707/TCP,9998:31906/TCP 24h
Example of accessing FEPpgpool2 container
$ psql -h <FEPPgpool2 name>-feppgpool2-svc -p 9999 -c "select version();"
When connecting from outside the OpenShift system
Automatically creating a service with ClusterIP to connect to the deployed container. You can connect to FEP or FEP pgpool2 services from the OpenShift system's internal network. To access from outside the OpenShift system, you need to know the address of the OpenShift node.
For example, "Access the FEP pgpool2 container from an application server that is running outside the OpenShift system but is part of the Internal network".
An example of how to check the node IP in OpenShift.
$ oc get nodes NAME STATUS ROLES AGE VERSION openshiftcluster1-cmfv8-master-0 Ready master 370d v1.19.0+4c3480d openshiftcluster1-cmfv8-master-1 Ready master 370d v1.19.0+4c3480d openshiftcluster1-cmfv8-master-2 Ready master 370d v1.19.0+4c3480d $ oc describe nodes openshiftcluster1-cmfv8-master-0 | grep IP InternalIP: 10.0.2.8
An example of verifying the service resource for the FEP pgpool2 container.
$ oc get all
Check where the resource type is Service (Begin with "svc/").
You can also see this with the oc get svc command. The following is an example.
$ oc get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE svc-feppgpool2-feppgpool2 NodePort 172.30.248.12 <none> 9999: 30537/TCP, 9998: 30489/TCP 2m5s
This is an example of accessing the FEP pgpool2 container.
$psql -h 10.0.2.8 -p 30537 -c "show pool_nodes"