homelab-codex-ws/services/fleet-prometheus/service.yaml
oskar 4518b15f98 feat(fleet-prometheus): scaffold fleet liveness Prometheus (VPS)
Clean scaffold of a Prometheus instance dedicated to fleet liveness, deliberately
separate from the home `prom` on PIHA. Scrapes only itself + the VPS-local
node_exporter for now.

- image pinned to prom/prometheus:v3.5.0 (LTS) — no :latest anti-pattern
- TSDB retention 15d / 2GB on the tight VPS; --web.enable-lifecycle for reloads
- mem_limit 512m, oom_score_adj +200 (sacrificial OOM victim before control-plane)
- tailscale-internal exposure via plain published 9090, mirroring control-plane
- node_exporter scraped via host.docker.internal:9100 (it runs network_mode: host)
- secret-free prometheus.yml; alerting/rule_files left as commented placeholders
- in-container healthcheck via busybox wget (present in the image; curl is not)

Smoke: docker compose config OK; promtool check config SUCCESS; up -d ->
/-/healthy + /-/ready OK; both targets (prometheus, fleet-node) report up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 18:07:18 +02:00

26 lines
755 B
YAML

service:
name: fleet-prometheus
owner_node: vps
role: fleet-liveness-source
exposure: tailscale-internal # reachable on Tailscale; NOT behind public npm proxy
dependencies:
- node_exporter # first scrape target (VPS-local host metrics)
ports:
- container: 9090
host: 9090
protocol: tcp
healthcheck:
type: http
endpoint: http://localhost:9090/-/healthy
interval: 30s
timeout: 10s
retries: 5
restart_policy: unless-stopped
persistence:
paths:
- fleet-prometheus_tsdb # TSDB -> /prometheus (named volume)
runtime:
config_files:
- prometheus.yml # scrape config (secret-free, in git)
env_vars: [] # no secrets / no required env