How to connect to Google Cloud SQL from a GCE pod?

6/4/2015

What's the best way to connect to a google cloud SQL DB from a google container engine pod? The doc implies I should request an IPV4 address for the DB and connect through that.

I wonder whether there's a better way using the DB's name instead?

Is there something similar to using the /cloudsql/<db_name> socket connection in App Engine?

-- Nuschk
google-cloud-sql
google-kubernetes-engine

1 Answer

6/4/2015

It may not be the best answer, but you could always set up a DNS name for it.

I don't know whether there's any built-in way to use the name instead of the IP. App Engine can do special nice things for you because it runs your code in a specially managed run-time environment.

-- Alex Robinson
Source: StackOverflow