fuyi opened a new issue #8965:
URL: https://github.com/apache/airflow/issues/8965

   <!-- A short description of your feature -->
   According to the [Kubernetes Executor 
pod_mutation_hook is used to mutate pod object before sending to the Kubernetes 
client for scheduling. 
   We deploy Airflow in K8S environment and use both Kubernetes Executor and 
KubernetesPodOperator. We need to set almost completely different set of fields 
for Executor pod and KubernetesPodOperator pod. 
   Since `pod_mutation_hook` is applied to all Pod creation requests, we have 
to check which type of pod in the function then add a different set of K8S 
   Pseudo code:
   def pod_mutation_hook:
      if pod.type == 'kubernetes executor workers pod':
           pod.annotations['pod-type'] = 'kubernetes-executor-worker-pod'
      if pod.type == 'PodOperator pod': 
           pod.annotations['pod-type'] = 'pod-operator-pod'
   The issues:
   * It is not clear what fields are applied to what Pod type
   * This is not good practice for separate of concerns.
   **Use case / motivation**
   I propose we keep `pod_mutation_hook` for mutating PodOperator pod and use a 
separate hook like `executor_pod_mutation_hook` to mutate Kuberenetes Executor 

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:

Reply via email to