51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
|
version: "3.8"
|
||
|
|
||
|
networks:
|
||
|
host-network:
|
||
|
name: host
|
||
|
external: true
|
||
|
prometheus-network:
|
||
|
external: true
|
||
|
traefik-network:
|
||
|
external: true
|
||
|
|
||
|
services:
|
||
|
prometheus-node-exporter-service:
|
||
|
image: docker.io/prom/node-exporter:latest
|
||
|
hostname: prometheus-node-exporter-service-host
|
||
|
tty: true
|
||
|
environment:
|
||
|
- DS_NODE_NAME="{{.Node.Hostname}}"
|
||
|
- DS_SERVICE_NAME="{{.Service.Name}}"
|
||
|
- DS_TASK_NAME="{{.Task.Name}}"
|
||
|
networks:
|
||
|
- host-network
|
||
|
volumes:
|
||
|
- type: bind
|
||
|
source: /
|
||
|
target: /host
|
||
|
read_only: true
|
||
|
##pid: host
|
||
|
command:
|
||
|
- --path.rootfs=/host
|
||
|
- --web.listen-address=:9100
|
||
|
##- --web.disable-exporter-metrics
|
||
|
##- --log.level=debug
|
||
|
##- --path.procfs=/host/proc
|
||
|
##- --path.sysfs=/host/sys
|
||
|
##- --collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)/?.*$$"
|
||
|
##ports:
|
||
|
## - target: 9100
|
||
|
## published: 9100
|
||
|
## protocol: tcp
|
||
|
deploy:
|
||
|
mode: global
|
||
|
##placement:
|
||
|
##constraints:
|
||
|
## - node.role == manager
|
||
|
resources:
|
||
|
limits:
|
||
|
memory: 256MB
|
||
|
restart_policy:
|
||
|
condition: on-failure
|