Topology-aware routing is ignored for Envoy backends
Is there an existing issue for this?
- I have searched the existing issues
Version
equal or higher than v1.18.13 and lower than v1.19.0
But I am reasonably confident that the same issue is present also in newer versions.
What happened?
With loadBalancer.serviceTopology=true, topology-aware routing is applied correctly on the BPF datapath but is not applied to backends synced to Envoy. Any service referenced by a CiliumEnvoyConfig's backendServices receives the full backend set in its Envoy cluster.
This happens even when every EndpointSlice endpoint carries a correct zone hint, the node has topology.kubernetes.io/zone, and enable-service-topology=true is live in the ConfigMap.
Expected: Envoy's cluster for a topology-aware service contains only the backends hinted for the local node's zone, matching the BPF datapath.
Actual: Envoy's cluster contains all backends in all zones. The BPF path for the same service and port on the same node is correctly filtered.
I used cilium-dbg service list to get the number of bpf backends and cilium-dbg envoy admin clusters to get the envoy backends.
I can confirm in hubble that the number of flows between zones is equally spread for Envoy-originated flows in 1.18, whereas in 1.17 it was exclusively same-zone. We noticed it originally because our cross-AZ costs 100x'ed the moment we upgraded to Cilium 1.18.
How can we reproduce the issue?
- A multi-zone cluster with
topology.kubernetes.io/zoneset on all nodes. - Install Cilium with Gateway API and topology-aware routing
- Deploy a Service with enough replicas spread across zones, and enable topology hints.
- Confirm Kubernetes assigned hints to every endpoint. If you're using
topology-mode: autorather thantrafficDistribution, you might need to scale out to like 10 pods or something to not have kubernetes remove your zone hints. - Point a
Gateway+HTTPRouteat that Service so it appears in the generated CiliumEnvoyConfig'sbackendServices. - Compare the two consumers on a node:
# BPF correctly filtered to the local zone
cilium-dbg service list -o json | jq '.[] | select(.spec["frontend-address"].ip=="<clusterIP>")
| {port:.spec["frontend-address"].port, n:(.spec["backend-addresses"]|length), zones:(.spec["backend-addresses"]|group_by(.zone)|map({(.[0].zone):length})|add)}'
# 5 in this zone
{
"port": 80,
"n": 5,
"zones": {
"eu-west-1c": 5
}
}
# Envoy all zones
cilium-dbg envoy admin clusters -o json | jq -r '.cluster_statuses[]
| "\(.name) members=\((.host_statuses//[])|length)"'
# In Envoy we get 18
platform-cni/cilium-gateway-internal-gateway/topology-test:echo:80 members=18On 1.18+ you should see that Envoy has the full list of backends, but in the bpf path you only have the ones in the same zone. In 1.17 you'd see that you end up with the filtered set in both the bpf path and Envoy.
Cilium Version
Client: 1.18.12 c2cd21cf9 2026-07-16T13:41:19+00:00 go version go1.25.12 linux/arm64 Daemon: 1.18.12 c2cd21cf9 2026-07-16T13:41:19+00:00 go version go1.25.12 linux/arm64
We are yet to confirm that the same issue is present in 1.19 and 1.20, but at least from looking at the code, it looks unchanged.
Kernel Version
6.12.94
Kubernetes Version
v1.34.9-eks-bca9cf6
Regression
Yes. Last known good version is 1.17.16.
Anything else?
I was looking into how the filtering is done, and while I certainly don't understand all of it, looking at the changes in 1.18 it seems like the filtering has moved into DefaultSelectBackends:
When this is called from the ciliumenvoyconfig controller, the fe argument is nil, so the topology aware routing is not exercised:
In the bpf path, fe is being passed, but even if it is expected to be nil in the Envoy case, I don't know why that skips the topology-aware routing, as I don't see anything in there that actually requires fe.
In 1.17, this filtering happens far upstream and the already filtered list makes its way down to both the bpf and envoy paths.
Again, this is from me reading Cilium code for a couple of hours, so take it as a potential lead rather than something conclusive.
Cilium Users Document
- Are you a user of Cilium? Please add yourself to the Users doc
Code of Conduct
- I agree to follow this project's Code of Conduct
Source: cilium/cilium