Cannot have multiple cloudsql-docker proxy connections

179 views
Skip to first unread message

Sean Dowd

unread,
May 3, 2017, 11:50:10 AM5/3/17
to Google Cloud SQL discuss
I have a simple example where I need multiple containers (deployments with replicas and jobs with replicas set to 1) to be able to connect to my mysql instance.  I'm following the directions from this page: https://cloud.google.com/sql/docs/mysql/connect-container-engine

I'm able to combine the app (wordpress) and job (logstash connected to mysql over jdbc) into a single deployment with the cloudsql-proxy sidecar and it works if I have replicas set to 1.  If I increase replicas to 2 or more, only one of the sidecars will start (call it pod 1).  The other errors off as follows:

Error from server (BadRequest): container "cloudsql-proxy" in pod "mysql-test-2203380987-cmkkf" is waiting to start: trying and failing to pull image

The sidecar in pod 1 works with no issues as do the other containers in pod 1, but the containers in pod 2 fail.

I also tried pulling the job out of the deployment, but I get the same errors.  Then I simplified and have only a simple mysql connection (via mysql command line) with the sidecar in a deployment.  If replicas is 1, it works fine.  If replicas is 2, one of the testers and sidecars works, the other fails with the image pull issue above.

Why can't I have more than 1 proxy running to mysql?  If I need multiple users defined, how would that work with replicated deployments?

Sean Dowd

unread,
May 3, 2017, 4:37:35 PM5/3/17
to Google Cloud SQL discuss
Answering my own question: this appears to be specific to version 1.09 of cloudsql-proxy.  Downgrading to 1.08 resolved it (along with moving the proxy into its own deployment with service so it can be shared and scaled independently).  Issue submitted here: https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/89.

Kevin Malachowski

unread,
May 4, 2017, 10:35:13 PM5/4/17
to Google Cloud SQL discuss
Hey Sean, thanks for submitting the issue to the GitHub. I will try to take a look at this next week.
Reply all
Reply to author
Forward
0 new messages