How to Connect using Port Forwarding Database Postgrsql on Openshift 3

7/1/2020

I Have a problem on Connect from Port Forwarding Database on Openshift :

Running Pods Postgresql : Postgresql Pods have Been Running Detail Pods Postgresql

I Try Connect to Container running the database to check process and psql command, then it works : Connect inside container postgre

Next, I Try Port Forwarding for Try Connection from outside Openshift Cluster: Run port forwarding postgresql

Then I Try Connect from Outside Cluster to connect Postgresql have Error: Connection Refuse Im Using IP Based or Hostname / FQDN Not Working and Error Still Exist Error Try Connect Postgresql to Openshift

And When I Try Check Firewall port it has been opened port 5432/TCP : Check Ports Has Been Open or Not


Anyone Can Help Me With This problem ? Thanks

Note: Before I have Been Looking Documentation but Not Working Resolve the Problem Source Documentation: https://www.openshift.com/blog/openshift-connecting-database-using-port-forwarding

https://stackoverflow.com/questions/32439167/psql-could-not-connect-to-server-connection-refused-error-when-connecting-to

-- Vergie Hadiana
kubernetes
openshift
postgresql

1 Answer

7/1/2020

The oc port-forward command is forwarding from only your loopback interfaces.

If you are running your client on the same machine where the cluster is running, then use localhost as your "Host".

If you are running your client on a different machine, they you need more network redirection to get this to work. Please see this post for more information as well as work-arounds for your problem: https://stackoverflow.com/questions/52607821/access-openshift-forwarded-ports-from-remote-host

-- Mike Organek
Source: StackOverflow