0

I'm using Google Composer however due to the fact that I'm trying to create a dynamically created DAG, I'm unable to use the managed web server [1]. So in the end I need to add a plugins because I need to access the Airflow Webserver using REST API, so I install the following plugins, because the experimental REST API is not sufficient for my case [2]:

My managed Airflow Webserver was able to pick up changes when I updated my plugins. However my self managed Airflow Webserver was unable to pick up the changes.

I understand that I need to restart my Airflow Webserver, however it seems like my pods are not got restarted after I perform this command:

kubectl get deploy airflow-webserver -o yaml | kubectl replace --force -f -

For your reference my deployment.yaml can be seen if you're doing the steps mentioned in [3].

Restarting the pods by using kubectl patch for certain unused environment variable also seems to be not working.

[1] Dynamically Creating DAG based on Row available on DB Connection

[2] https://github.com/apache/airflow/blob/master/docs/api.rst

[3] https://cloud.google.com/composer/docs/how-to/managing/deploy-webserver

irvifa
  • 1,865
  • 2
  • 16
  • 20
  • I'm facing a similar issue - have you found a way to restart the airflow-webserver? Thanks! – Leo Jan 28 '19 at 16:31
  • Hello.. what platform are you using? – irvifa Jan 31 '19 at 05:13
  • Hi, I also use Google Composer (Airflow 1.10). Have you found a way to restart it? – Leo Jan 31 '19 at 12:08
  • Are you using self managwd or managed environment? Can you elaborate more? – irvifa Feb 02 '19 at 02:35
  • Sure, I'm using the managed environment - did nothing special but to create the cluster from the composer screen. To resolve this issue (temporarily) I ended up launching a new cluster and deleting the faulty one. – Leo Feb 04 '19 at 13:34
  • I'm also using the same approach – irvifa Feb 08 '19 at 07:05

1 Answers1

0

This issue is already solved by creating a new environment and then migrate all the data to new environment using [1], current version is 1.4.1 (the previous version that I use is 1.3.0). Information about release can be found in [2]. Plugins can be installed by copying the plugins directory to plugins directory using gcsfuse or using the web console.

If you're using plugins for your webserver it means your endpoint also protected by IAP. To access it programmatically, you can use service account [3].

[1] https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/composer/tools/copy_environment.py

Please note that when you're using a beta version. The one that created by using the following command:

gcloud beta composer environments create <env> --location=<location> --airflow-version <version> --node-count <node-count>

You should first create the environments and then run the script I provided because this beta version is available on v1beta1. Meanwhile the script is only supporting v1 API.

Please also note that if you're using other k8s resources on your own inside the old environment, this won't be backed up by the script I mentioned. The script only back up all config to your airflow, ie: DB, DAG, and logs. So in case you're using a self manage webserver you should recreate your deployment for this webserver.

[2] https://cloud.google.com/composer/docs/release-notes

[3] https://cloud.google.com/iap/docs/authentication-howto

irvifa
  • 1,865
  • 2
  • 16
  • 20
  • 1
    This is not a solution. It is a huge pain to migrate the entire database of Airflow over to a new instance. The solution to restarting the webserver can not be, tear down everything you've created, jettison your job history and spin up an entirely new cluster. – Bob Briski Feb 01 '19 at 21:10
  • There's no other ways, because my image was not supported anymore, and the support guys also give me the same approach. Well, there's no deprecation notice as well on uts release page – irvifa Feb 02 '19 at 02:36