forked from vegasbrianc/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Traefik implementation (vegasbrianc#128)
* Version bump and organize deploy sections Signed-off-by: Brian Christner <[email protected]> * Updated stack Grafana and labels for Traefik Signed-off-by: Brian Christner <[email protected]> * Fixing YAML issues :( Signed-off-by: Brian Christner <[email protected]> * port conflict Signed-off-by: Brian Christner <[email protected]> * updated networks Signed-off-by: Brian Christner <[email protected]> * Added Traefik section to README Signed-off-by: Brian Christner <[email protected]>
- Loading branch information
1 parent
bf37977
commit f61a390
Showing
4 changed files
with
216 additions
and
9 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: '3.1' | ||
version: '3.7' | ||
|
||
volumes: | ||
prometheus_data: {} | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
version: '3.7' | ||
|
||
volumes: | ||
prometheus_data: {} | ||
grafana_data: {} | ||
|
||
networks: | ||
monitor-net: | ||
driver: overlay | ||
name: inbound | ||
traefik: | ||
driver: overlay | ||
name: traefik | ||
|
||
services: | ||
traefik: | ||
image: traefik:v1.7.12-alpine | ||
command: | ||
- "--logLevel=DEBUG" | ||
- "--api" | ||
- "--metrics" | ||
- "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0" | ||
- "--docker" | ||
- "--docker.swarmMode" | ||
- "--docker.domain=docker.localhost" | ||
- "--docker.watch" | ||
networks: | ||
- traefik | ||
- monitor-net | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
ports: | ||
- target: 80 | ||
published: 80 | ||
mode: host | ||
- target: 443 | ||
published: 443 | ||
mode: host | ||
- target: 8080 | ||
published: 8080 | ||
protocol: tcp | ||
mode: ingress | ||
deploy: | ||
mode: global | ||
placement: | ||
constraints: | ||
- node.role == manager | ||
update_config: | ||
parallelism: 1 | ||
delay: 10s | ||
restart_policy: | ||
condition: on-failure | ||
|
||
prometheus: | ||
image: prom/prometheus | ||
volumes: | ||
- ./prometheus/:/etc/prometheus/ | ||
- prometheus_data:/prometheus | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
- '--storage.tsdb.path=/prometheus' | ||
- '--web.console.libraries=/usr/share/prometheus/console_libraries' | ||
- '--web.console.templates=/usr/share/prometheus/consoles' | ||
networks: | ||
- monitor-net | ||
deploy: | ||
placement: | ||
constraints: | ||
- node.role==manager | ||
labels: | ||
- "traefik.frontend.rule=Host:prometheus.localhost" | ||
- "traefik.backend=prometheus" | ||
- "traefik.port=9090" | ||
- "traefik.docker.network=traefik" | ||
restart_policy: | ||
condition: on-failure | ||
|
||
node-exporter: | ||
image: prom/node-exporter | ||
volumes: | ||
- /proc:/host/proc:ro | ||
- /sys:/host/sys:ro | ||
- /:/rootfs:ro | ||
command: | ||
- '--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: | ||
- monitor-net | ||
deploy: | ||
mode: global | ||
restart_policy: | ||
condition: on-failure | ||
|
||
alertmanager: | ||
image: prom/alertmanager | ||
ports: | ||
- 9093:9093 | ||
volumes: | ||
- "./alertmanager/:/etc/alertmanager/" | ||
networks: | ||
- monitor-net | ||
command: | ||
- '--config.file=/etc/alertmanager/config.yml' | ||
- '--storage.path=/alertmanager' | ||
deploy: | ||
placement: | ||
constraints: | ||
- node.role==manager | ||
restart_policy: | ||
condition: on-failure | ||
|
||
cadvisor: | ||
image: google/cadvisor | ||
volumes: | ||
- /:/rootfs:ro | ||
- /var/run:/var/run:rw | ||
- /sys:/sys:ro | ||
- /var/lib/docker/:/var/lib/docker:ro | ||
ports: | ||
- 8088:8080 | ||
networks: | ||
- monitor-net | ||
deploy: | ||
mode: global | ||
restart_policy: | ||
condition: on-failure | ||
|
||
grafana: | ||
image: grafana/grafana | ||
depends_on: | ||
- prometheus | ||
volumes: | ||
- grafana_data:/var/lib/grafana | ||
- ./grafana/provisioning/:/etc/grafana/provisioning/ | ||
env_file: | ||
- ./grafana/config.monitoring | ||
networks: | ||
- monitor-net | ||
user: "104" | ||
deploy: | ||
placement: | ||
constraints: | ||
- node.role==manager | ||
labels: | ||
- "traefik.frontend.rule=Host:grafana.localhost" | ||
- "traefik.backend=grafana" | ||
- "traefik.port=3000" | ||
- "traefik.docker.network=traefik" | ||
restart_policy: | ||
condition: on-failure |