-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
159 lines (153 loc) · 4.4 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
version: '3.8'
networks:
monitoring:
driver: overlay
driver_opts:
encrypted: ""
attachable: true
name: monitoring
volumes:
vmagent_data:
vmgateway_data:
grafana-storage:
caddy_data:
external: true
caddy_config:
services:
# The services listed below are a part of the monitoring gateway
#
# grafana is a single instance installation of grafana to display the metrics in a dashboard format
grafana:
image: grafana/grafana-oss
volumes:
- grafana-storage:/var/lib/grafana
networks:
- monitoring
environment:
GF_SECURITY_ADMIN_PASSWORD__FILE: "/run/secrets/gf_admin_password"
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: "/etc/grafana/provisioning/dashboards.d/home.json"
GF_SERVER_DOMAIN: "${MAIS_DOMAIN}"
GF_SERVER_ROOT_URL: "https://${MIAS_DOMAIN}"
secrets:
- gf_admin_password
configs:
- source: gfautomaticdashboard
target: /etc/grafana/provisioning/dashboards/automatic.yml
- source: gfhomedashboard
target: /etc/grafana/provisioning/dashboards.d/home.json
- source: gfdatasource
target: /etc/grafana/provisioning/datasources/automatic.yml
depends_on:
- caddy
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.labels.monitoringrole == gateway
max_replicas_per_node: 1
resources:
limits:
memory: 1G
# vmgateway is a single node "gateway" instance of victoriametrics. Replication and multiple gateways are unsupported in this stack
#
# vmgateway only runs on nodes that have been labeled with monitoringrole set to gateway
vmgateway:
image: victoriametrics/victoria-metrics:v1.76.1
volumes:
- vmgateway_data:/opt/vmgateway/storage
command:
- '-promscrape.config=./prometheus.yml'
- '-storageDataPath=/opt/vmgateway/storage'
- '-httpListenAddr=0.0.0.0:8428'
networks:
- monitoring
configs:
- source: vmgateway
target: /prometheus.yml
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.labels.monitoringrole == gateway
max_replicas_per_node: 1
resources:
limits:
memory: 512M
# caddyserver is a reverse proxy featuring automatic letsencrypt certificates. It is used to expose the Grafana dashboard to the Internet.
caddy:
image: caddy:latest
ports:
- "80:80"
- "443:443"
volumes:
- caddy_data:/data
- caddy_config:/config
networks:
- monitoring
environment:
MIAS_DOMAIN: ${MIAS_DOMAIN}
configs:
- source: caddy
target: /etc/caddy/Caddyfile
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.labels.monitoringrole == gateway
max_replicas_per_node: 1
resources:
limits:
memory: 512M
# The services listed below are part of the monitoring agent
#
# vmagent is a bundled multi-service image that scrapes metrics exported from node-exporter and then pushes them to the remote victory-metrics gateway node
vmagent:
image: keith/mias-agent:v0.0.2
volumes:
- vmagent_data:/opt/vmagent/storage
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
environment:
# We replace the "job" value to the friendlier node hostname so that it appears as such in the Grafana dashboard
VMAGENT_JOB: "{{.Node.Hostname}}"
depends_on:
- vmgateway
networks:
- monitoring
configs:
- source: vmagent
target: /project/prometheus.yml
deploy:
mode: global
resources:
limits:
memory: 512M
configs:
vmagent:
template_driver: golang
file: ./vmagent/configs/prometheus.yml.tmpl
external: false
vmgateway:
template_driver: golang
file: ./vmgateway/configs/prometheus.yml.tmpl
external: false
gfautomaticdashboard:
file: ./vmgateway/configs/provisioning/dashboards/automatic.yml
external: false
gfhomedashboard:
file: ./vmgateway/configs/provisioning/dashboards.d/home.json
external: false
gfdatasource:
file: ./vmgateway/configs/provisioning/datasources/automatic.yml
external: false
caddy:
template_driver: golang
file: ./caddy/configs/Caddyfile.tmpl
external: false
secrets:
gf_admin_password:
file: ./vmgateway/secrets/gf_admin_password.txt