-3

I have a project with Cloud Composer and Cloud SQL. I am able to connect to Cloud SQL because i edited the yaml of airflow-sqlproxy-service and added my Cloud SQL instance on cloud proxy used for the airflow-db, mapping to port 3307.

The workers can connect to airflow-sqlproxy-service on port 3307 but i think the webserver can't connect to this.

Do i need to add some firewall rule to map the 3307 port so the webserver or the UI can connect to airflow-sqlproxy-service?

https://i.stack.imgur.com/LwKQK.png

https://i.stack.imgur.com/CJf7Q.png

https://i.stack.imgur.com/oC2dJ.png

Best regards.

C3F8
  • 1
  • 1
  • If you modified the cloudSQL used by the webserver you will likely need to reach out to support to configure the webserver. You may add a CloudSQL in parallel if you do not need to use your instance for the airflow back-end https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine – HulaHoof Oct 30 '18 at 22:43

1 Answers1

0

Composer does not currently support configuring additional sql proxies from the webserver. One workaround for cases like this is to have a separate DAG which loads Airflow Variables with the information needed from the other database (via the workers which do have access), then generate a DAG based on the Variable which the webserver can access.

https://github.com/apache/incubator-airflow/pull/4170 recently got merged (not currently available in Composer), which defines a CloudSQL connection type. This might work for these use cases in the future.

Trevor Edwards
  • 431
  • 2
  • 6