https://pulumi.com logo
#google-cloud
Title
# google-cloud
l

lemon-wire-69305

01/03/2023, 10:41 PM
Hi all, does anyone have any tips for connecting K8s -> CloudSQL? I've got a job running a simple ping golang app using the in-process CloudSQLProxy connector (https://github.com/GoogleCloudPlatform/cloud-sql-go-connector), but keep getting a`failed to connect to `host=localhost user=my-service-account@my-domain.iam database=my_db_name`: dial error (timeout: context deadline exceeded)` error. I'm not sure why the log message has host as localhost, as the host given in the connection string is
project:region:db_instance_name
. I can see in the following in the DB logs when it attempts to connect:
Copy code
authorizationInfo: [
  0: {
    granted: true
    permission: "cloudsql.instances.connect"
    resource: "projects/uxu-io-staging/instances/database-instance-uxu-8898595"
    resourceAttributes: {
    name: "projects/uxu-io-staging/instances/database-instance-uxu-8898595"
    service: "<http://sqladmin.googleapis.com|sqladmin.googleapis.com>"
    type: "<http://sqladmin.googleapis.com/Instance|sqladmin.googleapis.com/Instance>"
  }}]
methodName: "cloudsql.instances.connect"