Skip to content

Instantly share code, notes, and snippets.

@kozikow
Created September 19, 2016 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kozikow/49c812f11d1e4fd43e465e8090619274 to your computer and use it in GitHub Desktop.
Save kozikow/49c812f11d1e4fd43e465e8090619274 to your computer and use it in GitHub Desktop.
Kubernetes local airflow setup
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
name: webserver
spec:
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: airflow
tier: webserver
name: webserver
spec:
containers:
- args:
- /usr/local/airflow/entrypoint.py
- webserver
env:
- name: AIRFLOW_HOME
value: /usr/local/airflow
image: gcr.io/all-the-codes/docker_airflow:0.3
imagePullPolicy: IfNotPresent
name: webserver
ports:
- containerPort: 8000
name: webserver-8000
resources: {}
volumeMounts:
- mountPath: /usr/local/airflow/dags
name: dag-directory-binding
readOnly: true
- mountPath: /home/user/.config
name: config-directory-binding
readOnly: true
restartPolicy: Always
volumes:
- hostPath:
path: /home/kozikow/git_repos/github/understandwork/docker_airflow/dags
name: dag-directory-binding
- hostPath:
path: /home/kozikow/.config
name: config-directory-binding
status: {}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
name: flower
spec:
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: airflow
tier: flower
name: flower
spec:
containers:
- args:
- /usr/local/airflow/entrypoint.py
- flower
env:
- name: AIRFLOW_HOME
value: /usr/local/airflow
- name: FLOWER_PORT
value: "5555"
image: gcr.io/all-the-codes/docker_airflow:0.3
imagePullPolicy: IfNotPresent
name: flower
ports:
- containerPort: 5555
name: flower-5555
resources: {}
volumeMounts:
- mountPath: /usr/local/airflow/dags
name: dag-directory-binding
readOnly: true
- mountPath: /home/user/.config
name: config-directory-binding
readOnly: true
restartPolicy: Always
volumes:
- hostPath:
path: /home/kozikow/git_repos/github/understandwork/docker_airflow/dags
name: dag-directory-binding
- hostPath:
path: /home/kozikow/.config
name: config-directory-binding
status: {}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
name: scheduler
spec:
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: airflow
tier: scheduler
name: scheduler
spec:
containers:
- args:
- /usr/local/airflow/entrypoint.py
- scheduler
env:
- name: AIRFLOW_HOME
value: /usr/local/airflow
image: gcr.io/all-the-codes/docker_airflow:0.3
imagePullPolicy: IfNotPresent
name: scheduler
resources: {}
volumeMounts:
- mountPath: /usr/local/airflow/dags
name: dag-directory-binding
readOnly: true
- mountPath: /home/user/.config
name: config-directory-binding
readOnly: true
restartPolicy: Always
volumes:
- hostPath:
path: /home/kozikow/git_repos/github/understandwork/docker_airflow/dags
name: dag-directory-binding
- hostPath:
path: /home/kozikow/.config
name: config-directory-binding
status: {}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
name: worker
spec:
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: airflow
tier: worker
name: worker
spec:
containers:
- args:
- kubectl
- proxy
- -p
- "8001"
image: gcr.io/all-the-codes/docker_base_arch:0.2
imagePullPolicy: IfNotPresent
name: kubectl
resources: {}
- args:
- /usr/local/airflow/entrypoint.py
- worker
env:
- name: AIRFLOW_HOME
value: /usr/local/airflow
- name: KUBERNETES_API_URL
value: http://127.0.0.1:8001
image: gcr.io/all-the-codes/docker_airflow:0.3
imagePullPolicy: IfNotPresent
name: worker
resources: {}
volumeMounts:
- mountPath: /usr/local/airflow/dags
name: dag-directory-binding
readOnly: true
- mountPath: /home/user/.config
name: config-directory-binding
readOnly: true
restartPolicy: Always
volumes:
- hostPath:
path: /home/kozikow/git_repos/github/understandwork/docker_airflow/dags
name: dag-directory-binding
- hostPath:
path: /home/kozikow/.config
name: config-directory-binding
status: {}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
name: postgres
spec:
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: airflow
tier: postgres
name: postgres
spec:
containers:
- env:
- name: POSTGRES_USER
value: airflow
- name: POSTGRES_PASSWORD
value: airflow
- name: POSTGRES_DB
value: airflow
image: postgres
imagePullPolicy: IfNotPresent
name: postgres
ports:
- containerPort: 5432
name: postgres-5432
resources: {}
volumeMounts:
- mountPath: /usr/local/airflow/dags
name: dag-directory-binding
readOnly: true
- mountPath: /home/user/.config
name: config-directory-binding
readOnly: true
restartPolicy: Always
volumes:
- hostPath:
path: /home/kozikow/git_repos/github/understandwork/docker_airflow/dags
name: dag-directory-binding
- hostPath:
path: /home/kozikow/.config
name: config-directory-binding
status: {}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
name: rabbitmq
spec:
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: airflow
tier: rabbitmq
name: rabbitmq
spec:
containers:
- env:
- name: RABBITMQ_DEFAULT_USER
value: airflow
- name: RABBITMQ_DEFAULT_PASS
value: airflow
- name: RABBITMQ_DEFAULT_VHOST
value: airflow
image: rabbitmq:3-management
imagePullPolicy: IfNotPresent
name: rabbitmq
ports:
- containerPort: 5672
name: rabbitmq-5672
- containerPort: 15672
name: rabbitmq-15672
resources: {}
volumeMounts:
- mountPath: /usr/local/airflow/dags
name: dag-directory-binding
readOnly: true
- mountPath: /home/user/.config
name: config-directory-binding
readOnly: true
restartPolicy: Always
volumes:
- hostPath:
path: /home/kozikow/git_repos/github/understandwork/docker_airflow/dags
name: dag-directory-binding
- hostPath:
path: /home/kozikow/.config
name: config-directory-binding
status: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: postgres
name: postgres
spec:
ports:
- name: postgres-5432
port: 5432
protocol: TCP
targetPort: postgres-5432
selector:
app: airflow
tier: postgres
type: ClusterIP
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: rabbitmq
name: rabbitmq
spec:
ports:
- name: rabbitmq-5672
port: 5672
protocol: TCP
targetPort: rabbitmq-5672
- name: rabbitmq-15672
port: 15672
protocol: TCP
targetPort: rabbitmq-15672
selector:
app: airflow
tier: rabbitmq
type: ClusterIP
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: webserver
name: webserver
spec:
ports:
- name: webserver-8000
port: 80
protocol: TCP
targetPort: webserver-8000
selector:
app: airflow
tier: webserver
type: LoadBalancer
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: flower
name: flower
spec:
ports:
- name: flower-5555
port: 80
protocol: TCP
targetPort: flower-5555
selector:
app: airflow
tier: flower
type: LoadBalancer
status:
loadBalancer: {}
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment