KubernetesHook

Kubernetes

Creates Kubernetes API connection.

View on GitHub

Last Updated: Apr. 5, 2023

Access Instructions

Install the Kubernetes provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

conn_idThe kubernetes connection to Kubernetes cluster.
client_configurationOptional dictionary of client configuration params. Passed on to kubernetes client.
cluster_contextOptionally specify a context to use (e.g. if you have multiple in your kubeconfig.
config_filePath to kubeconfig file.
in_clusterSet to True if running from within a kubernetes cluster.
disable_verify_sslSet to True if SSL verification should be disabled.
disable_tcp_keepaliveSet to True if you want to disable keepalive logic.

Documentation

Creates Kubernetes API connection.

  • use in cluster configuration by using extra field in_cluster in connection

  • use custom config by providing path to the file using extra field kube_config_path 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: /connections/kubernetes

param conn_id

The kubernetes connection to Kubernetes cluster.

param client_configuration

Optional dictionary of client configuration params. Passed on to kubernetes client.

param cluster_context

Optionally specify a context to use (e.g. if you have multiple in your kubeconfig.

param config_file

Path to kubeconfig file.

param in_cluster

Set to True if running from within a kubernetes cluster.

param disable_verify_ssl

Set to True if SSL verification should be disabled.

param disable_tcp_keepalive

Set to True if you want to disable keepalive logic.

Was this page helpful?