Bxl-swarm Monitoring

This commit is contained in:
Brieuc Dubois 2023-02-05 16:26:14 +01:00 committed by Bhasher
parent 819f0f31ad
commit 7189e4aad9
2 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,96 @@
version: '3.7'
services:
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
networks:
- monitoring
volumes:
- /mnt/nfs/prometheus/data:/prometheus
- /mnt/nfs/prometheus/config:/etc/prometheus
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
max_attempts: 3
placement:
constraints:
- node.labels.POWER == true
depends_on:
- system_nfs
grafana:
image: grafana/grafana:latest
networks:
- external
- monitoring
volumes:
- /mnt/nfs/grafana:/var/lib/grafana
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: any
max_attempts: 3
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(`grafana.bxl.bhasher.com`)"
- "traefik.http.routers.grafana.entrypoints=internalsecure"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
- "traefik.http.routers.grafana.tls=true"
- "traefik.http.routers.grafana.tls.certresolver=http"
placement:
constraints:
- node.labels.POWER == true
depends_on:
- system_nfs
- system_traefik
cadvisor:
image: zcube/cadvisor:latest
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
#ports:
# - 8088:8080
networks:
- monitoring
deploy:
mode: global
restart_policy:
condition: any
max_attempts: 3
node-exporter:
image: quay.io/prometheus/node-exporter:latest
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /:/host:ro,rslave
command:
- '--path.rootfs=/host'
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- --collector.filesystem.ignored-mount-points
- "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
#ports:
# - 9100:9100
networks:
- monitoring
deploy:
mode: global
restart_policy:
condition: any
max_attempts: 3
networks:
external:
external: true
monitoring:

View File

@ -6,6 +6,7 @@ services:
- /mnt/nfs/hass:/config - /mnt/nfs/hass:/config
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
networks: networks:
- smarthome
- external - external
deploy: deploy:
mode: replicated mode: replicated
@ -36,6 +37,7 @@ services:
- 1883:1883 - 1883:1883
- 9001:9001 - 9001:9001
networks: networks:
- smarthome
- external - external
deploy: deploy:
mode: replicated mode: replicated
@ -50,5 +52,6 @@ services:
- system_nfs - system_nfs
networks: networks:
smarthome:
external: external:
external: true external: true