Hi All,
I'm in a similar situation. I need to connect to CloudSQL Postgresql From Google Cloud Composer. Unfortunately I am not a kubernetes expert plus very limited knowledge on GCP. Just by reading some documentation I tried out the following -
This is what I have tried so far -
1) Set up VPC Network Peering. The CloudSQL Postgresql and Google Cloud Composer are in separate projects.
The VPC Network Peering Status shows "ACTIVE" on both the sides, so I am guessing my setup is correct.
2) Set up the Firewall - Here is where I am confused. Anyway this is what I did
on the CloudSQL Postgresql - I set the Direction = Ingress
Protocols and ports = all
Targets = All Instances in the Network (I am guessing Target is the CloudSQL Postgresql)
Source = Is the google composer (Service account)
3) Testing - On the google cloud composer (Gcloud Active Shell)
I wanted to see whether I can connect to the CloudSQL Postgresql database
psql -U master -h [ DATABASE PRIVATE IP ADDRESS]
Got the Below Error -
psql: error: connection to server at "10.XX.X.X", port 5432 failed: Connection timed out
Is the server running on that host and accepting TCP/IP connections?
Don't know whether there is some issue on the Firewall setup ? Please help.
If I have to take the route of Cloud SQL Proxy. Can someone please give me the detailed steps on how to do all the complete setup.
any help is highly appreciated !!!