make bind mounts readonly, you don't want some node-exporter vulnerability lead to write access on your node

fix collector.sysfs mistakenly use /host/sysfs eventhough sysfs is mounted on /host/sys
fix ignored mountpoints to work with bind mounts
add ignored fs-types to not display a lot of useless NaN and 0 metrics for mounts related to docker
put CLI arguments for command parameter in one value definition, seems like a bug in docker compose, only the first element in an array of commands is used
This commit is contained in:
Nikolaus 2017-04-16 10:29:29 +04:00
parent 4d2cf49437
commit 4a71bfb08b

View File

@ -32,18 +32,15 @@ services:
- cadvisor - cadvisor
networks: networks:
- back-tier - back-tier
node-exporter: node-exporter:
container_name: node-exporter container_name: node-exporter
image: prom/node-exporter image: prom/node-exporter
volumes: volumes:
- /proc:/host/proc - /proc:/host/proc:ro
- /sys:/host/sys - /sys:/host/sys:ro
- /:/rootfs - /:/rootfs:ro
command: command: '-collector.procfs=/host/proc -collector.sysfs=/host/sys -collector.filesystem.ignored-mount-points="^(/rootfs|/host|)/(sys|proc|dev|host|etc)($$|/)" collector.filesystem.ignored-fs-types="^(sys|proc|auto|cgroup|devpts|ns|au|fuse\.lxc|mqueue)(fs|)$$"'
- '-collector.procfs=/host/proc'
- '-collector.sysfs=/host/sysfs'
- '-collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)($$|/)"'
expose: expose:
- 9100 - 9100
networks: networks:
@ -52,14 +49,14 @@ services:
image: prom/alertmanager image: prom/alertmanager
ports: ports:
- 9093:9093 - 9093:9093
volumes: volumes:
- ./alertmanager/:/etc/alertmanager/ - ./alertmanager/:/etc/alertmanager/
networks: networks:
- back-tier - back-tier
command: command:
- '-config.file=/etc/alertmanager/config.yml' - '-config.file=/etc/alertmanager/config.yml'
- '-storage.path=/alertmanager' - '-storage.path=/alertmanager'
cadvisor: cadvisor:
image: google/cadvisor image: google/cadvisor
volumes: volumes:
@ -71,7 +68,7 @@ services:
- 8080 - 8080
networks: networks:
- back-tier - back-tier
grafana: grafana:
image: grafana/grafana image: grafana/grafana
depends_on: depends_on: