-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
178 lines (172 loc) · 4.83 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
version: '3.8'
networks:
monitoring:
external:
name: "host"
attachable: true
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}"
MIAS_DOMAIN: ${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
ports:
- target: 3000
published: 3000
protocol: tcp
mode: host
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
ports:
- target: 8428
published: 8428
protocol: tcp
mode: host
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
volumes:
- caddy_data:/data
- caddy_config:/config
networks:
- monitoring
environment:
MIAS_DOMAIN: ${MIAS_DOMAIN}
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
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-host:v0.0.1
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}}"
MIAS_DOMAIN: ${MIAS_DOMAIN}
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:
template_driver: golang
file: ./vmgateway/configs/provisioning/dashboards/automatic.yml
external: false
gfhomedashboard:
template_driver: golang
file: ./vmgateway/configs/provisioning/dashboards.d/home.json
external: false
gfdatasource:
template_driver: golang
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