Giter Site home page Giter Site logo

harry-cai / airflow-kubernetes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from email2liyang/airflow-kubernetes

0.0 1.0 0.0 54 KB

deploy airflow cluster into kubernetes cluster with CeleryExecutor

License: Apache License 2.0

Dockerfile 32.60% Makefile 2.68% Python 13.15% Shell 51.57%

airflow-kubernetes's Introduction

airflow-kubernetes

deploy airflow into kubernetes env with both LocalExecutor and CeleryExecutor Support, the orignal docker build file is from https://github.com/puckel/docker-airflow. but with some modification to make it work in kubernetes.

Information

please checkout https://github.com/puckel/docker-airflow for how to use the docker image

  • we use mysql as backend rather than postgresql due to testing RBAC with postgresql is not successful
  • we use rabbitmq as broker rather than postgresql
  • we've implemnet a SystemV style of init script, is user copy anything in /usr/local/airflow/config/init/ of docker contianer , it will be executed before webserver started, this is a perfect place to init airflow variables and connections etc
  • we've implemnet a SystemV style of super-init script, is user copy anything in /usr/local/airflow/config/super-init/ of docker contianer , it will be executed before webserver started , as root, this is a perfect place to init airflow under root user, e.g: fix the hostname and ip mapping issue in /etc/hosts
  • we for CeleryExecutor, we have flower enabled to check the task stats

Build Docker Images

Airflow Image
cd docker-airflow
docker build -t caijiawei/docker-airflow:1.10.10 .
MySQL Image
cd docker-mysql
docker build -t caijiawei/docker-mysql:5.7.24 .

Kubernetes

kubectl apply -f KubernetesLocalExecutor.yaml
  • install airflow with CeleryExecutor
kubectl apply -f KubernetesCeleryExecutor.yaml

FAQ

  • how to enalbe live log browsing in kubernetes env? use super-init system to grab the hostname and ip mapping in kubernetes and put it in /etc/hosts e.g: have a script named "init_worker_hostnames.sh" and put it under /usr/local/airflow/config/super-init/ with logic below
#!/usr/bin/env bash

kubectl get po -n xx -o wide | grep xx-my-airflow-worker | awk '{printf("%s\t%s\n",$6,$1)}' >> /etc/hosts

airflow-kubernetes's People

Contributors

email2liyang avatar

Watchers

James Cloos 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.