163 lines
5.3 KiB
YAML
163 lines
5.3 KiB
YAML
|
|
# Garage (Pi, WireGuard-only object store) -> Prometheus
|
||
|
|
#
|
||
|
|
# Garage runs OUTSIDE the cluster (Docker on rpi, see infrastructure/garage/),
|
||
|
|
# so it has no pod to scrape. Its admin API serves /metrics on the Pi's
|
||
|
|
# WireGuard hub address 10.10.0.1:3903, which the cluster reaches over the mesh
|
||
|
|
# by native routing — the same path the site's media initContainer already uses
|
||
|
|
# for 10.10.0.1:3900.
|
||
|
|
#
|
||
|
|
# Service + EndpointSlice with no selector is the supported way to scrape a
|
||
|
|
# fixed external address with ServiceMonitor: the operator resolves endpoints
|
||
|
|
# from the Service's EndpointSlices, so there is nothing for the cluster to
|
||
|
|
# schedule and no node affinity problem.
|
||
|
|
#
|
||
|
|
# Before 2026-11-19 the admin port was published on loopback only, so /metrics
|
||
|
|
# returned "connection refused" from inside the cluster and Garage was invisible
|
||
|
|
# to Prometheus. The listener is now published on 10.10.0.1 only (never
|
||
|
|
# 0.0.0.0), with no metrics_token because the port does not leave the mesh.
|
||
|
|
#
|
||
|
|
# No Alertmanager is deployed in this stack: these rules show up under
|
||
|
|
# Prometheus -> /alerts and Grafana -> Alerting, they do not page anyone.
|
||
|
|
---
|
||
|
|
apiVersion: v1
|
||
|
|
kind: Service
|
||
|
|
metadata:
|
||
|
|
name: garage
|
||
|
|
namespace: monitoring
|
||
|
|
labels:
|
||
|
|
app: garage
|
||
|
|
spec:
|
||
|
|
type: ClusterIP
|
||
|
|
# No selector on purpose — the endpoints are static, not pods.
|
||
|
|
ports:
|
||
|
|
- name: metrics
|
||
|
|
port: 3903
|
||
|
|
targetPort: 3903
|
||
|
|
protocol: TCP
|
||
|
|
---
|
||
|
|
apiVersion: discovery.k8s.io/v1
|
||
|
|
kind: EndpointSlice
|
||
|
|
metadata:
|
||
|
|
name: garage
|
||
|
|
namespace: monitoring
|
||
|
|
labels:
|
||
|
|
app: garage
|
||
|
|
kubernetes.io/service-name: garage
|
||
|
|
addressType: IPv4
|
||
|
|
ports:
|
||
|
|
- name: metrics
|
||
|
|
port: 3903
|
||
|
|
protocol: TCP
|
||
|
|
endpoints:
|
||
|
|
- addresses:
|
||
|
|
- 10.10.0.1
|
||
|
|
conditions:
|
||
|
|
ready: true
|
||
|
|
---
|
||
|
|
apiVersion: v1
|
||
|
|
kind: Endpoints
|
||
|
|
metadata:
|
||
|
|
# Kept for older tooling that still reads the Endpoints API; the EndpointSlice
|
||
|
|
# above is what the operator actually consumes on this cluster.
|
||
|
|
name: garage
|
||
|
|
namespace: monitoring
|
||
|
|
labels:
|
||
|
|
app: garage
|
||
|
|
subsets:
|
||
|
|
- addresses:
|
||
|
|
- ip: 10.10.0.1
|
||
|
|
ports:
|
||
|
|
- name: metrics
|
||
|
|
port: 3903
|
||
|
|
protocol: TCP
|
||
|
|
---
|
||
|
|
apiVersion: monitoring.coreos.com/v1
|
||
|
|
kind: ServiceMonitor
|
||
|
|
metadata:
|
||
|
|
name: garage
|
||
|
|
namespace: monitoring
|
||
|
|
labels:
|
||
|
|
release: kube-prometheus-stack
|
||
|
|
spec:
|
||
|
|
jobLabel: app
|
||
|
|
namespaceSelector:
|
||
|
|
matchNames:
|
||
|
|
- monitoring
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: garage
|
||
|
|
endpoints:
|
||
|
|
- port: metrics
|
||
|
|
path: /metrics
|
||
|
|
interval: 30s
|
||
|
|
scrapeTimeout: 10s
|
||
|
|
---
|
||
|
|
apiVersion: monitoring.coreos.com/v1
|
||
|
|
kind: PrometheusRule
|
||
|
|
metadata:
|
||
|
|
name: garage
|
||
|
|
namespace: monitoring
|
||
|
|
labels:
|
||
|
|
release: kube-prometheus-stack
|
||
|
|
spec:
|
||
|
|
groups:
|
||
|
|
- name: garage
|
||
|
|
rules:
|
||
|
|
- alert: GarageDown
|
||
|
|
expr: up{job="garage"} == 0
|
||
|
|
for: 5m
|
||
|
|
labels:
|
||
|
|
severity: critical
|
||
|
|
annotations:
|
||
|
|
summary: "Garage metrics endpoint is down (10.10.0.1:3903)"
|
||
|
|
description: >-
|
||
|
|
Prometheus cannot scrape Garage. Either the container is stopped
|
||
|
|
(docker compose on the Pi), the 3903 publish was lost, or the
|
||
|
|
WireGuard mesh is broken. The site's media initContainer degrades
|
||
|
|
gracefully when this happens, so nothing else will report it.
|
||
|
|
- alert: GarageClusterUnhealthy
|
||
|
|
expr: cluster_healthy{job="garage"} == 0
|
||
|
|
for: 5m
|
||
|
|
labels:
|
||
|
|
severity: critical
|
||
|
|
annotations:
|
||
|
|
summary: "Garage reports an unhealthy cluster"
|
||
|
|
description: >-
|
||
|
|
Single storage node d053db4dfc97bf78 was not able to reach a
|
||
|
|
healthy state. S3 requests will fail until this clears.
|
||
|
|
- alert: GarageDiskFillingUp
|
||
|
|
# Same 80% threshold as this stack's other disk alerts.
|
||
|
|
expr: >-
|
||
|
|
(1 - (garage_local_disk_avail{job="garage"} / garage_local_disk_total{job="garage"})) > 0.8
|
||
|
|
for: 15m
|
||
|
|
labels:
|
||
|
|
severity: warning
|
||
|
|
annotations:
|
||
|
|
summary: "Garage storage node is more than 80% full"
|
||
|
|
description: >-
|
||
|
|
The Pi's Garage data directory is filling up. Uploads start failing
|
||
|
|
hard at 100%; free space or raise the node capacity in Garage,
|
||
|
|
do not delete the meta/ directory.
|
||
|
|
- alert: GarageMetadataGcBacklog
|
||
|
|
expr: table_gc_todo_queue_length{job="garage"} > 1000
|
||
|
|
for: 30m
|
||
|
|
labels:
|
||
|
|
severity: warning
|
||
|
|
annotations:
|
||
|
|
summary: "Garage metadata GC queue is backed up"
|
||
|
|
description: >-
|
||
|
|
The metadata engine has more than 1000 pending GC operations. This
|
||
|
|
is the early signal for a metadata problem, which is the failure
|
||
|
|
mode that orphans data/ — check `garage meta snapshot` and backups
|
||
|
|
are running before it becomes a restore.
|
||
|
|
- alert: GarageResyncErroredBlocks
|
||
|
|
expr: block_resync_errored_blocks{job="garage"} > 0
|
||
|
|
for: 15m
|
||
|
|
labels:
|
||
|
|
severity: warning
|
||
|
|
annotations:
|
||
|
|
summary: "Garage has blocks that failed to resync"
|
||
|
|
description: >-
|
||
|
|
At least one data block could not be resynchronised on the storage
|
||
|
|
node. With replication_factor 1 there is no other copy, so this is
|
||
|
|
data at risk — verify the object is readable and check backups.
|