The problem is that I am able to run an pod with kubectl
but not with kubernetesPodOperator
It looks like the airflow instance isn’t able to interrogate the local minikube
cluster (single node).
OS: Ubuntu-20.04
Docker version: 20.10.5
kubectl version: v1.20.5 - linux/amd64
kubectl cluster-info:
Kubernetes control plane is running at https://192.168.49.2:8443
KubeDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
curl -sSL https://install.astronomer.io | sudo bash
Astro CLI Version: 0.23.3, Git Commit: a2efe47910570a1b7c29c4532ecbc93e697270d6
Notice: All the installations are local.
task-1 = KubernetesPodOperator(
namespace='default',
image="busybox",
labels={'dag-id': dag.dag_id},
name="busybox",
task_id='fetch',
in_cluster=False,
cluster_context='minikube' ,
config_file='/usr/local/airflow/include/.kube/config',
is_delete_operator_pod=True,
get_logs=True
)
[2021-03-19 22:54:13,876] {logging_mixin.py:112} INFO - [2021-03-19 22:54:13,875] {connectionpool.py:750} WARNING - Retrying ('\x1b[1mRetry(total=0, connect=None, read=None, redirect=None, status=None)\x1b[0m') after connection broken by ''\x1b[1m<urllib3.connection.HTTPSConnection object at 0x7fcdbd0e7e90>: Failed to establish a new connection: [Errno 110] Operation timed out\x1b[0m'': /api/v1/namespaces/default/pods/busybox-9f98f89f
[2021-03-19 22:56:24,952] {taskinstance.py:1088} ERROR - HTTPSConnectionPool(host='192.168.49.2', port=8443): Max retries exceeded with url: /api/v1/namespaces/default/pods/busybox-9f98f89f (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fcdbd157910>: Failed to establish a new connection: [Errno 110] Operation timed out'))
ConnectionRefusedError: [Errno 111] Connection refused