GoogleCloudPlatform / buildpacks

Builders and buildpacks designed to run on Google Cloud's container platforms
Apache License 2.0
985 stars 146 forks source link

Cloud SQL Proxy Support for the image built by Build Pack #116

Open mmudiamme opened 3 years ago

mmudiamme commented 3 years ago

An Example Project from GoogleCloudPlatform https://github.com/GoogleCloudPlatform/gke-cloud-sql-postgres-demo

iamacarpet commented 1 year ago

@mmudiamme are you able to run Cloud SQL Proxy as a sidecar container, rather than worrying about it being integrated into the buildpack itself?:

image

That is using the outdated gcr.io/cloudsql-docker/gce-proxy:latest image (v1), but there is a newer gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.4.0 image (v2) available as well.

My screenshot shows using a TCP port, but you can just as easily use an emptyDir volume mount for /cloudsql in both the sidecar and application container, using unix sockets instead, like App Engine & Cloud Run are doing.