0

I have PostgreSQL pod in OpenShift and I want to make some integration tests in my java application directly from IDE.

I tried to create route to service, but i can't connect to route hostname and 5432 port

I also tried to create LoadBalancer service. It has ClusterIP and External IP, but i can't even ping external IP.

The only working solution I found is oc port-forward.

But is there any other way to make my PostgreSQL pod accesed remotely?

1 Answer 1

1

Ok. I figured out how to connect to postgre remotely.

First of all I used 3rd answer about config maps to set listen_adresses to '*' in postgresql.conf How to change postgresql.conf default values on Openshift

Then, after creating pod with correct .conf i created loadBalance service as it said in 2nd answer Can PostgreSQL service in OpenShift cluster receive external traffic via exposed route

After that I figured out what port was assigned with the "oc export service SERVICE_NAME" command. In the output of this command the port will be in the "-nodePort: " section.

To connect postgre we need to use node-ip:node-port node-ip is shown in pod-info in openshift web console

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.