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

Kubernetes Executor: Allow per task labels on task pods

    XMLWordPrintableJSON

    Details

      Description

      I want to be able to add arbitrary labels to an airflow worker pod.  For example, I want to specify this in the task definition:

      ```
      run_this = PythonOperator(
      task_id='print_the_context',
      provide_context=True,
      python_callable=my_sleeping_function,
      executor_config={"KubernetesExecutor": {"labels":

      {"test": "label"}

      }},
      dag=dag,
      )
      ```

      And have my worker pod have the label `test:label`. 

       

      My main use case for this is for auditing.  We audit our kubernetes cluster by tags, attributing cost based on how much resources the pod uses.  

       

      I will make a PR.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmmotto George Miller
                Reporter:
                gmmotto George Miller
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified