How do I connect to gcloud sql with gcloud sql proxy from GKE

2/25/2017

I've got a a Rails app configured and working with MySql2 gem. I've got it successfully deployed with K8s on GKE. I've got my service account set up to have access to all things GKE GCE and SQl related. I've given the GKE permissions to SQL. I've followed this strictly:

https://github.com/GoogleCloudPlatform/container-engine-samples/tree/master/cloudsql

I still am getting this error when I pull the app up in a browser: "Lost connection to MySQL server at 'reading initial communication packet', system error: 0"

From what I understand this indicates that the proxy does not have access to the gcloud SQL instance.

Please, it's been days! I need help! Don't even know how to trouble shoot!

Thanks in advance

-- Patrick Dougall
docker
gcloud
kubernetes
mysql
ruby-on-rails

0 Answers