deployment/stacks/monitor.yml

97 lines
2.0 KiB
YAML
Raw Normal View History

2021-12-18 10:35:43 +01:00
version: '3.4'
services:
prometheus:
2022-09-15 10:12:52 +02:00
image: 'prom/prometheus:v2.38.0'
2021-12-18 10:35:43 +01:00
user: root
deploy:
mode: 'replicated'
replicas: 1
placement:
constraints:
- 'node.labels.class == admin'
configs:
2022-04-04 17:18:27 +02:00
- source: prometheus_v7
2021-12-18 10:35:43 +01:00
target: /etc/prometheus/prometheus.yml
networks:
- 'default'
- 'monitoring'
volumes:
- 'prometheus:/prometheus'
- '/var/run/docker.sock:/var/run/docker.sock'
cadvisor:
2022-09-15 10:12:52 +02:00
image: 'gcr.io/cadvisor/cadvisor:v0.45.0'
2021-12-18 10:35:43 +01:00
deploy:
mode: 'global'
networks:
- 'monitoring'
volumes:
- '/:/rootfs:ro'
- '/var/run:/var/run:ro'
- '/sys:/sys:ro'
- '/var/lib/docker:/var/lib/docker:ro'
- '/dev/disk:/dev/disk:ro'
- '/var/run/docker.sock:/var/run/docker.sock:ro'
grafana:
2022-09-15 10:12:52 +02:00
image: 'grafana/grafana:9.1.5'
2021-12-18 10:35:43 +01:00
deploy:
mode: 'replicated'
replicas: 1
placement:
constraints:
- 'node.labels.class == admin'
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.grafana.rule=Host(`mon.rustybever.be`)'
- 'traefik.http.routers.grafana.tls=true'
- 'traefik.http.routers.grafana.tls.certresolver=letsEncrypt'
- 'traefik.http.services.grafana.loadbalancer.server.port=3000'
networks:
- 'default'
- 'public'
volumes:
- 'grafana:/var/lib/grafana'
node-exporter:
image: 'prom/node-exporter:v1.3.1'
2022-01-26 09:28:13 +01:00
hostname: srv-{{.Node.Hostname}}
2021-12-18 10:35:43 +01:00
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
deploy:
mode: 'global'
networks:
- 'monitoring'
volumes:
- '/proc:/host/proc:ro'
- '/sys:/host/sys:ro'
- '/:/rootfs:ro'
configs:
2022-04-04 17:18:27 +02:00
prometheus_v7:
2021-12-18 10:35:43 +01:00
external: true
networks:
public:
external: true
monitoring:
external: true
volumes:
prometheus:
grafana: