Influxdb over Proxy. Split telegraf in host and net

This commit is contained in:
Florian Zirker 2022-03-06 18:33:13 +01:00
parent f0802c2242
commit c770df59f7
4 changed files with 304 additions and 186 deletions

View file

@ -16,7 +16,6 @@ services:
- "traefik.http.services.monitoring.loadbalancer.server.port=3000"
- "traefik.docker.network=web"
- "docker.group=monitoring"
restart: unless-stopped
environment:
- GF_DEFAULT_INSTANCE_NAME=monitoring.${DOMAIN}
- GF_SERVER_ROOT_URL=http://monitoring.${DOMAIN}
@ -38,7 +37,7 @@ services:
grafanadb:
image: postgres
image: postgres:13
volumes:
- ${VOLUMES_PATH}/grafanadb:/var/lib/postgresql/data
networks:
@ -53,11 +52,8 @@ services:
influxdb:
# image: arm32v7/influxdb
image: influxdb:1.8
restart: unless-stopped
ports:
- 8086:8086
networks:
- web
- monitoring
@ -67,13 +63,18 @@ services:
- ${VOLUMES_PATH}/influxdb/:/var/lib/influxdb
- ${PWD}/influxdb.conf:/etc/influxdb/influxdb.conf:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.influxdb.rule=Host(`influxdb.${DOMAIN}`)"
- "traefik.http.routers.influxdb.entrypoints=web"
- "traefik.http.services.influxdb.loadbalancer.server.port=8086"
- "traefik.docker.network=web"
- "docker.group=monitoring"
##################################################################
# here starts data collection
telegraf:
telegraf_host:
image: telegraf:1.18
restart: unless-stopped
environment:
@ -84,8 +85,7 @@ services:
- HOST_VAR=/hostfs/var
- HOST_RUN=/hostfs/run
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./telegraf/telegraf_host.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/utmp:/var/run/utmp:ro
- /:/hostfs:ro
network_mode: "host"
@ -93,10 +93,26 @@ services:
- "docker.group=monitoring"
depends_on:
- influxdb
telegraf_net:
image: telegraf:1.18
restart: unless-stopped
volumes:
- ./telegraf/telegraf_net.conf:/etc/telegraf/telegraf.conf:ro
networks:
- monitoring
- dockersocket
labels:
- "docker.group=monitoring"
depends_on:
- influxdb
dns:
- 9.9.9.9
- 192.168.16.5
networks:
monitoring:
web:
external: true
dockersocket:
external: true