Is the managed cluster on DO can connect with Managed Database PostgreSQL database cluster by default ?

I try to create a deployment to create a pod that will need a database to interact with. I configured a service with endpoints in the cluster to allow my pod to connect to Managed Database cluster in DO. When the pod created.It show error logs:

failed to open connection to database: pq: no pg_hba.conf entry for host “x.x.x.x”, user “doadmin”, database “testdb”, SSL off\n"

As I guess that database cluster need to have a config to allow x.x.x.x (which I think it’s K8s cluster’s IP in DO).

Is there any confirmation that we don’t need additional setting on our K8s on DO and Managed Database PostgreSQL to allow those 2 can interact with each other as those was created with the same DO account.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I seem to be having the same issue. I’m attempting to connect from my DOKS cluster to my DOPostgreSQL using the private network.

The error returned is the same as the original that was posted. The IP listed is the internal-ip for one of the nodes.

I can confirm that I have the cluster and the cluster added under Trusted sources.

Update: Not sure what the issue was but I created a new user view the DO GUI and logged in with that and it seems to be working now.

Hi there!

You should ensure that you add the DOKS cluster as a Trusted Source (In cloud: go to the cluster --> Settings --> Edit Trusted Sources)

After that you should be able to connect to your database.


John Kwiatkoski Senior Developer Support Engineer

You can configure does in the GUI of the managed databases, before the DB was publicly available and you could configure to specify ip ranges or droplets/networks within DO, they launched a internal network only, not sure if they now have this as default. This configurations are available in the GUI of DO and you can look at what you have configured.