homek8s/monitoring/controllers/home/httproute.yaml

35 lines
1.4 KiB
YAML
Raw Permalink Normal View History

# Grafana is served by the INTERNAL gateway only (gateway-system is the public
# one, fed by the Cloudflare tunnel). There is no Cloudflare ingress entry for
# this hostname and there must never be one.
#
# Reachable over WireGuard, and deliberately WITHOUT a Host header mapping:
# phones: http://10.10.0.2:8081/
# laptops: http://grafana.lab.internal:8081/ (10.10.0.2 grafana.lab.internal)
#
# `hostnames` is intentionally ABSENT: a phone sends `Host: 10.10.0.2:8081`,
# which matches no `.lab.internal` hostname, and Envoy answers 404. A route
# with no hostnames matches any Host on the listener, so both URLs work.
# Port 8081 is Grafana's alone — do not attach a second hostname-less route to
# `http-internal`: two bare routes on one listener make precedence ambiguous,
# so any future internal service gets its own listener port.
#
# The listener answers only on 10.10.0.0/24 + the pod CIDR — the host firewall
# (see docs/internal-wireguard-services.md) drops :8081 everywhere else.
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: grafana
namespace: monitoring
spec:
parentRefs:
- name: internal
namespace: internal
sectionName: http-internal
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: kube-prometheus-stack-grafana
port: 80