Kubernetes cluster Connection¶
The Kubernetes cluster Connection type enables connection to a Kubernetes cluster by SparkKubernetesOperator
tasks. They are not used by KubernetesPodOperator
tasks.
Authenticating to Kubernetes cluster¶
There are three ways to connect to Kubernetes using Airflow.
Use kube_config that reside in the default location on the machine(~/.kube/config) - just leave all fields empty
- Use in_cluster config, if Airflow runs inside Kubernetes cluster take the configuration from the cluster - mark:
In cluster configuration
Use kube_config from different location - insert the path into
Kube config path
- Use kube_config in JSON format from connection configuration - paste kube_config into
Kube config (JSON format)
Default Connection IDs¶
The default connection ID is kubernetes_default
.
Configuring the Connection¶
- In cluster configuration
Use in cluster configuration.
- Kube config path
Use custom path to kube config.
- Kube config (JSON format)
Kube config that used to connect to Kubernetes client.
- Namespace
Default kubernetes namespace for the connection.