Research: agentgateway as edge ingress replacing haproxy — cross-cluster routing via Cilium ClusterMesh #1527
Labels
No labels
epic
fleet:hub
fleet:identity
fleet:ingress
fleet:offload
fleet:sveltos
needs-triage
ready-for-agent
ready-for-human
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/clusters#1527
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Research: can agentgateway replace haproxy as the edge ingress? Cross-cluster routing with Cilium ClusterMesh
Tracking the question "all in on agentgateway": collapse the per-cluster gateway/ingress stacks and the central haproxy fan-out into agentgateway as the single edge, once upstream OIDC web login lands (https://github.com/agentgateway/agentgateway/pull/1450).
Current state
clusters/portable/haproxy/is the edge. A DaemonSet bound to the portable VIP receives all traffic on 80/443 and fans out:portable_kgateway_tcp(10.10.5.17:443),mini_kgateway_tcp(10.10.6.9:443),mini_tcp(10.10.6.0:443),cilium-ingresssvc, plus non-k8s targets: azuracast VM (10.15.1.148:443) andkanidmldaps (svc:3636). Everything usessend-proxy-v2.mini_http/portable_http/ per-backend viamini.map/portable.map; ACME.well-knownrouted to the owning cluster's http backend.accept-proxy, wildcard cert) →portable_https.Portable is internet-facing; mini is not directly reachable. Single-pod apps on mini (or any cluster that can't hold a public VIP) are reached via the haproxy SNI fan-out to that cluster's gateway/ingress node IP.
Findings (agentgateway capabilities, verified against 1.4.x docs + API ref)
AgentgatewayBackend.spec.static.{host,port}reaches arbitrary TCP/IP destinations — a non-k8s VM (the azuracast case) or a remote cluster's gateway IP is representable as a normal backend.AgentgatewayBackend.dynamicForwardProxy): routes by incoming HTTP host header or TLS SNI to the resolved destination. This is literally haproxy's model — one backend that dispatches on SNI/host, no per-hostname backend entries needed.AgentgatewayPolicy.frontend.proxyProtocolexists (mode/version) — preserves client IP at the edge likesend-proxy-v2today.AgentgatewayParameters.workload.kind: DaemonSetis supported (haproxy is currently a DaemonSet; an edge agentgateway can be too).AgentgatewayParameters.deployment.spec.replicas/ overlays map 1:1 to today'sGatewayParameters.The open problem: cross-cluster routing
GEP-1748 (Gateway API-native Multi-Cluster Services) is ❌ unsupported by agentgateway. Three ways to route a single-pod app on a non-internet-connected cluster:
miniandportableservices become one namespace of local-looking services. This is the "native" answer and the direction to validate.AgentgatewayBackendpointing at the remote cluster's gateway/ingress node IP (mirrors today'smini_kgateway_tcp→ 10.10.6.9) — works today, keeps the manual fan-out table.Also relevant:
BackendTunnel(HTTPS_PROXY-style egress) exists for firewalled/reverse-tunnel clusters — the same primitive lab/iac#28 relies on for apiserver access.Integration with existing work
Blocked by
AgentgatewayPolicy— agentgateway/agentgateway#1450 (PR open; #2047 feature issue closed, superseded by the PR).Questions to answer
frontend.proxyProtocolaccept PROXY v2 from the VIP as well as emit it (today haproxy does both accept and send)?Updating with cross-links and the ClusterMesh findings from the deeper dive.
Blocked by
AgentgatewayPolicy— agentgateway/agentgateway#1450 (PR open; feature request #2047 closed as superseded by it).Cross-cluster routing: decision
Implemented as #1528 — Cilium ClusterMesh between portable and mini using Global Services (
service.cilium.io/global: "true"), not MCS-API. Rationale: agentgateway does not support GEP-1748 (ServiceImport backendRef), but Global Services materialize a real Service in each cluster, so agentgateway routes to it as an ordinary Service backend with zero GEP-1748 support needed. Full cross-referenced state (deployed Cilium 1.19.6 config, datapath/encryption/CIDR/BGP prereqs) is in #1528.Follow-up: Egress Gateway + ClusterMesh
Not combinable. The Cilium docs state egress gateway is incompatible with Cluster Mesh — the gateway node selected by a
CiliumEgressGatewayPolicymust be in the same cluster as the selected pods, and the two features cannot be combined. For pods in a meshed cluster that must reach cluster-external destinations with a fixed SNAT IP, keep egress policies per-cluster or route that traffic through a central gateway outside the fabric. Egress gateway also requiresidentityAllocationMode: crd, BPF masquerade, and kube-proxy replacement — portable already has kube-proxy replacement on; BPF masquerade (bpf.masquerade) is not explicitly set today.Related tickets updated
Closing as superseded — the research question ("can agentgateway replace haproxy as the single edge?") was answered, but the fleet went a different direction than this issue proposed. Body left unchanged; this comment records the outcome.
What actually shipped (commits since this issue):
1ea00e60, moved tostandby/). The edge is no longer haproxy.gateway/cilium-default,gatewayClassName: cilium) — not agentgateway.mini-passthroughListenerSet +mini-*TLSRoutes) → a selectorlessmini-ciliumService/EndpointSlice at the remote gateway node IP (10.10.6.14). This is the issue's option #2 (static backend to the remote gateway IP, "keeps the manual fan-out table"), rebuilt in Gateway API.agentgateway's actual role now (not the edge):
clusters/portable/ai/.generic-templates/k8s-hub/; the mini + portable overlays wire the OIDC/token-exchange flow (customoauth.animeteamspeak.moe/providers.animeteamspeak.moeCRDs +ExternalAuthfilters), while mail stays pure passthrough.The "Blocked by" no longer gates anything here: the edge is pure TLS passthrough and does no OIDC web login, so agentgateway/agentgateway#1450 (OIDC web login) is no longer the blocking item for the edge.
The one research finding that held up: the decision to standardize on generic Gateway API (ListenerSets, TLSRoute passthrough, selectorless Service + EndpointSlice for static backends) — implemented in Cilium rather than agentgateway.
Related live thread for the apiserver-access half: #1590 (k8s-hub: evaluate H2 Extended CONNECT for exec).
Superseded — the edge is now Cilium Gateway API (haproxy removed), not agentgateway. Cross-cluster is per-hostname TLS passthrough, not ClusterMesh. See the closing comment for the full breakdown.