yamrzou commented on issue #10792:
URL: https://github.com/apache/airflow/issues/10792#issuecomment-703669984


   @dimberman We are using this to add variables from the dagrun conf to 
labels, in order to use them to filter pods and logs.
   
   It looks like:
   ```
   # ensure_valid_pod_label is a user-defined macro to make sure the value is a 
valid Kubernetes pod label
   
   task = KubernetesPodOperator(
       ...,
       labels={
           "is_airflow_pod": "true",
           "run_id": "{{ ensure_valid_pod_label(run_id) }}",
           "element_id": "{{ ensure_valid_pod_label(dag_run.conf.element_id) 
}}",
           "start_date": "{{ ensure_valid_pod_label(dag_run.conf.start_date) 
}}",
           "end_date": "{{ ensure_valid_pod_label(dag_run.conf.end_date) }}",
           },
       )
   ```
   I'm not familiar with `pod_template_file`, so I'm not sure if it would be 
possible.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to