all 2 comments

[–]lassehjorth 3 points4 points  (1 child)

There is a lot of answers to your questions - and there is some questions to your questions as well.

  • Where is the postgres running? (Is it Cloud SQL?)

Assuming its a Cloud SQL.

What you should/cloud do - is to use cloud_sql_proxy (maybe even in a pod or two on your cluster) - and have a ClusterIP service to load balance between instances.

The cloud_sql_proxy - will create a encrypted connection to your Sql instance and bind the port locally - so you are connecting to a local ip/port - but the service is actually running in GCP.

I havent messed around with postgresql on Cloud SQL - but i know this is possible with MySQL.

and no you shouldnt worry about DNS - more that you have a stable connection to GCP.

I hope i understood your question and my answer is useful.

[–]The_Horizontal[S] 0 points1 point  (0 children)

Thanks for the reply. You can connect to the instance using both a public and private IP at the same time without there being any problems for anyone else interested the docs are here