erlchamp
erlchamp

Reputation: 45

GKE pod connectivity to Cloud SQL

Please enlighten me.

Current Setup: Docker container running inside the VM instance - The docker container can connect to our Cloud SQL with all the credentials included in the property file during the building of docker image

Future Setup: I deployed this container as a pod on my GKE but it couldn't connect to my Cloud SQL. I am just confused, Do I still need to do an extra step like the guide below before I can establish a connection to my Cloud SQL DBs?

https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine

Since the property file where all the DB credentials where package together during the building process of an image, I should be able to connect to Cloud SQL DBs from GKE pod right?

====

kubectl logs -f appds-d599f75d4-wn9x6

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up

Upvotes: 0

Views: 2547

Answers (1)

Arghya Sadhu
Arghya Sadhu

Reputation: 44657

For private GKE clusters GKE worker nodes and pods running on those nodes access other GCP APIs such as Cloud SQL via Private API Access

architecture

Upvotes: 1

Related Questions