airflow.providers.cncf.kubernetes.utils.pod_launcher
¶
Launches PODs
Module Contents¶
-
airflow.providers.cncf.kubernetes.utils.pod_launcher.
should_retry_start_pod
(exception: Exception)[source]¶ -
Check if an Exception indicates a transient error and warrants retrying
-
class
airflow.providers.cncf.kubernetes.utils.pod_launcher.
PodLauncher
(kube_client: client.CoreV1Api = None, in_cluster: bool = True, cluster_context: Optional[str] = None, extract_xcom: bool = False)[source]¶ Bases:
airflow.utils.log.logging_mixin.LoggingMixin
Launches PODS
-
start_pod
(self, pod: V1Pod, startup_timeout: int = 120)[source]¶ Launches the pod synchronously and waits for completion.
- Parameters
pod --
startup_timeout -- Timeout for startup of the pod (if pod is pending for too long, fails task)
- Returns
-
monitor_pod
(self, pod: V1Pod, get_logs: bool)[source]¶ Monitors a pod and returns the final state, pod and xcom result
- Parameters
pod -- pod spec that will be monitored
get_logs -- whether to read the logs locally
- Returns
Tuple[State, Optional[str]]
-