Thursday, November 28, 2019

[google-cloud-sql-discuss] Connect to Cloud SQL from within another pod using cloud proxy

Hi

I have setup a deployment with the following command:
 ./cloud_sql_proxy  -credential_file=/etc/secrets/mysql-gcp-sa.json -instances=kubeflow-test-servers1:us-central1:bitgrit-db=tcp:0.0.0.0:33
06

When I connect using below command:

mysql -u root --password -h 0.0.0.0

I get an entry in Stackdriver log but after a minute or so I get error:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 22 "Invalid argument"
/

My stack driver log entry is :
{
insertId: "d1wgvneko75d" 
logName: "projects/kubeflow-test-servers1/logs/cloudaudit.googleapis.com%2Factivity" 
protoPayload: {…} 
receiveTimestamp: "2019-11-29T06:28:49.041963434Z" 
resource: {…} 
severity: "NOTICE" 
timestamp: "2019-11-29T06:28:48.170Z" 
}


What I am I doing wrong?

Why don't I get Sql prompt. Also in the pod I am using image:
gcr.io/cloudsql-docker/gce-proxy:1.14


--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e3edf006-27d7-4dc4-92c0-bc3508d92d7f%40googlegroups.com.

No comments:

Post a Comment