astronomer.providers.cncf.kubernetes.operators.kubernetes_pod¶
Module Contents¶
Classes¶
Async (deferring) version of KubernetesPodOperator |
- exception astronomer.providers.cncf.kubernetes.operators.kubernetes_pod.PodNotFoundException[source]¶
Bases:
airflow.exceptions.AirflowExceptionExpected pod does not exist in kube-api.
- class astronomer.providers.cncf.kubernetes.operators.kubernetes_pod.KubernetesPodOperatorAsync(*, poll_interval=5, logging_interval=None, **kwargs)[source]¶
Bases:
airflow.providers.cncf.kubernetes.operators.kubernetes_pod.KubernetesPodOperatorAsync (deferring) version of KubernetesPodOperator
Warning
By default, logs will not be available in the Airflow Webserver until the task completes. However, you can configure
KubernetesPodOperatorAsyncto periodically resume and fetch logs. This behavior is controlled by paramlogging_interval.- Parameters:
poll_interval (int) – interval in seconds to sleep between checking pod status
logging_interval (Optional[int]) – 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.
- defer(last_log_time=None, **kwargs)[source]¶
Defers to
WaitContainerTriggeroptionally with last log time.
- execute(context)[source]¶
Based on the deferrable parameter runs the pod asynchronously or synchronously
- trigger_reentry(context, event)[source]¶
Point of re-entry from trigger.
If
logging_intervalis None, then at this point the pod should be done and we’ll just fetch the logs and exit.If
logging_intervalis 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.