homelab/nomad-job/platform/node-exporter.nomad

70 lines
1.5 KiB
Plaintext
Raw Normal View History

2022-06-22 14:38:56 +00:00
job "node-exporter" {
2022-10-29 08:40:01 +00:00
datacenters = ["homelab", "hetzner"]
2022-12-10 16:10:32 +00:00
priority = 30
2022-10-29 08:40:01 +00:00
type = "system"
2022-06-22 14:38:56 +00:00
meta {
forcedeploy = "0"
}
2022-10-29 08:40:01 +00:00
group "node-exporter" {
2022-06-22 14:38:56 +00:00
network {
port "http" {
}
}
service {
name = "node-exporter"
port = "http"
check {
2022-10-29 08:40:01 +00:00
type = "http"
port = "http"
path = "/"
interval = "10s"
timeout = "2s"
2022-06-22 14:38:56 +00:00
success_before_passing = "3"
failures_before_critical = "3"
check_restart {
limit = 3
grace = "60s"
}
}
}
task "node-exporter" {
driver = "docker"
config {
2024-03-17 17:58:24 +00:00
image = "docker.service.consul:5000/prom/node-exporter"
2022-06-22 14:38:56 +00:00
ports = ["http"]
args = [
"--web.listen-address=:${NOMAD_PORT_http}",
"--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)($$|/)"
]
mount {
type = "bind"
target = "/host/proc"
source = "/proc"
readonly = true
}
mount {
type = "bind"
target = "/host/sys"
source = "/sys"
readonly = true
}
}
resources {
2022-10-29 08:40:01 +00:00
cpu = 20
2022-07-21 16:42:33 +00:00
memory = 30
2022-06-22 14:38:56 +00:00
}
}
}
}