airflow.providers.cncf.kubernetes.kubernetes_helper_functions

Module Contents

Functions

create_pod_id([dag_id, task_id, max_length, unique])

Generate unique pod ID given a dag_id and / or task_id.

annotations_to_key(annotations)

Build a TaskInstanceKey based on pod annotations.

get_logs_task_metadata()

annotations_for_logging_task_metadata(annotation_set)

Attributes

log

alphanum_lower

airflow.providers.cncf.kubernetes.kubernetes_helper_functions.log[source]
airflow.providers.cncf.kubernetes.kubernetes_helper_functions.alphanum_lower[source]
airflow.providers.cncf.kubernetes.kubernetes_helper_functions.create_pod_id(dag_id=None, task_id=None, *, max_length=80, unique=True)[source]

Generate unique pod ID given a dag_id and / or task_id.

The default of 80 for max length is somewhat arbitrary, mainly a balance between content and not overwhelming terminal windows of reasonable width. The true upper limit is 253, and this is enforced in construct_pod.

Parameters
  • dag_id (str | None) – DAG ID

  • task_id (str | None) – Task ID

  • max_length (int) – max number of characters

  • unique (bool) – whether a random string suffix should be added

Returns

A valid identifier for a kubernetes pod name

Return type

str

airflow.providers.cncf.kubernetes.kubernetes_helper_functions.annotations_to_key(annotations)[source]

Build a TaskInstanceKey based on pod annotations.

airflow.providers.cncf.kubernetes.kubernetes_helper_functions.get_logs_task_metadata()[source]
airflow.providers.cncf.kubernetes.kubernetes_helper_functions.annotations_for_logging_task_metadata(annotation_set)[source]

Was this entry helpful?