airflow.providers.cncf.kubernetes.pod_launcher_deprecated

Launches pods.

Module Contents

Classes

PodStatus

Status of the pods.

PodLauncher

Deprecated class for launching pods.

class airflow.providers.cncf.kubernetes.pod_launcher_deprecated.PodStatus[source]

Status of the pods.

PENDING = 'pending'[source]
RUNNING = 'running'[source]
FAILED = 'failed'[source]
SUCCEEDED = 'succeeded'[source]
class airflow.providers.cncf.kubernetes.pod_launcher_deprecated.PodLauncher(kube_client=None, in_cluster=True, cluster_context=None, extract_xcom=False)[source]

Bases: airflow.utils.log.logging_mixin.LoggingMixin

Deprecated class for launching pods.

Please use airflow.providers.cncf.kubernetes.utils.pod_manager.PodManager instead.

run_pod_async(pod, **kwargs)[source]

Run pod asynchronously.

delete_pod(pod)[source]

Delete pod.

start_pod(pod, startup_timeout=120)[source]

Launch the pod synchronously and wait for completion.

Parameters
  • pod (kubernetes.client.models.v1_pod.V1Pod) –

  • startup_timeout (int) – Timeout for startup of the pod (if pod is pending for too long, fails task)

Returns

monitor_pod(pod, get_logs)[source]

Monitor a pod and return the final state.

Parameters
  • pod (kubernetes.client.models.v1_pod.V1Pod) – pod spec that will be monitored

  • get_logs (bool) – whether to read the logs locally

parse_log_line(line)[source]

Parse K8s log line and returns the final state.

Parameters

line (str) – k8s log line

Returns

timestamp and log message

Return type

tuple[str | None, str]

pod_not_started(pod)[source]

Test if pod has not started.

pod_is_running(pod)[source]

Test if pod is running.

base_container_is_running(pod)[source]

Test if base container is running.

read_pod_logs(pod, tail_lines=None, timestamps=False, since_seconds=None)[source]

Read log from the pod.

read_pod_events(pod)[source]

Read events from the pod.

read_pod(pod)[source]

Read pod information.

process_status(job_id, status)[source]

Process status information for the job.

Was this entry helpful?