Setup local Airflow running on Minikube
Setup local Airflow running on Minikube
This note assumes OSX as development environment.
Requirements
Configuring Minikube
Install Minikube
Install Kubectl
Start Minikube cluster with hyperkit
(default VM driver).
If you are running on a virtual machine, which does not support hyperkit
natively, please install virtualbox
then start Minikube cluster again with virtualbox
as driver.
The ~/.kube/config
contains configurations of clusters so that kubectl
can interact with. Let use Minkube instead of any other clustering contexts.
Review status of Minikube cluster
Cross validate that kubectl
is configured to communicate with youre expected Kubernetes
on Minikube cluster
Open Kubernetes dashboard
Preparing Airflow image
Our customized Airflow image is on Google Container Registry,so that you need an authorized Google account. There are two options
- (Not recommended !!!!) Setting up Docker environment on a VM running within Minikube cluster is an option but you need to re-setup everytime after the VM is purged or corrupted.
- Let set the Docker environment from the host machine to that Minikube VM
Then
If your docker client is above 18.03, the command gcloud dockeris not supported. Here it is [deprecation-notices](https://cloud.google.com/container-registry/docs/support/deprecation-notices). In that case:
Initializing Helm
Initialize the local CLI and also install Tiller into your Kubernetes cluster.
Let create a service account named Tiller
and give its permission to create/delete resources on a cluster, namely cluster-admin
Note that, Helm
is CLI and Tiller
is server side of Helm Chart.
Deploying Airflow on Minikube
- Mounting DAGs folders Mounting a DAGs folder into the Minikube
This folder with be forwarded (mounted) into the running pod.
- Deploying Airflow with Helm
Cleaning
Optionally, force removal of the Docker images created:
Stop the Minikube VM:
Optionally, delete the Minikube VM to save disk space