-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathswarm-autoscaler-stack.yml
executable file
·77 lines (73 loc) · 1.78 KB
/
swarm-autoscaler-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
version: "3.7"
networks:
autoscale:
configs:
prometheus_config:
file: ./config.yml
services:
autoscaler:
image: ghcr.io/bearbobs/autoscaler:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- PROMETHEUS_URL=http://prometheus:9090
networks:
- autoscale
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
resources:
limits:
cpus: '0.10'
memory: 128M
reservations:
cpus: '0.10'
memory: 64M
cadvisor:
image: google/cadvisor:${CADVISOR_VERSION:-v0.25.0}
networks:
- autoscale
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
ports:
- 8888:8080
deploy:
mode: global
resources:
limits:
cpus: '0.10'
memory: 128M
reservations:
cpus: '0.10'
memory: 64M
prometheus:
image: prom/prometheus:v2.12.0
networks:
- autoscale
command: ["--storage.tsdb.retention.size=1GB", "--config.file=/etc/prometheus/config.yml", "--web.console.libraries=/etc/prometheus/console_libraries", "--web.console.templates=/etc/prometheus/consoles", "--web.enable-lifecycle"]
configs:
- source: prometheus_config
target: /etc/prometheus/config.yml
ports:
- 9999:9090
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
resources:
limits:
cpus: '0.50'
memory: 1024M
reservations:
cpus: '0.50'
memory: 128M