Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-6843

Add grace_period_seconds config option for delete_namespaced_pod kube client request

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.10.9
    • 2.0.0
    • executor-kubernetes
    • None

    Description

      If you're using the Kubernetes executor, Amazon EKS deletes pods very quickly after the tasks complete. This can be an issue if you're scraping Airflow logs from a service like FluentD, as it means that the task pod gets deleted before FluentD can pick up logs for fast-running (or fast-failing) tasks.

      The `kube_client_request_args` environment variable is passed to the `delete_namespaced_pod` client request, but passing the necessary `grace_period_seconds` as a `post_param` on that object causes other client requests to fail, as that `kube_client_request_args` is passed as a kwarg to all client requests, even those that don't have a `post_params` option for `grace_period_seconds`.

      In order to provide a config option that fixes this issue, there needs to be a new configurable environment variable `AIRFLOW_KUBERNETES___DELETE_POD_GRACE_PERIOD_SECONDS` option that we pass to the `delete_namespaced_pod`] client request as its own argument. This will be defaulted to 0.

      Attachments

        Issue Links

          Activity

            People

              petedejoy Pete DeJoy
              petedejoy Pete DeJoy
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: