4.3 KiB
Debian monitoring
Prometheus, Alertmanager and Grafana run in the homelab-prometheus Compose
project on Debian's local NVMe. The Prometheus Operator, kube-state-metrics,
node exporters and ServiceMonitor/PrometheusRule resources remain in K3s.
Loki and Tempo remain in the cluster.
Run on Debian:
./jeannie monitoring plan
./jeannie monitoring migrate
./jeannie monitoring status
migrate verifies the pinned cluster, validates exported configuration using
promtool/amtool, stops only the three backends using the existing Helm release,
then copies their offline volumes. It preserves the original PVCs and stores
compressed archives, PVC identities and original Helm values under
/data/homelab-monitoring/backup. Grafana's existing SQLite database is copied
using SQLite's backup API, preserving users, saved dashboards and Dex account
links. Existing seven-day Prometheus retention still applies; backup archives
remain independent of TSDB retention.
The chart keeps the backend controllers intentionally at zero replicas.
A post-renderer retains their Service names and supplies Debian Endpoints,
preserving in-cluster URLs and ServiceMonitor discovery. It supports Helm 3
executables and an isolated Helm 4 postrenderer plugin. OpenTofu uses the same
desired configuration, so a subsequent ./jeannie platform monitoring keeps
the backends on Debian.
The OCI edge forwards the three public hostnames directly to Debian through Tailscale. Migration uses an Nginx-only validated reload, without pulling or recreating the other containers on the small edge VM. ACME challenge paths are retained for certificate renewal. Grafana retains its public URL, Dex client ID/secret and datasource UIDs. The cluster Grafana OAuth secret remains the source consumed by the existing SOPS/Dex deployment pipeline; this migration does not rotate it.
./jeannie monitoring apply is idempotent after migration. refresh updates
Operator-generated discovery, alert rules, datasources and dashboard files.
The installed homelab-monitoring-refresh.timer runs every five minutes under
the Debian operator account, using a durable installed script rather than the
checkout used for migration. It refreshes an hour-lived token for the existing
Prometheus service account; containers do not receive the administrator
kubeconfig. Existing configuration remains running if the cluster API is down.
Dashboard files reload automatically; changes to Grafana OAuth configuration
or datasources restart Grafana. grafana-dashboards apply also refreshes the
external instance.
Only routes for the declared cluster service CIDR and discovered Calico pools are installed through the Orange Pi. Configuration and backups live in a private installation directory. Docker memory caps are 1536 MiB for Prometheus, 512 MiB for Grafana and 256 MiB for Alertmanager. Coordinate LLM benchmarks with the remaining Debian memory; moving monitoring does not reserve host RAM.
The migration does not repair the Orange Pi SSD or migrate Loki. A down Loki target remains a real failure, rather than being hidden by this move. Original PVCs and backups should be retained until recovery requirements are reviewed.
./jeannie monitoring exporters repairs and validates the Debian and OCI email
node-exporter targets. On Debian it removes only retired CNI TCP/9100 hostPort
rules when all Kubernetes services and runtime processes are absent; shared
HTTP/HTTPS rules and other firewall policy remain intact. Rule backups are
saved under ~/.local/share/homelab/exporter-backups.
For email it learns Debian's current public IPv4 and updates only the two
state-identified email NSG rules (SSH and exporter) to that /32, then adds the
matching UFW exporter permission through SSH. A managed systemd oneshot keeps
a source-restricted TCP/9100 INPUT allowance before the Oracle image's default
REJECT rule, including after reboot. It saves email-specific CIDR
overrides in the canonical OCI configuration so subsequent foundation applies
retain the new source. Existing UFW permissions are not reset or removed, and
edge access rules remain unchanged. Re-run after a home public-IP change.
The command finishes only after both exporters return metrics and Prometheus
observes both jobs UP. It needs the existing managed email rules, OCI CLI
credentials, SSH key and passwordless sudo; it does not recreate either host.