airflow.providers.cncf.kubernetes.hooks.kubernetes
¶
Module Contents¶
-
class
airflow.providers.cncf.kubernetes.hooks.kubernetes.
KubernetesHook
(conn_id: str = default_conn_name, client_configuration: Optional[client.Configuration] = None)[source]¶ Bases:
airflow.hooks.base.BaseHook
Creates Kubernetes API connection.
use in cluster configuration by using
extra__kubernetes__in_cluster
in connectionuse custom config by providing path to the file using
extra__kubernetes__kube_config_path
- use custom configuration by providing content of kubeconfig file via
extra__kubernetes__kube_config
in connection
use default config by providing no extras
This hook check for configuration option in the above order. Once an option is present it will use this configuration.
See also
For more information about Kubernetes connection: Kubernetes cluster Connection
- Parameters
conn_id (str) -- The kubernetes connection to Kubernetes cluster.
-
create_custom_object
(self, group: str, version: str, plural: str, body: Union[str, dict], namespace: Optional[str] = None)[source]¶ Creates custom resource definition object in Kubernetes
-
get_custom_object
(self, group: str, version: str, plural: str, name: str, namespace: Optional[str] = None)[source]¶ Get custom resource definition object from Kubernetes