Giter Site home page Giter Site logo

airflow-sneakers's Introduction

Airflow-ETL

Deploy Apache Airflow workflow with Helm Chart.

Requirements

  • Kubectl
  • Helm
  • Kind
  • Docker

Kind Installation

curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.15.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

Setup

# Create a kubernetes cluster of 1 control plane and 3 worker nodes
kind create cluster --name airflow-cluster --config kind-cluster.yaml
# Check the cluster info
kubectl cluster-info
# Check the nodes with kubectl
kubectl get nodes -o wide
# Add the official repository of the Airflow Helm Chart
helm repo add apache-airflow https://airflow.apache.org
# Update the repo
helm repo update
# Create namespace airflow
kubectl create namespace airflow
# Check the namespace 
kubectl get namespaces
# Install the Airflow Helm Chart
helm install airflow apache-airflow/airflow --namespace airflow --debug
# Get pods
kubectl get pods -n airflow
# Check release
helm ls -n airflow
# If for some reasons the release is stuck in pending-install or timed out
# Resinstall the chart
helm delete airflow --namespace airflow
helm install airflow apache-airflow/airflow --namespace airflow --debug —timeout 10m0s
# Port forward 8080:8080
kubectl port-forward svc/airflow-webserver 8080:8080 -n airflow --context kind-airflow-cluster

Debug

# 1. Delete the Helm release
helm delete airflow --namespace airflow

# 2. Check your PODs
kubectl get pods -n airflow

# 3. If airflow-migrations is in ContainerCreating state delete it
kubectl get jobs -n airflow
kubectl delete jobs <pods_name_of_airflow_migrations> -n airflow

# 4. Install the chart again
helm install airflow apache-airflow/airflow --namespace airflow --debug --timeout 10m0s

Get Values

Get the configuration file of the Helm chart make changes to Airflow instance in deployment.

# Get the Chart values
helm show values apache-airflow/airflow > values.yaml

Update Airflow deployment

# Check the current revision
helm ls -n airflow

# Upgrade the chart
helm upgrade --install airflow apache-airflow/airflow -n airflow -f values.yaml --debug

# Check after
helm ls -n airflow

Configure airflow instance

in the values.yaml file add

extraEnv: |
	- name: AIRFLOW__CORE__LOAD_EXAMPLES
		value: 'True'

Clear Everything

kind delete cluster --name airflow-cluster

Load Docker image on Kubernetes cluster

kind load docker-image <image name> --name <cluster name>

Create secret key in Kubernetes cluster

kubectl create secret generic <file name> --from-file=gitSshKey=<private ssh key location> -n airflow

airflow-sneakers's People

Contributors

deji01 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.