I'm currently using helm charts from bitnami (Here) and trying to use a Cloud SQL instance in GCP. No matter what connection string I build, I get various connection errors connecting to the database. This causes the initial pod startup to fail, and never fully initialize.
It does not appear that spring-cloud-dataflow
comes bundled with spring-cloud-gcp
so it cannot be configured via Instance Name, so I assume we need to use the Private IP address, which fails every time.
For the below tests, a Cloud SQL MySQL instance was created, and a Cloud SQL Postgresql instance was created.
Chart configuration 1 for MySQL instance: (username and password omitted for brevity)
mariadb.enabled=false
externalDatabase.dataflow.url=jdbc:mysql://<privateip>/dataflow?useSSL=false
externalDatabase.dataflow.username=root
externalDatabase.driver=org.mariadb.jdbc.Driver
Results in (using port 0 or port 3306):
java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=<private IP>)(port=0)(type=master) : Could not connect to <private IP>:0 : unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
Caused by: java.io.EOFException: unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
Chart configuration 2 (postgresql instance):
mariadb.enabled=false
externalDatabase.dataflow.url=jdbc:postgresql://<Private IP>:5432/
externalDatabase.dataflow.username=postgres
externalDatabase.driver=org.postgresql.Driver
Results in:
org.postgresql.util.PSQLException: The connection attempt failed.
Caused by: java.net.SocketException: Connection reset
I've verified that I can reach the databases via jdbc through Squirrel SQL (for postgresql) and MySQL workbench.
Will this never work unless spring-cloud-dataflow
ships with spring-cloud-gcp
?