airflow.providers.cncf.kubernetes.kubernetes_helper_functions¶
Attributes¶
Functions¶
| 
 | Generate random lowercase alphanumeric string of length num. | 
| 
 | Add random string to pod or job name while staying under max length. | 
| 
 | Generate unique pod or job ID given a dag_id and / or task_id. | 
| 
 | Build a TaskInstanceKey based on pod annotations. | 
| 
 | |
| 
 | Check if an Exception indicates a transient error and warrants retrying. | 
Module Contents¶
- airflow.providers.cncf.kubernetes.kubernetes_helper_functions.alphanum_lower = 'abcdefghijklmnopqrstuvwxyz0123456789'[source]¶
- airflow.providers.cncf.kubernetes.kubernetes_helper_functions.rand_str(num)[source]¶
- Generate random lowercase alphanumeric string of length num. 
- airflow.providers.cncf.kubernetes.kubernetes_helper_functions.add_unique_suffix(*, name, rand_len=8, max_len=POD_NAME_MAX_LENGTH)[source]¶
- Add random string to pod or job name while staying under max length. 
- airflow.providers.cncf.kubernetes.kubernetes_helper_functions.create_unique_id(dag_id=None, task_id=None, *, max_length=POD_NAME_MAX_LENGTH, unique=True)[source]¶
- Generate unique pod or job ID given a dag_id and / or task_id. 
- 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.annotations_for_logging_task_metadata(annotation_set)[source]¶
- airflow.providers.cncf.kubernetes.kubernetes_helper_functions.should_retry_creation(exception)[source]¶
- Check if an Exception indicates a transient error and warrants retrying. - This function is needed for preventing ‘No agent available’ error. The error appears time to time when users try to create a Resource or Job. This issue is inside kubernetes and in the current moment has no solution. Like a temporary solution we decided to retry Job or Resource creation request each time when this error appears. More about this issue here: https://github.com/cert-manager/cert-manager/issues/6457