:py:mod:`astronomer.providers.cncf.kubernetes.operators.kubernetes_pod` ======================================================================= .. py:module:: astronomer.providers.cncf.kubernetes.operators.kubernetes_pod Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.cncf.kubernetes.operators.kubernetes_pod.KubernetesPodOperatorAsync .. py:exception:: PodNotFoundException Bases: :py:obj:`airflow.exceptions.AirflowException` Expected pod does not exist in kube-api. .. py:class:: KubernetesPodOperatorAsync(*, poll_interval = 5, logging_interval = None, **kwargs) Bases: :py:obj:`airflow.providers.cncf.kubernetes.operators.kubernetes_pod.KubernetesPodOperator` Async (deferring) version of KubernetesPodOperator .. warning:: By default, logs will not be available in the Airflow Webserver until the task completes. However, you can configure ``KubernetesPodOperatorAsync`` to periodically resume and fetch logs. This behavior is controlled by param ``logging_interval``. :param poll_interval: interval in seconds to sleep between checking pod status :param logging_interval: max time in seconds that task should be in deferred state before resuming to fetch latest logs. If ``None``, then the task will remain in deferred state until pod is done, and no logs will be visible until that time. .. py:method:: raise_for_trigger_status(event) :staticmethod: Raise exception if pod is not in expected state. .. py:method:: defer(last_log_time = None, **kwargs) Defers to ``WaitContainerTrigger`` optionally with last log time. .. py:method:: execute(context) This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates. Refer to get_template_context for more context. .. py:method:: execute_complete(context, event) Deprecated; replaced by trigger_reentry. .. py:method:: trigger_reentry(context, event) Point of re-entry from trigger. If ``logging_interval`` is None, then at this point the pod should be done and we'll just fetch the logs and exit. If ``logging_interval`` is not None, it could be that the pod is still running and we'll just grab the latest logs and defer back to the trigger again.