hubble: bare-IP UI on its own Gateway (8082) — Cilium merges hostname-less routes

Cilium 1.20 renders ONE RouteConfiguration per Gateway, shared by every listener
of that Gateway. Two routes that both match `Prefix: /` with no hostnames are
merged into a single route with `weightedClusters` 1/1, so a second bare-IP
route on the `internal` gateway (even on a second port) makes BOTH services
random: measured 12 requests each to :8081 and :8082 returning Grafana 7x and
Hubble UI 5x. Splitting by port does not help.

Hubble UI therefore gets its own Gateway (`internal/hubble-ui`, listener
http-internal on 8082, own RouteConfiguration) and its route has no hostnames,
so `http://10.10.0.2:8082/` and `http://hubble.lab.internal:8082/` both serve the
UI while Grafana keeps :8081 to itself. Documented as the rule in gateway.yaml:
one bare-IP service per Gateway.
This commit is contained in:
Lance Walters 2026-10-27 00:38:47 -04:00
commit dcb708dff4
4 changed files with 43 additions and 21 deletions

View file

@ -13,22 +13,19 @@ spec:
port: 8081
# Any namespace may attach a route: the security boundary for this listener
# is the HOST firewall (only 10.10.0.0/24 + pod CIDR may reach :8081), not
# the namespace. Keeps the pattern reusable for the next internal service
# (Hubble lives in kube-system) without editing this Gateway again.
# the namespace.
allowedRoutes:
namespaces:
from: All
# One listener per service that must be reachable by BARE IP.
# NOTE (2026-10-27): do NOT add another hostname-less route here, and do not
# add a second listener for one. Cilium 1.20 renders ONE RouteConfiguration
# per Gateway (`listener-insecure`) shared by all of that Gateway's
# listeners, so two routes that both match `Prefix: /` with no hostnames are
# merged into a single route with `weightedClusters` weight 1/1 — every
# request then lands on a random backend, on every port of the gateway.
# Proven live: http://10.10.0.2:8081/ and :8082/ each served Grafana ~58% and
# Hubble UI ~42% of the time once Hubble's bare route existed here.
#
# A hostname-scoped route (`hostnames: [x.lab.internal]`) does not match a
# request whose Host is the IP, so `curl http://10.10.0.2:8081/` returns 404
# and a phone (no /etc/hosts) cannot use the service at all. The fix is a
# listener whose route has no `hostnames` — but a hostname-less PathPrefix /
# route swallows every request on its listener, so it cannot share a port
# with a hostname-routed one. Hence: new service => new port.
- name: hubble-ui
protocol: HTTP
port: 8082
allowedRoutes:
namespaces:
from: All
# A service that must answer on its bare IP therefore gets its OWN Gateway
# object, which gets its own Envoy RouteConfiguration — see
# `gateway-hubble-ui.yaml` (port 8082). One bare-IP service per Gateway.