<p>I'm trying to understand the Arch of Airflow on Kubernetes.</p>
<p>Using the helm and Kubernetes executor, the installation mounts 3 pods called: Trigger, WebServer, and Scheduler...</p>
<p>When I run a dag using the Kubernetes pod operator, it also mounts 2 pods more: one with the dag name and another one with the task name...</p>
<p>I want to understand the communication between pods... So far I know the only the expressed in the image:</p>
<p><a href="https://i.stack.imgur.com/TWQjx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TWQjx.png" alt="enter image description here" /></a></p>
<p>Note: I'm using the git sync option</p>
<p>Thanks in advance for the help that you can give me!!</p>

Reco Jhonatan
<p>Airflow application has some components that require for it to operate normally: Webserver, Database, Scheduler, Trigger, Worker(s), Executor. You can read about it <a href="https://airflow.apache.org/docs/apache-airflow/stable/concepts/overview.html#architecture-overview" rel="nofollow noreferrer">here</a>.</p>
<p>Lets go over the options:</p>
<ol>
<li><a href="https://airflow.apache.org/docs/apache-airflow/stable/executor/kubernetes.html#kubernetes-executor" rel="nofollow noreferrer">Kubernetes Executor</a> (As you choose):
In your instance since you are deploying on Kubernetes with Kubernetes Executor then each task being executed is a pod. Airflow wraps the task with a Pod no matter what task it is. This brings to the front the isolation that Kubernetes offer, this also bring the overhead of creating a pod for each task. Choosing Kubernetes Executor often goes with case where many/most of your tasks takes long time to execute - as if your tasks takes 5 seconds to complete it might not be worth to pay the overhead of creating pod for each task. As for what you see as the DAG -&gt; Task1 in your diagram. Consider that the Scheduler launches the Airflow workers. The workers are starting the tasks in new pods. So the worker needs to monitor the execution of the task.</li>
<li><a href="https://airflow.apache.org/docs/apache-airflow/stable/executor/celery.html" rel="nofollow noreferrer">Celery Executor</a> - Setting up a Worker/Pod which tasks can run in it. This gives you speed as there is no need to create pod for each task but there is no isolation for each task. Noting that using this executor doesn't mean that you can't run tasks in their own Pod. User can run <a href="https://airflow.apache.org/docs/apache-airflow-providers-cncf-kubernetes/stable/operators.html#kubernetespodoperator" rel="nofollow noreferrer">KubernetesPodOperator</a> and it will create a Pod for the task.</li>
<li><a href="https://airflow.apache.org/docs/apache-airflow/stable/executor/celery_kubernetes.html#celerykubernetes-executor" rel="nofollow noreferrer">CeleryKubernetes Executor</a> - Enjoying both worlds. You decide which tasks will be executed by Celery and which by Kubernetes. So for example you can set small short tasks to Celery and longer tasks to Kubernetes.</li>
</ol>
<p>How will it look like Pod wise?</p>
<ol>
<li>Kubernetes Executor - Every task creates a pod. PythonOperator, BashOperator - all of them will be wrapped with pods (user doesn't need to change anything on his DAG code).</li>
<li>Celery Executor - Every task will be executed in a Celery worker(pod). So the pod is always in Running waiting to get tasks. You can create a dedicated pod for a task if you will explicitly use KubernetesPodOperator.</li>
<li>CeleryKubernetes - Combining both of the above.</li>
</ol>
<p>Note again that you can use each one of these executors with Kubernetes environment. Keep in mind that all of these are just executors. Airflow has other components like mentioned earlier so it's very OK to deploy Airflow on Kubernetes (Scheduler, Webserver) but to use CeleryExecutor thus the user code (tasks) are not creating new pods automatically.</p>
<p>As for Triggers since you asked about it specifically - It's a feature added in Airflow 2.2: <a href="https://airflow.apache.org/docs/apache-airflow/stable/concepts/deferring.html" rel="nofollow noreferrer">Deferrable Operators &amp; Triggers</a> it allows tasks to defer and release worker slot.</p>
