Closed iantbutler01 closed 1 year ago
@iantbutler01 It makes sense. Wouldn't you like to prepare a PR? I am happy to help with the review and merging the change.
Yes I am happy to work on this!
Great! I assigned you to this ticket. 😺
@iantbutler01 are you still working on it?
I am not, my work has carried me far away from Airflow and I do not have the time these days @eladkal
Description
I would like the annotations kwarg in the KubernetesPodOperator to support templating.
Use case / motivation
With how the KubernetesExecutor runs tasks right now I can't generate an id in my dag file and use it for each task in the dag because it will be regenerated for each subsequent task. When the dag files are copied and ran on the individual Kubernetes pod the generation step is rerun.
For example if I set a variable x = str(uuid.uuid4()) at the beginning of my dag file and then pass x as an arg to 3 tasks each task will have a different value for that parameter on the KubernetesExecutor. To get around that we are using an external metadata DB and xcoms.
We would love to be able to template xcom data into the pod annotations.
Our specific use case is we're doing versioned web crawls using Airflow as our job scheduler for crawling and loading data in spark and we use annotations on the pod and xcoms to know which pod to communicate with over HTTP from different tasks for various monitoring and management tasks.
Related Issues
I have not seen one.