I'm using GCloud, I have a kubernate cluster and a cloud sql instance.
I have a simple node.js app, that uses database. When I deploy with gcloud app deploy
it has an access to a database. However, when I build a dockerimage and expose it, it cannot reach database.
- I expose Docker application following: https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app
- Cloud SQL deosn't have Private IP enabled, Im connecting using cloud sql proxy
- In app.yaml I do specify
base_settings:cloud_sql_instances
. I use the same value insocketPath
config for mysql connection. The error in docker logs is:
(node:1) UnhandledPromiseRejectionWarning: Error: connect ENOENT /cloudsql/x-alcove-224309:europe-west1:learning at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)
Can you please explain me how to connect to cloud sql from dockerized node application.