airflow.providers.cncf.kubernetes.kube_client¶
Client for kubernetes communication.
Attributes¶
Functions¶
|
Enable TCP keepalive on the Kubernetes client |
|
Retrieve Kubernetes client. |
|
Retrieve an asynchronous Kubernetes client. |
Module Contents¶
- airflow.providers.cncf.kubernetes.kube_client.configure_tcp_keepalive(configuration)[source]¶
Enable TCP keepalive on the Kubernetes client
configuration.This prevents connections from hanging indefinitely when an idle connection is timed out by services like cloud load balancers or firewalls. The options are set through
Configuration.socket_options, which the client passes on to its urllib3 pool manager.See https://github.com/apache/airflow/pull/11406 for the original discussion.
- airflow.providers.cncf.kubernetes.kube_client.get_kube_client(in_cluster=None, cluster_context=None, config_file=None)[source]¶
Retrieve Kubernetes client.
- async airflow.providers.cncf.kubernetes.kube_client.get_async_kube_client(in_cluster=None, cluster_context=None, config_file=None)[source]¶
Retrieve an asynchronous Kubernetes client.
Mirrors
get_kube_client()but builds akubernetes_asyncioclient so that pod-creation API calls can be issued concurrently by the KubernetesExecutor. Reads the same configuration keys (in_cluster,cluster_context,config_file,verify_ssl,ssl_ca_cert).