


Namespace = conf.get('kubernetes', 'NAMESPACE')
#Kubernetes airflow docker code
The following code was able to run without any problems: from airflow import DAGįrom airflow import configuration as conf

Unfortunately I still haven't figured out the problem with microK8s.īut I was able to use the KubernetesPodOperator in Airflow with minikube. Prevent the container from exiting with sleep commands.When I launch the pod in kubernetes itself without Airflow it runs fine. WARNING - Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: Connection timed out')': /api/v1/namespaces/default/pods?labelSelector=dag_id%3Dkubernetes_helloworld%2Cexecution_date%3DT162511.1426950000-e549b02ea%2Ctask_id%3Dpod2 This is the log output I get in Airflow: Reading local file: /home/user/airflow/logs/kubernetes_helloworld/pod2/T16:25:11.142695+00:00/4.log When I trigger the DAG it keeps running and reattempts to launch the pod indefinite times. Image='localhost:32000/hello-world:registry', Op = DummyOperator(task_id='dummy', dag=workflow) from airflow import DAGįrom _operator import DummyOperatorįrom _pod_operator import KubernetesPodOperator As an image I am using the hello-world example from Docker, which I pushed to the local registry of my MicroK8s installation. I am trying to spin up a testing Pod with the KubernetesPodOperator.
