apiVersion: v1
kind: ReplicationController
metadata:
  name: airflow
  labels:
    app: airflow
spec:
  replicas: 1
  selector:
    name: airflow
  template:
    metadata:
      labels:
        name: airflow
    spec:
      containers:
      - name: airflow
        image: fluxcapacitor/scheduler-airflow
        imagePullPolicy: "Never"
        env:
        - name: GET_HOSTS_FROM
          value: env
        - name: AIRFLOW__CORE__SQL_ALCHEMY_CONN
          value: mysql+mysqldb://root:password@mysql-master:3306/airflow
        - name: SPARK_MASTER
          value: spark://spark-master-2-0-1:7077
        - name: SPARK_SUBMIT_ARGS
          value: "--conf spark.cores.max=2 --conf spark.executor.memory=2g --packages com.amazonaws:aws-java-sdk:1.7.4,org.apache.hadoop:hadoop-aws:2.7.1,org.apache.spark:spark-streaming-kafka-0-10_2.11:2.0.1 --jars /root/lib/jpmml-sparkml-package-1.0-SNAPSHOT.jar --py-files /root/lib/jpmml.py"
        ports:
        - containerPort: 8080
        - containerPort: 5000
      nodeSelector:
        training: "true"
