https://flyte.org logo
#flyte-on-gcp
Title
# flyte-on-gcp
k

Kevin Parasseril

07/23/2023, 9:46 AM
Hi All , I was able to get the basic setup for flyte-binary running on GCP (sort of) and the init DB container that it spins up succeeded , however it still fails while trying to connect to Cloud SQL instance. I have allowed the subnet that contains the cluster's external endpoint at Cloud SQL end. The PG instance thats being used PG 14.7 and I overwrote the values file to use the 14-alpine image. Is v1.8.0 flyte-binary helmchart supposed to be compatible with PG 15? The services are not in two different subnets and we're using the default VPC that is present. Below is the error on logs while checking the crashloopbackoff issue: [error] failed to initialize database, got error failed to connect to `host=XX.XXX.XXX.XXX user=postgres database=flyte-db-backend`: server error (FATAL: database "flyte-db-backend" does not exist (SQLSTATE 3D000)) The host= is referencing to the DB IP which is set using the following: set { name = "configuration.database.host" value = google_sql_database_instance.flyte_db_backend.public_ip_address } Image tag was overwritten using: set { name = "deployment.waitForDB.image.tag" value = "14-alpine" } Values reference taken for flyte-binary: https://github.com/flyteorg/flyte/blob/master/charts/flyte-binary/values.yaml
f

Fabio Grätz

07/24/2023, 1:29 PM
You could spin up a pod in the cluster, exec into it and try to access the database using postgres’ cli tool to debug.
Wait
server error (FATAL: database “flyte-db-backend” does not exist (SQLSTATE 3D000))
Did you also create a database in the cloud sql instance? https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database.html You need
Copy code
google_sql_database
Copy code
google_sql_database_instance
Copy code
google_sql_user
k

Kevin Parasseril

07/25/2023, 9:46 AM
Hi Fabio , got it , its the google_sql_database that was left to be created , I had created the others and added the External IP of GKE under allowed subnet range , makes sense.
f

Fabio Grätz

07/25/2023, 11:14 AM
I recommend you use
google_service_networking_connection
to connect the cloud sql instance to the vpc used by your cluster. This way the database doesn’t need an external IP.
The cluster needs to VPC-native for this, see here.
Copy code
ip_allocation_policy {
    cluster_ipv4_cidr_block  = ""
    services_ipv4_cidr_block = ""
  }
5 Views