Using Cloud SQL Proxy with Airflow in Composer

I am having trouble connecting to a Cloud SQL postgres database from Airflow.

As I understand it, we have a set up where Airflow is being managed by a Cloud Composer Environment on a Kubernetes cluster. (It was initialized with Composer → Create → Composer 2.) It seems the best practice is to run the Cloud SQL Auth Proxy as an additional container sharing a pod with my application. (From the guide here.)

But trying to do that, I’m getting lost on this step:

  • Add the Cloud SQL Auth Proxy to the pod configuration under containers

Where is this configuration? What specifically is meant by “application”?

Ok so after much frustration I found a solution that works. All of the blogs, threads, and even official documentation isn’t up to date, but this solution pulls all the correct pieces from them and puts it all together.