Cannot Connect Google Cloud SQL from Kubernetes Metabase Pods

10/8/2018

I have one Kubernetes cluster which has Metabase running. I am using the Metabase official helm configuration.

But when I connect to the SQL proxy from Kubernetes it always says Connections could not be acquired from the underlying database!

I have added the Kubernetes pod IP and Nginx IP in cloud SQL proxy.

-- Md Sirajus Salayhin
kubernetes
metabase

1 Answer

10/8/2018

Looks like you have to modify the deployment variables to point to your Google Cloud SQL database.

This may vary depending on whether you are using PostgreSQL or MySQL for your Google Cloud SQL database.

With PostgreSQL you can specify a connectionURI like this:

postgres://user:password@host:port/database?ssl=true&sslmode=require&sslfactory=org.postgresql.ssl.NonValidatingFactory"

With PostgreSQL and MySQL you can specify user/password/host/port.

To change these you can edit the deployment:

kubectl -n <your-namespace> edit deployment metabase
-- Rico
Source: StackOverflow