Code Monkey home page Code Monkey logo

airflow-for-amazon-eks-blog's Introduction

Airflow Kubernetes Setup

The setup files are copied directly from airflow's repo and modified to fit the requirements.

Pre Req

  1. An EKS Cluster.
  2. Spot Managed Nodes on EKS Cluster with following setup:
    a. Label lifecycle: Ec2Spot.
    b. Taints spotInstance: true:PreferNoSchedule.
    c. InstancesDistribution as spotAllocationStrategy: capacity-optimized.
    d. Note: Without Spot Nodes, Jobs will run in OnDemand Nodes.
  3. An ECR Repo to Push Airflow Docker Images.

Steps

  1. Navigate to scripts\docker directory and build the Docker Image using docker build -t <ECR-uri:tag> .
  2. Push the image the ECR Repo using docker push <ECR-uri:tag>
  3. set the following environment variables on your terminal :
    a. export AOK_AIRFLOW_REPOSITORY=<ECR-uri>. \
  4. Navigate to scrips\kube directory and run the ./deploy.sh to deploy the kubernetes infrastructure for airflow.
  5. Obtain the airflow URL by running kubectl get svc -n airflow
  6. Log in the airflow using the above URL with eksuser as user and ekspassword as password.
  7. On your terminal, run kubectl get nodes --label-columns=lifecycle --selector=lifecycle=Ec2Spot to get a list of EC2.
  8. On your terminal, run kubectl get pods -n airflow -w -o wide.
  9. Trigger one of the DAGs in Airflow console to see the pods triggered for the job in airflow console.
  10. On your terminal, verify the pods are getting triggered in the same spot nodes with label lifecycle: Ec2Spot as in step 7.

airflow-for-amazon-eks-blog's People

Contributors

elamaran11 avatar realvz 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.