Accessing minikube via the KubernetesPodOperator in airflow

372 Views Asked by At

I am trying to make the airflow KubernetesPodOperator work with minikube. But unfortunately, the operator does not find the kubernetes cluster.

The dag returned to me the following error:

ERROR - HTTPSConnectionPool(host='192.168.49.2', port=8443): Max retries exceeded with url: /api/v1/namespaces/default/pods?labelSelector=dag_id%... (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9a63cdcc10>: Failed to establish a new connection: [Errno 110] Connection timed out'))

I suspect an error in my config file definition which you will find below. The server address I used is the one return by minikube ip.

apiVersion: v1
clusters:
- cluster:
    certificate-authority: ./ca.crt
    extensions:
    - extension:
        last-update: Tue, 26 Apr 2022 15:16:20 CEST
        provider: minikube.sigs.k8s.io
        version: v1.25.2
      name: cluster_info
    server: https://192.168.49.2:8443
  name: minikube
contexts:
- context:
    cluster: minikube
    extensions:
    - extension:
        last-update: Tue, 26 Apr 2022 15:16:20 CEST
        provider: minikube.sigs.k8s.io
        version: v1.25.2
      name: context_info
    namespace: default
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    client-certificate: ./client.crt
    client-key: ./client.key

Any ideas of what I could have done wrong?

Thanks!

0

There are 0 best solutions below