-
Notifications
You must be signed in to change notification settings - Fork 38
/
stack.yml
215 lines (203 loc) · 6.19 KB
/
stack.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
version: "3.1"
services:
monitor:
image: dockerflow/docker-flow-monitor:${TAG:-latest}
networks:
- proxy
- monitor
environment:
- ARG_WEB_EXTERNAL-URL=http://prometheus.dockerflow.com
- LISTENER_ADDRESS=swarm-listener
- ARG_ALERTMANAGER_URL=http://alert-manager:9093
volumes:
- prom:/data
deploy:
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.serviceDomain=prometheus.dockerflow.com
- com.df.httpsOnly=true
- com.df.port=9090
- com.df.usersPassEncrypted=false
- com.df.usersSecret=vfarcic
- com.df.alertName=mem_limit
- com.df.alertIf=@service_mem_limit:0.8
- com.df.alertFor=30s
resources:
reservations:
memory: 1750M
limits:
memory: 2250M
alert-manager:
image: prom/alertmanager
networks:
- monitor
secrets:
- alert_manager_config
command: --config.file=/run/secrets/alert_manager_config --storage.path=/alertmanager
swarm-listener:
image: dockerflow/docker-flow-swarm-listener
networks:
- monitor
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DF_NOTIFY_CREATE_SERVICE_URL=http://monitor:8080/v1/docker-flow-monitor/reconfigure
- DF_NOTIFY_REMOVE_SERVICE_URL=http://monitor:8080/v1/docker-flow-monitor/remove
deploy:
labels:
- com.df.alertName=mem_limit
- com.df.alertIf=@service_mem_limit:0.8
- com.df.alertFor=30s
placement:
constraints: [node.role == manager]
resources:
reservations:
memory: 10M
limits:
memory: 20M
docs:
image: dockerflow/docker-flow-monitor-docs:${TAG:-latest}
networks:
- proxy
deploy:
labels:
- com.df.distribute=true
- com.df.notify=true
- com.df.reschedule=true
- com.df.port=80
- com.df.serviceDomain=monitor.dockerflow.com
- com.df.servicePath=/
- com.df.alertName=mem_limit
- com.df.alertIf=@service_mem_limit:0.8
- com.df.alertFor=30s
replicas: 2
resources:
reservations:
memory: 10M
limits:
memory: 20M
# grafana:
# image: grafana/grafana:${GRAFANA_TAG:-4.6.0}
# networks:
# - infra_default
# - monitor
# environment:
# # - GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/grafana/
# - GF_SECURITY_ADMIN_USER=${GF_USER:-admin}
# - GF_SECURITY_ADMIN_PASSWORD=${GF_PASS:-admin}
# deploy:
# labels:
# - com.df.notify=true
# - com.df.distribute=true
# - com.df.serviceDomain=grafana.dockerflow.com
# - com.df.port=3000
cadvisor:
image: google/cadvisor:${CADVISOR_TAG:-latest}
networks:
- monitor
volumes:
- /:/rootfs
- /var/run:/var/run
- /sys:/sys
- /var/lib/docker:/var/lib/docker
deploy:
mode: global
labels:
- com.df.notify=true
- com.df.scrapePort=8080
- com.df.alertName=mem_limit
- com.df.alertIf=@service_mem_limit:0.8
- com.df.alertFor=30s
resources:
reservations:
memory: 40M
limits:
memory: 80M
node-exporter-manager:
image: basi/node-exporter:${NODE_EXPORTER_TAG:-v1.14.0}
networks:
- monitor
environment:
- HOST_HOSTNAME=/etc/host_hostname
- LOGSPOUT=ignore
volumes:
- /proc:/host/proc
- /sys:/host/sys
- /:/rootfs
- /etc/hostname:/etc/host_hostname
deploy:
mode: global
labels:
- com.df.notify=true
- com.df.scrapePort=9100
- com.df.alertName.1=mem_limit_manager
- com.df.alertIf.1=@node_mem_limit:0.9
- com.df.alertFor.1=30s
- com.df.alertName.2=node_mem_limit_total_above
- com.df.alertIf.2=@node_mem_limit_total_above:0.8
- com.df.alertFor.2=30s
- com.df.alertName.3=service_mem_limit
- com.df.alertIf.3=@service_mem_limit:0.8
- com.df.alertFor.3=30s
placement:
constraints:
- node.role == manager
resources:
reservations:
memory: 30M
limits:
memory: 50M
command: '-collector.procfs /host/proc -collector.sysfs /host/sys -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($$|/)" -collector.textfile.directory /etc/node-exporter/ -collectors.enabled="conntrack,diskstats,entropy,filefd,filesystem,loadavg,mdadm,meminfo,netdev,netstat,stat,textfile,time,vmstat,ipvs"'
node-exporter-worker:
image: basi/node-exporter:${NODE_EXPORTER_TAG:-v1.14.0}
networks:
- monitor
environment:
- HOST_HOSTNAME=/etc/host_hostname
- LOGSPOUT=ignore
volumes:
- /proc:/host/proc
- /sys:/host/sys
- /:/rootfs
- /etc/hostname:/etc/host_hostname
deploy:
mode: global
labels:
- com.df.notify=true
- com.df.scrapePort=9100
- com.df.alertName.1=mem_limit_worker
- com.df.alertIf.1=@node_mem_limit:0.9
- com.df.alertFor.1=30s
- com.df.alertName.2=node_mem_limit_total_above
- com.df.alertIf.2=@node_mem_limit_total_above:0.9
- com.df.alertFor.2=30s
- com.df.alertName.3=node_mem_limit_total_below
- com.df.alertIf.3=@node_mem_limit_total_below:0.4
- com.df.alertFor.3=30s
- com.df.alertName.4=service_mem_limit
- com.df.alertIf.4=@service_mem_limit:0.8
- com.df.alertFor.4=30s
placement:
constraints:
- node.role == worker
resources:
reservations:
memory: 30M
limits:
memory: 50M
command: '-collector.procfs /host/proc -collector.sysfs /host/sys -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($$|/)" -collector.textfile.directory /etc/node-exporter/ -collectors.enabled="conntrack,diskstats,entropy,filefd,filesystem,loadavg,mdadm,meminfo,netdev,netstat,stat,textfile,time,vmstat,ipvs"'
networks:
monitor:
external: true
proxy:
external: true
infra_default:
external: true
secrets:
alert_manager_config:
external: true
volumes:
prom:
driver: cloudstor:aws
external: false