This repo helps you deploy airflow to a local kubernetes cluster.
- Install
kubectl
- Run a local kubernetes cluster (e.g. Docker Desktop, minikube)
- Install helm (e.g.
brew install helm
) - Point
kubectl
at your cluster (e.g.kubectl config use-context docker-desktop
) - Run
./install.sh
This will create an airflow
namespace and deploy airflow to it.
You can connect to the webserver by:
- Run
kubectl -n airflow port-forward svc/airflow-webserver 8080:8080
in a terminal- TODO: Fix stability with the port forward connection. Sometimes connections fail and you just have to keep retrying.
- Navigate your browser to: http://localhost:8080
- Login with user/pass:
admin
/admin
From the UI, you can create the DB connection:
- Go to Connections in the Admin tab
- Add a new connection:
- Connection Id:
local_pg_conn
- Connection Type:
Postgres
- Host:
postgres
- Database:
airflow
- Login:
airflow
- Password:
airflow
- Port:
5432
- Connection Id:
- Create
your_dag.py
- Run
kubectl -n airflow get pod
to get the name of the scheduler pod - Run
kubectl cp your_dag.py airflow/<scheduler-pod-name>:/opt/airflow/dags/your_dag.py -c scheduler
- Unpause the DAG in the UI
Run ./uninstall.sh
. It can take a long time for the namespace to be deleted.