-
Notifications
You must be signed in to change notification settings - Fork 28
/
docker-compose.yml
368 lines (354 loc) · 9.33 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
version: '3.2'
services:
prometheus_one:
image: prom/prometheus:v2.21.0
container_name: prometheus_one
user: root
volumes:
- ./prometheus:/etc/config/
- ./data/prometheus/one:/data
command:
- '--config.file=/etc/config/prometheus_one.yml'
- '--storage.tsdb.path=/data'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=2h'
- '--web.enable-lifecycle'
- '--web.enable-admin-api'
- '--web.listen-address=:9001'
- '--storage.tsdb.min-block-duration=5m'
- '--storage.tsdb.max-block-duration=5m'
restart: unless-stopped
expose:
- 9001
ports:
- "9001:9001"
prometheus_two:
image: prom/prometheus:v2.21.0
container_name: prometheus_two
user: root
volumes:
- ./prometheus:/etc/config/
- ./data/prometheus/two:/data
command:
- '--config.file=/etc/config/prometheus_two.yml'
- '--storage.tsdb.path=/data'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=2h'
- '--web.enable-lifecycle'
- '--web.enable-admin-api'
- '--web.listen-address=:9002'
- '--storage.tsdb.min-block-duration=5m'
- '--storage.tsdb.max-block-duration=5m'
restart: unless-stopped
expose:
- 9002
minio:
image: minio/minio:RELEASE.2020-09-10T22-02-45Z
container_name: minio
volumes:
- ./data/minio:/data
ports:
- "9000:9000"
environment:
MINIO_PROMETHEUS_AUTH_TYPE: public
MINIO_ACCESS_KEY: myaccesskey
MINIO_SECRET_KEY: mysecretkey
command: server /data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
thanos_sidecar_one:
build:
context: ./thanos
dockerfile: Dockerfile.thanos
container_name: thanos_sidecar_one
volumes:
- ./prometheus:/etc/config/
- ./data/prometheus/one:/data
command:
- "/wait-for-it.sh"
- "prometheus_one:9001"
- "--"
- "/thanos"
- "sidecar"
- "--log.level=debug"
- "--tsdb.path=/data"
- "--prometheus.url=http://prometheus_one:9001"
- "--reloader.config-file=/etc/config/prometheus_one.yml"
- |
--objstore.config=type: S3
config:
bucket: thanos-data-bucket
access_key: myaccesskey
secret_key: mysecretkey
endpoint: minio:9000
insecure: true
expose:
- 10902
- 10901
depends_on:
- minio
thanos_sidecar_two:
build:
context: ./thanos
dockerfile: Dockerfile.thanos
container_name: thanos_sidecar_two
volumes:
- ./prometheus:/etc/config/
- ./data/prometheus/two:/data
command:
- "/wait-for-it.sh"
- "prometheus_two:9002"
- "--"
- "/thanos"
- "sidecar"
- "--log.level=debug"
- "--tsdb.path=/data"
- "--prometheus.url=http://prometheus_two:9002"
- "--reloader.config-file=/etc/config/prometheus_two.yml"
- |
--objstore.config=type: S3
config:
bucket: thanos-data-bucket
access_key: myaccesskey
secret_key: mysecretkey
endpoint: minio:9000
insecure: true
expose:
- 10902
- 10901
depends_on:
- minio
thanos_querier:
build:
context: ./thanos
dockerfile: Dockerfile.thanos
container_name: thanos_querier
command:
- "/wait-for-it.sh"
- "thanos_sidecar_one:10901"
- "--"
- "/thanos"
- "query"
- "--log.level=debug"
- "--log.format=logfmt"
- "--store=thanos_sidecar_one:10901"
- "--store=thanos_sidecar_two:10901"
- "--store=thanos_store:10901"
# - "--store=thanos_rule:10901"
- "--store.sd-interval=5m"
- "--query.replica-label=monitor"
expose:
- 10902
- 10901
ports:
- "10902:10902"
depends_on:
- minio
thanos_query_frontend:
build:
context: ./thanos
dockerfile: Dockerfile.thanos
container_name: thanos_query_frontend
command:
- "/wait-for-it.sh"
- "thanos_querier:10901"
- "--"
- "/thanos"
- "query-frontend"
- "--log.level=debug"
- "--log.format=logfmt"
- "--http-address=0.0.0.0:19090"
- "--query-frontend.compress-responses"
- "--query-range.partial-response"
- "--query-frontend.downstream-url=http://thanos_querier:10902"
- "--query-range.split-interval=24h"
- "--query-range.max-retries-per-request=5"
- "--query-frontend.log-queries-longer-than=5s"
- "--cache-compression-type=snappy"
ports:
- "19090:19090"
depends_on:
- thanos_querier
thanos_compactor:
build:
context: ./thanos
dockerfile: Dockerfile.thanos
container_name: thanos_compactor
volumes:
- ./data/compactor:/data
command:
- "/wait-for-it.sh"
- "minio:9000"
- "--"
- "/thanos"
- "compact"
- "--log.level=debug"
- "--log.format=logfmt"
- |
--objstore.config=type: S3
config:
bucket: thanos-data-bucket
access_key: myaccesskey
secret_key: mysecretkey
endpoint: minio:9000
insecure: true
- "--data-dir=/data"
- "--consistency-delay=30m"
- "--retention.resolution-raw=30d"
- "--retention.resolution-5m=120d"
- "--retention.resolution-1h=1y"
- "--block-sync-concurrency=20"
- "--compact.concurrency=1"
- "--delete-delay=15m"
- "--wait"
- "--wait-interval=3m"
expose:
- 10902
- 10901
ports:
- "10922:10902"
depends_on:
- minio
thanos_store:
build:
context: ./thanos
dockerfile: Dockerfile.thanos
container_name: thanos_store
volumes:
- ./data/store:/data
command:
- "/wait-for-it.sh"
- "minio:9000"
- "--"
- "/thanos"
- "store"
- "--log.level=debug"
- |
--objstore.config=type: S3
config:
bucket: thanos-data-bucket
access_key: myaccesskey
secret_key: mysecretkey
endpoint: minio:9000
insecure: true
- "--data-dir=/data"
- "--log.format=logfmt"
- "--index-cache-size=250MB"
- "--chunk-pool-size=1GB"
- "--store.grpc.series-max-concurrency=20"
- "--sync-block-duration=3m"
- "--block-sync-concurrency=20"
restart: unless-stopped
expose:
- 10902
- 10901
depends_on:
- minio
ports:
- '10912:10902'
# alertmanager:
# image: prom/alertmanager:v0.21.0
# container_name: alertmanager
# user: root
# volumes:
# - ./prometheus:/etc/config/
# - ./data/prometheus/alertmanager:/data
# command:
# - '--config.file=/etc/config/alertmanager.yml'
# restart: unless-stopped
# expose:
# - 9093
# ports:
# - "9093:9093"
# thanos_rule:
# build:
# context: ./thanos
# dockerfile: Dockerfile.thanos
# container_name: thanos_rule
# volumes:
# - ./data/rule:/data
# - ./thanos/rule:/etc/config/
# command:
# - "/wait-for-it.sh"
# - "minio:9000"
# - "--"
# - "/thanos"
# - "rule"
# - "--log.level=debug"
# - |
# --objstore.config=type: S3
# config:
# bucket: thanos-data-bucket
# access_key: myaccesskey
# secret_key: mysecretkey
# endpoint: minio:9000
# insecure: true
# - "--data-dir=/data"
# - "--log.format=logfmt"
# - "--rule-file=/etc/config/rules.yml"
# - "--alert.query-url=http://localhost:10902"
# - "--alertmanagers.url=http://alertmanager:9093"
# - "--query=thanos_querier:10902"
# expose:
# - 10902
# - 10901
# depends_on:
# - minio
# ports:
# - '10932:10902'
# grafana:
# image: grafana/grafana:7.4.5
# container_name: grafana
# user: root
# volumes:
# - ./grafana/provisioning:/provisioning
# environment:
# - GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
# - GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
# - GF_USERS_ALLOW_SIGN_UP=false
# - GF_PATHS_PROVISIONING=/provisioning
# restart: unless-stopped
# ports:
# - "3000:3000"
# bucket_web:
# build:
# context: ./thanos
# dockerfile: Dockerfile.thanos
# container_name: bucket_web
# command:
# - "/thanos"
# - "tools"
# - "bucket"
# - "web"
# - |
# --objstore.config=type: S3
# config:
# bucket: thanos-data-bucket
# access_key: myaccesskey
# secret_key: mysecretkey
# endpoint: minio:9000
# insecure: true
# - "--http-address=0.0.0.0:8080"
# - "--label=monitor"
# expose:
# - 8080
# ports:
# - "8080:8080"
# debug:
# build:
# context: thanos
# dockerfile: Dockerfile.debug
# container_name: debug
# user: root
# stdin_open: true
# tty: true
# expose:
# - 10902
# - 10901
# ports:
# - "10902:10902"