-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
122 lines (114 loc) · 2.89 KB
/
docker-compose.yaml
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
version: "3.8"
networks:
net:
driver: overlay
attachable: true
services:
statsd-exporter:
image: ${REGISTRY_ADDR}prom/statsd-exporter:v0.26.0
ports:
- "9102:9102"
volumes:
- ./statsd_mapping.yaml:/tmp/statsd_mapping.yaml
command:
- --statsd.mapping-config=/tmp/statsd_mapping.yaml
node-exporter:
image: ${REGISTRY_ADDR}prom/node-exporter:v1.7.0
networks:
- net
environment:
- NODE_ID={{.Node.ID}}
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /etc/hostname:/etc/nodename
command:
- '--path.sysfs=/host/sys'
- '--path.procfs=/host/proc'
- '--collector.textfile.directory=/etc/node-exporter/'
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
- '--no-collector.ipvs'
deploy:
mode: global
resources:
limits:
memory: 128M
reservations:
memory: 64M
prometheus:
image: ${REGISTRY_ADDR}bitnami/prometheus:2.50.0
networks:
- net
command:
- '--config.file=/etc/prometheus/prometheus.yaml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention=${PROMETHEUS_RETENTION:-14d}'
volumes:
- prometheus:/prometheus
configs:
- source: prom_scrape_conf
target: /etc/prometheus/prometheus.yaml
- source: node_rules
target: /etc/prometheus/swarm_node.rules.yaml
- source: task_rules
target: /etc/prometheus/swarm_task.rules.yaml
ports:
- 9090:9090
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
resources:
limits:
memory: 2048M
reservations:
memory: 128M
dockerd-exporter:
image: ${REGISTRY_ADDR}stefanprodan/caddy:0.10.10
networks:
- net
environment:
- DOCKER_GWBRIDGE_IP=172.18.0.1
configs:
- source: dockerd_config
target: /etc/caddy/Caddyfile
deploy:
mode: global
resources:
limits:
memory: 128M
reservations:
memory: 64M
cadvisor:
image: ${REGISTRY_ADDR}gcr.io/cadvisor/cadvisor:v0.49.1
networks:
- net
command: -logtostderr -docker_only
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /:/rootfs:ro
- /var/run:/var/run
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /proc:/host/proc:ro
deploy:
mode: global
resources:
limits:
memory: 128M
reservations:
memory: 64M
configs:
dockerd_config:
file: ./dockerd-exporter/Caddyfile
prom_scrape_conf:
file: ./prometheus/prometheus.yaml
node_rules:
file: ./prometheus/rules/swarm_node.rules.yaml
task_rules:
file: ./prometheus/rules/swarm_task.rules.yaml
volumes:
prometheus: {}