Last active
March 22, 2021 20:01
-
-
Save cdelaitre/85949d8b697359a319e30a678e23d8bd to your computer and use it in GitHub Desktop.
Monitor Docker Swarm with the InfluxData TICK Stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
# FRONT | |
chronograf: | |
# Full tag list: https://hub.docker.com/r/library/chronograf/tags/ | |
image: chronograf | |
deploy: | |
replicas: 1 | |
placement: | |
constraints: | |
- node.role == manager | |
restart_policy: | |
condition: on-failure | |
volumes: | |
# Mount for chronograf database | |
- chronograf-data:/var/lib/chronograf | |
ports: | |
# The WebUI for Chronograf is served on port 8888 | |
- "8888:8888" | |
networks: | |
- influx | |
depends_on: | |
- kapacitor | |
- influxdb | |
# MIDDLE | |
kapacitor: | |
# Full tag list: https://hub.docker.com/r/library/kapacitor/tags/ | |
image: kapacitor | |
deploy: | |
replicas: 1 | |
placement: | |
constraints: | |
- node.role == manager | |
restart_policy: | |
condition: on-failure | |
volumes: | |
# Mount for kapacitor data directory | |
- kapacitor-data:/var/lib/kapacitor | |
# Mount for kapacitor configuration | |
- /etc/kapacitor/config:/etc/kapacitor | |
ports: | |
# The API for Kapacitor is served on port 9092 | |
- "9092:9092" | |
networks: | |
- influx | |
depends_on: | |
- influxdb | |
# BACK | |
telegraf: | |
# Full tag list: https://hub.docker.com/r/library/telegraf/tags/ | |
image: telegraf | |
deploy: | |
mode: global | |
restart_policy: | |
condition: on-failure | |
volumes: | |
# Mount for telegraf configuration | |
- /etc/telegraf:/etc/telegraf | |
# Mount for Docker API access | |
- /var/run/docker.sock:/var/run/docker.sock | |
networks: | |
- influx | |
depends_on: | |
- influxdb | |
# DATABASE | |
influxdb: | |
# Full tag list: https://hub.docker.com/r/library/influxdb/tags/ | |
image: influxdb | |
deploy: | |
replicas: 1 | |
placement: | |
constraints: | |
- node.role == manager | |
restart_policy: | |
condition: on-failure | |
volumes: | |
# Mount for influxdb data directory | |
- influxdb-data:/var/lib/influxdb | |
# Mount for influxdb configuration | |
- /etc/influxdb/config:/etc/influxdb | |
ports: | |
# The API for InfluxDB is served on port 8086 | |
- "8086:8086" | |
networks: | |
- influx | |
networks: | |
influx: | |
volumes: | |
chronograf-data: | |
kapacitor-data: | |
influxdb-data: |
Thanks, I've updated the stack with the new official chronograf image.
Hello, thanks for sharing this stack-file. I've just made a fork and updated things for docker stack - deployments.
I think this file should be updated with the fork - for it is linked in the official influx docs.
Here it is: https://gist.github.com/rdxmb/cfc9a6bec31b36048ba2cfd8a908e198
What I have changed:
- update the docker-compose-version to the actual
3.4
-> https://docs.docker.com/compose/compose-file/ - remove the
depends_on
keys, as they were ignored with usingdocker stack deploy
-> https://docs.docker.com/compose/compose-file/#depends_on - remove the definitions of the
network
- fordocker stack
creates the network itself - remove the
restart_policy
, for it seems a good solution to work withalways
, which is the default -> https://docs.docker.com/compose/compose-file/#restart_policy
Kind regards!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This looks awesome! I would definitely advise taking the sample documentation server out of there. Also we now ship an official chronograf image. If you ever have any issues pop over to community.influxdata.com!