-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
145 lines (136 loc) · 3.13 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
version: '3.6'
x-airflow-image: &ref_airflow_image
image: local/airflow:local
build:
context: ./docker/airflow
dockerfile: Dockerfile
labels:
tld.local: local
network: host
args:
KUBERNETES_VERSION: 1.19.2
x-airflow-common: &ref_airflow_common
stdin_open: true
entrypoint:
- "/usr/bin/dumb-init"
- "--"
environment:
AIRFLOW__CORE__FERNET_KEY: qykO1whjCf2vZQsfFevdfSf2eegO6ErT9pFqkx3kZdg=
volumes:
- ./dags:/opt/airflow/dags:ro
- ./volumes/logs:/opt/airflow/logs:rw
- ./volumes/config/airflow.cfg:/opt/airflow/airflow.cfg:ro
- ./volumes/config/podtemplate.yml:/opt/airflow/podtemplate.yml:ro
- ./volumes/kubeconfig:/home/airflow/.kube/config:ro
stop_grace_period: 1s
services:
postgres:
container_name: airflow-postgres
image: "postgres:12"
environment:
POSTGRES_DB: airflow
POSTGRES_PASSWORD: airflow
POSTGRES_USER: airflow
volumes:
- postgres-airflow:/var/lib/postgresql/data
expose:
- 5432
restart: on-failure
stop_grace_period: 3s
dns:
container_name: airflow-dns
image: coredns/coredns:1.7.1
command:
- -conf
- /etc/Coredns
expose:
- "53/udp"
networks:
default:
ipv4_address: 10.254.254.254
volumes:
- "./volumes/dns/Corefile:/etc/Coredns:ro"
restart: on-failure
stop_grace_period: 1s
registry:
container_name: airflow-registry
image: registry:2.7.1
expose:
- "80"
networks:
default:
ipv4_address: 10.254.254.253
volumes:
- "./volumes/registry/config.yml:/etc/docker/registry/config.yml:ro"
kubernetes:
container_name: airflow-kubernetes
build:
context: ./docker/kind
dockerfile: Dockerfile
labels:
tld.local: local
network: host
args:
KUBERNETES_VERSION: 1.19.2
KIND_VERSION: 0.9.0
image: local/kind:local
privileged: true
entrypoint:
- sh
- -c
command:
- |
echo nameserver 10.254.254.254 > /etc/resolv.conf
exec dockerd-entrypoint.sh
ports:
- "6443:6443"
- "8008:30080"
dns:
- "10.254.254.254"
extra_hosts:
- "kubernetes:127.0.0.1"
volumes:
- ./dags:/mnt/kubernetes/dags:ro
- ./volumes/logs:/mnt/kubernetes/logs:rw
- ./volumes/kubeconfig:/root/.kube/config:rw
- ./volumes/config/daemon.json:/etc/docker/daemon.json:ro
- ./volumes/config/airflow.worker.cfg:/mnt/kubernetes/airflow-config/airflow.cfg:ro
stop_grace_period: 1s
depends_on:
- dns
- registry
web:
<<: *ref_airflow_image
<<: *ref_airflow_common
container_name: airflow-web
command:
- "bash"
- "-c"
- |
airflow initdb
exec airflow webserver
ports:
- "8080:8080"
depends_on:
- postgres
restart: on-failure
scheduler:
<<: *ref_airflow_image
<<: *ref_airflow_common
container_name: airflow-scheduler
command:
- "airflow"
- "scheduler"
depends_on:
- postgres
- web
- kubernetes
restart: on-failure
volumes:
postgres-airflow: {}
networks:
default:
name: airflow
ipam:
config:
- subnet: 10.254.254.0/24