airflow.providers.cncf.kubernetes.callbacks¶
Attributes¶
Classes¶
Enum class for execution mode. |
|
KubernetesPodOperator callbacks methods. |
Module Contents¶
- class airflow.providers.cncf.kubernetes.callbacks.ExecutionMode[source]¶
-
Enum class for execution mode.
- class airflow.providers.cncf.kubernetes.callbacks.KubernetesPodOperatorCallback[source]¶
KubernetesPodOperator callbacks methods.
Currently, the callbacks methods are not called in the async mode, this support will be added in the future.
- static on_sync_client_creation(*, client, operator, **kwargs)[source]¶
Invoke this callback after creating the sync client.
- Parameters:
client (kubernetes.client.CoreV1Api) – the created kubernetes.client.CoreV1Api client.
- static on_pod_manifest_created(*, pod_request, client, mode, operator, context, **kwargs)[source]¶
Invoke this callback after KPO creates the V1Pod manifest but before the pod is created.
- Parameters:
pod_request (kubernetes.client.V1Pod) – the kubernetes pod manifest
client (client_type) – the Kubernetes client that can be used in the callback.
mode (str) – the current execution mode, it’s one of (sync, async).
- static on_pod_creation(*, pod, client, mode, operator, context, **kwargs)[source]¶
Invoke this callback after creating the pod.
- Parameters:
pod (kubernetes.client.V1Pod) – the created pod.
client (client_type) – the Kubernetes client that can be used in the callback.
mode (str) – the current execution mode, it’s one of (sync, async).
- static on_pod_starting(*, pod, client, mode, operator, context, **kwargs)[source]¶
Invoke this callback when the pod starts.
- Parameters:
pod (kubernetes.client.V1Pod) – the started pod.
client (client_type) – the Kubernetes client that can be used in the callback.
mode (str) – the current execution mode, it’s one of (sync, async).
- static on_pod_completion(*, pod, client, mode, operator, context, **kwargs)[source]¶
Invoke this callback when the pod completes.
- Parameters:
pod (kubernetes.client.V1Pod) – the completed pod.
client (client_type) – the Kubernetes client that can be used in the callback.
mode (str) – the current execution mode, it’s one of (sync, async).
- static on_pod_teardown(*, pod, client, mode, operator, context, **kwargs)[source]¶
Invoke this callback after all pod completion callbacks but before the pod is deleted.
- Parameters:
pod (kubernetes.client.V1Pod) – the completed pod.
client (client_type) – the Kubernetes client that can be used in the callback.
mode (str) – the current execution mode, it’s one of (sync, async).
- static on_pod_cleanup(*, pod, client, mode, operator, context, **kwargs)[source]¶
Invoke this callback after cleaning/deleting the pod.
- Parameters:
pod (kubernetes.client.V1Pod) – the completed pod.
client (client_type) – the Kubernetes client that can be used in the callback.
mode (str) – the current execution mode, it’s one of (sync, async).
- static on_operator_resuming(*, pod, event, client, mode, operator, context, **kwargs)[source]¶
Invoke this callback when resuming the KubernetesPodOperator from deferred state.