internal gateway: single serving address (siriussec only) + a probe that notices when it flaps
rpi carried node-role.kubernetes.io/gateway=true, so cilium-envoy bound 8080/8081/8084 there too. Its Envoy completes TCP to a backend pod on siriussec but never finishes the request: every hit on 10.10.0.1:8081/8084 hung 5s and returned 503, even from the Pi own 127.0.0.1, while 10.10.0.2 answered in ms. Clients that tried either address saw the dashboards flap. Remove the label from rpi: one gateway node, one address. The Gateway status.addresses still lists every node InternalIP (cilium#29060 ignores spec.addresses) - it is not a VIP; only 10.10.0.2 serves. Add blackbox-exporter + Probe (8081, 8084 every 30s) + PrometheusRule alerts so a regression is visible in the stack instead of on a phone. Give the internal_gw nft accept rules counters so an allowed request is provable.
This commit is contained in:
parent
8293df123f
commit
48b2b6ac01
4 changed files with 205 additions and 20 deletions
161
monitoring/controllers/home/gateway-probe.yaml
Normal file
161
monitoring/controllers/home/gateway-probe.yaml
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
# Internal-gateway liveness probe (WireGuard-only services).
|
||||
#
|
||||
# Why this exists: the internal listeners (8081 Grafana, 8084 Hubble UI) are
|
||||
# served by the Cilium hostNetwork Envoy on the node(s) carrying
|
||||
# `node-role.kubernetes.io/gateway=true`. Before 2026-10-27 that label was on
|
||||
# both rpi and siriussec, and the Pi's Envoy could complete TCP to a backend
|
||||
# pod on siriussec but never finish the request: every request to
|
||||
# 10.10.0.1:8081/8084 hung for 5 s and then returned 503, even from the Pi's
|
||||
# own 127.0.0.1. Clients that tried "either IP" therefore saw the dashboards
|
||||
# flap. The label now lives on siriussec only, and this probe makes a
|
||||
# regression (label re-added, listener gone, Envoy wedged, firewall rule
|
||||
# dropped) visible in Prometheus/Grafana instead of on Lance's phone.
|
||||
#
|
||||
# Prober: blackbox-exporter, pinned to siriussec (same node as the Gateway, so
|
||||
# the probe crosses the pod network over the WireGuard mesh rather than
|
||||
# loopback). Nothing here is public: the prober talks to the node IP over the
|
||||
# mesh and the host firewall in `infrastructure/networking/internal` is what
|
||||
# restricts the listeners themselves.
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: blackbox-exporter
|
||||
namespace: monitoring
|
||||
data:
|
||||
blackbox.yml: |
|
||||
modules:
|
||||
# Grafana answers / with a 302 to /login, Hubble UI answers 200.
|
||||
http_2xx_or_3xx:
|
||||
prober: http
|
||||
timeout: 5s
|
||||
http:
|
||||
valid_status_codes: [200, 301, 302, 303, 307, 308]
|
||||
preferred_ip_protocol: ip4
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: blackbox-exporter
|
||||
namespace: monitoring
|
||||
labels:
|
||||
app.kubernetes.io/name: blackbox-exporter
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: blackbox-exporter
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: blackbox-exporter
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: siriussec
|
||||
containers:
|
||||
- name: blackbox-exporter
|
||||
image: prom/blackbox-exporter:v0.25.0
|
||||
args:
|
||||
- --config.file=/etc/blackbox_exporter/blackbox.yml
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 9115
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /-/healthy
|
||||
port: http
|
||||
initialDelaySeconds: 5
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 32Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 64Mi
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /etc/blackbox_exporter
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: blackbox-exporter
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: blackbox-exporter
|
||||
namespace: monitoring
|
||||
labels:
|
||||
app.kubernetes.io/name: blackbox-exporter
|
||||
spec:
|
||||
selector:
|
||||
app.kubernetes.io/name: blackbox-exporter
|
||||
ports:
|
||||
- name: http
|
||||
port: 9115
|
||||
targetPort: http
|
||||
---
|
||||
# Only 10.10.0.2 is a serving internal-gateway address. The Gateways'
|
||||
# `status.addresses` lists EVERY node InternalIP (10.10.0.1, 10.10.0.2,
|
||||
# 10.10.0.5) regardless of which nodes run cilium-envoy, and Cilium ignores
|
||||
# `spec.addresses`, so the status list is NOT a "try either IP" guide.
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: Probe
|
||||
metadata:
|
||||
name: internal-gateway
|
||||
namespace: monitoring
|
||||
labels:
|
||||
release: kube-prometheus-stack
|
||||
spec:
|
||||
jobName: internal-gateway
|
||||
interval: 30s
|
||||
module: http_2xx_or_3xx
|
||||
prober:
|
||||
url: blackbox-exporter.monitoring.svc:9115
|
||||
path: /probe
|
||||
targets:
|
||||
staticConfig:
|
||||
static:
|
||||
- http://10.10.0.2:8081/
|
||||
- http://10.10.0.2:8084/
|
||||
labels:
|
||||
exposure: wireguard-internal
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: internal-gateway
|
||||
namespace: monitoring
|
||||
labels:
|
||||
release: kube-prometheus-stack
|
||||
spec:
|
||||
groups:
|
||||
- name: internal-gateway
|
||||
rules:
|
||||
- alert: InternalGatewayUnreachable
|
||||
expr: probe_success{job="internal-gateway"} == 0
|
||||
for: 3m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: >-
|
||||
Internal gateway listener {{ $labels.instance }} is not answering
|
||||
(probe_success 0 for 3m)
|
||||
description: >-
|
||||
Grafana (8081) / Hubble UI (8084) are served by cilium-envoy on
|
||||
siriussec only. Check that rpi has NOT re-acquired
|
||||
node-role.kubernetes.io/gateway=true, that cilium-envoy is Running
|
||||
on siriussec, that the internal_gw nft table accepts 10.10.0.0/24
|
||||
and 10.244.0.0/16, and that the route/service behind the listener
|
||||
exists.
|
||||
- alert: InternalGatewayProbeMissing
|
||||
expr: absent(probe_success{job="internal-gateway"})
|
||||
for: 10m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: The internal-gateway blackbox probe has disappeared from Prometheus
|
||||
description: >-
|
||||
Either the Probe object / blackbox-exporter pod is gone or the
|
||||
operator is not selecting it (label release=kube-prometheus-stack).
|
||||
The dashboards are then unmonitored, not necessarily broken.
|
||||
Loading…
Reference in a new issue