airflow.providers.cncf.kubernetes.callbacks

屬性

client_type

ExecutionMode

執行模式的列舉類。

KubernetesPodOperatorCallback

KubernetesPodOperator 回撥方法。

模組內容

airflow.providers.cncf.kubernetes.callbacks.client_type[source]
class airflow.providers.cncf.kubernetes.callbacks.ExecutionMode[source]

基類: str, enum.Enum

執行模式的列舉類。

SYNC = 'sync'[source]
ASYNC = 'async'[source]
class airflow.providers.cncf.kubernetes.callbacks.KubernetesPodOperatorCallback[source]

KubernetesPodOperator 回撥方法。

目前,回撥方法在非同步模式下不會被呼叫,未來將新增對此的支援。

static on_sync_client_creation(*, client, operator, **kwargs)[source]

建立同步客戶端後呼叫此回撥。

引數:

client (kubernetes.client.CoreV1Api) – 建立的 kubernetes.client.CoreV1Api 客戶端。

static on_pod_manifest_created(*, pod_request, client, mode, operator, context, **kwargs)[source]

在 KPO 建立 V1Pod 清單後,但在 Pod 建立前呼叫此回撥。

引數:
  • pod_request (kubernetes.client.V1Pod) – Kubernetes Pod 清單

  • client (client_type) – 可在此回撥中使用的 Kubernetes 客戶端。

  • mode (str) – 當前執行模式,它是 (sync, async) 中的一個。

static on_pod_creation(*, pod, client, mode, operator, context, **kwargs)[source]

建立 Pod 後呼叫此回撥。

引數:
  • pod (kubernetes.client.V1Pod) – 建立的 Pod。

  • client (client_type) – 可在此回撥中使用的 Kubernetes 客戶端。

  • mode (str) – 當前執行模式,它是 (sync, async) 中的一個。

static on_pod_starting(*, pod, client, mode, operator, context, **kwargs)[source]

當 Pod 啟動時呼叫此回撥。

引數:
  • pod (kubernetes.client.V1Pod) – 啟動的 Pod。

  • client (client_type) – 可在此回撥中使用的 Kubernetes 客戶端。

  • mode (str) – 當前執行模式,它是 (sync, async) 中的一個。

static on_pod_completion(*, pod, client, mode, operator, context, **kwargs)[source]

當 Pod 完成時呼叫此回撥。

引數:
  • pod (kubernetes.client.V1Pod) – 完成的 Pod。

  • client (client_type) – 可在此回撥中使用的 Kubernetes 客戶端。

  • mode (str) – 當前執行模式,它是 (sync, async) 中的一個。

static on_pod_teardown(*, pod, client, mode, operator, context, **kwargs)[source]

在所有 Pod 完成回撥之後,但在 Pod 被刪除之前呼叫此回撥。

引數:
  • pod (kubernetes.client.V1Pod) – 完成的 Pod。

  • client (client_type) – 可在此回撥中使用的 Kubernetes 客戶端。

  • mode (str) – 當前執行模式,它是 (sync, async) 中的一個。

static on_pod_cleanup(*, pod, client, mode, operator, context, **kwargs)[source]

在清理/刪除 Pod 後呼叫此回撥。

引數:
  • pod (kubernetes.client.V1Pod) – 完成的 Pod。

  • client (client_type) – 可在此回撥中使用的 Kubernetes 客戶端。

  • mode (str) – 當前執行模式,它是 (sync, async) 中的一個。

static on_operator_resuming(*, pod, event, client, mode, operator, context, **kwargs)[source]

當從延遲狀態恢復 KubernetesPodOperator 時呼叫此回撥。

引數:
  • pod (kubernetes.client.V1Pod) – Pod 的當前狀態。

  • event (dict) – 從 Trigger 返回的事件。

  • client (client_type) – 可在此回撥中使用的 Kubernetes 客戶端。

  • mode (str) – 當前執行模式,它是 (sync, async) 中的一個。

static progress_callback(*, line, client, mode, **kwargs)[source]

呼叫此回撥處理 Pod 容器日誌。

引數:
  • line (str) – 讀取的日誌行。

  • client (client_type) – 可在此回撥中使用的 Kubernetes 客戶端。

  • mode (str) – 當前執行模式,它是 (sync, async) 中的一個。

此條目有幫助嗎?