airflow.providers.google.cloud.triggers.kubernetes_engine

Module Contents

Classes

GKEStartPodTrigger

Trigger for checking pod status until it finishes its job.

GKEOperationTrigger

Trigger which checks status of the operation.

GKEJobTrigger

GKEJobTrigger run on the trigger worker to check the state of Job.

class airflow.providers.google.cloud.triggers.kubernetes_engine.GKEStartPodTrigger(pod_name, pod_namespace, cluster_url, ssl_ca_cert, base_container_name, trigger_start_time, cluster_context=None, poll_interval=2, in_cluster=None, get_logs=True, startup_timeout=120, on_finish_action='delete_pod', should_delete_pod=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, *args, **kwargs)[source]

Bases: airflow.providers.cncf.kubernetes.triggers.pod.KubernetesPodTrigger

Trigger for checking pod status until it finishes its job.

Parameters
  • pod_name (str) – The name of the pod.

  • pod_namespace (str) – The namespace of the pod.

  • cluster_url (str) – The URL pointed to the cluster.

  • ssl_ca_cert (str) – SSL certificate that is used for authentication to the pod.

  • cluster_context (str | None) – Context that points to kubernetes cluster.

  • poll_interval (float) – Polling period in seconds to check for the status.

  • trigger_start_time (datetime.datetime) – time in Datetime format when the trigger was started

  • in_cluster (bool | None) – run kubernetes client with in_cluster configuration.

  • get_logs (bool) – get the stdout of the container as logs of the tasks.

  • startup_timeout (int) – timeout in seconds to start up the pod.

  • base_container_name (str) – The name of the base container in the pod. This container’s logs will appear as part of this task’s logs if get_logs is True. Defaults to None. If None, will consult the class variable BASE_CONTAINER_NAME (which defaults to “base”) for the base container name to use.

  • on_finish_action (str) – What to do when the pod reaches its final state, or the execution is interrupted. If “delete_pod”, the pod will be deleted regardless its state; if “delete_succeeded_pod”, only succeeded pod will be deleted. You can set to “keep_pod” to keep the pod.

  • should_delete_pod (bool | None) – What to do when the pod reaches its final state, or the execution is interrupted. If True (default), delete the pod; if False, leave the pod. Deprecated - use on_finish_action instead.

serialize()[source]

Serialize KubernetesCreatePodTrigger arguments and classpath.

hook()[source]
class airflow.providers.google.cloud.triggers.kubernetes_engine.GKEOperationTrigger(operation_name, project_id, location, gcp_conn_id='google_cloud_default', impersonation_chain=None, poll_interval=10)[source]

Bases: airflow.triggers.base.BaseTrigger

Trigger which checks status of the operation.

serialize()[source]

Serialize GKEOperationTrigger arguments and classpath.

async run()[source]

Get operation status and yields corresponding event.

class airflow.providers.google.cloud.triggers.kubernetes_engine.GKEJobTrigger(cluster_url, ssl_ca_cert, job_name, job_namespace, gcp_conn_id='google_cloud_default', poll_interval=2, impersonation_chain=None)[source]

Bases: airflow.triggers.base.BaseTrigger

GKEJobTrigger run on the trigger worker to check the state of Job.

serialize()[source]

Serialize KubernetesCreateJobTrigger arguments and classpath.

async run()[source]

Get current job status and yield a TriggerEvent.

hook()[source]

Was this entry helpful?