How topology aware routing keeps Kubernetes traffic in-zone
Topology aware routing tells kube-proxy to prefer endpoints in the same zone as the client, so a request that enters a zone is more likely to be answered by a pod in that zone. In a multi-zone cluster, a Service whose pods are spread across zones can send traffic across zone boundaries on every hop, which adds latency and, on many cloud providers, inter-zone data transfer charges. The feature works by annotating a Service and letting the EndpointSlice controller publish zone hints that kube-proxy reads when it builds forwarding rules. Teams usually reach for it when cross-zone traffic is a measurable part of their network bill or when a latency-sensitive service calls a dependency that sits in the same zone. Before enabling it, confirm the exact annotation and hint behavior for your Kubernetes minor version in the official documentation, since the feature has changed across releases.
The feature is not the right lever in several common cases. If a Service has few replicas, or replicas are concentrated in one or two zones, hints can point most traffic at the same few pods and leave others idle, so the fix may be replica placement rather than routing. If the traffic is already mostly in-zone because callers use the same zones as their backends, or if the cost driver is egress to the internet or to another region rather than between zones, the change will not move the number you care about. Workloads that need strict per-zone failover behavior may also need explicit design, because hints are a preference and do not replace health-based failover. Ask your platform team to measure cross-zone traffic per Service before deciding.
Plan to check the effect rather than assume it. Your network team should confirm that each zone has enough ready endpoints, since the controller only applies hints when the per-zone distribution is balanced enough to allocate them safely. Record cross-zone traffic and request latency for the affected Services before and after the change, using the metrics your cloud provider and monitoring stack expose, and confirm the cloud billing line you expect to fall. Also test a zone-loss scenario in a non-production cluster so you know how traffic shifts when a zone's pods become unavailable. Any cost reduction estimate should come from your own traffic data, not from a generic figure.
How zone hints move from Service to kube-proxy
The path starts when a Service opts into topology-aware routing, typically through the service.kubernetes.io/topology-mode annotation. The EndpointSlice controller then writes zone hints into the EndpointSlices, and kube-proxy on each node reads those hints to choose endpoints in its own zone. The key check is the branch: if the hints are not applied, traffic falls back to endpoints in any zone. Confirm which path a given Service takes before you measure any cross-zone savings.
Zone hints flow from the Service to kube-proxy, with a fallback path when hints are not applied.
How Kubernetes topology aware routing hints work in EndpointSlices
Topology aware routing starts in the control plane, not in the data path. The EndpointSlice controller looks at each endpoint in a Service and, when the feature is enabled, attaches a zone hint that says which zone the endpoint should serve. kube-proxy on each node then reads those hints from the EndpointSlices and uses them when it builds the forwarding rules for that node. The routing decision is therefore only as good as the zone data behind it: the endpoint's zone comes from the node it runs on, and the node's zone comes from the topology labels applied to it. If nodes are missing zone labels, or carry labels that do not match your actual failure domains, the hints will be wrong or absent and traffic will spread across zones as it did before.
Before you rely on this, confirm the exact annotation or field name that enables hints, the EndpointSlice field where they appear, and the Kubernetes release that supports the behavior in the current kubernetes.io documentation for your version. The feature has changed names and defaults across releases, so do not copy a setting from an older blog post or a previous cluster. Also confirm how your CNI plugin and kube-proxy mode handle EndpointSlice hints, because the node-side behavior is where the rules are applied. Check the zone label values on every node with a command such as kubectl get nodes --show-labels and compare them with the zones your cloud provider or data center actually uses.
Hints are a request, not a guarantee. kube-proxy only honors them when the hints can be balanced across the endpoints in each zone, and it falls back to routing across all endpoints when they cannot. That fallback is the main operational risk: a Service with few replicas, uneven spread or a zone that has lost its endpoints will quietly route cross-zone again, so the cost savings disappear without any error. Plan for this by checking the EndpointSlices for hint values after each deployment or scale change, and by reviewing your pod topology spread constraints so that each zone holds a sensible share of endpoints. Record the expected behavior for each critical Service so that the on-call team can tell a fallback from a fault.
When kube-proxy ignores topology hints and falls back
Topology hints are advisory. kube-proxy keeps a Service's traffic in-zone only when the EndpointSlice data and the cluster topology meet certain conditions, and when they do not, traffic quietly spreads across zones. The cards below cover the conditions most often behind a hint that looks configured but does not change traffic, and what to check for each one.
Missing or inconsistent zone labels
Hints depend on the zone each node reports. If some nodes lack the topology.kubernetes.io/zone label, carry a stale value, or use a label scheme that differs from the one your cloud provider or bare-metal tooling applies, the controller cannot assign endpoints to zones reliably. Check every node's labels before enabling the feature, and confirm the labeling method after node replacement or autoscaling. Confirm the exact behavior for your version in the kube-proxy and EndpointSlice documentation.
Too few endpoints for the zone count
Hints are generated only when there are enough endpoints to spread across zones. A Service with two replicas in a three-zone cluster can leave one zone with no local endpoint, and the controller may then decline to hint at all. The result is that the feature looks enabled while traffic behaves as before. Compare replica counts against zone count for each Service you plan to route locally, and confirm the minimum endpoint rule for your Kubernetes version.
Uneven endpoint distribution across zones
Even when every zone has endpoints, an unbalanced spread can push the controller to fall back. Pods that cluster in one zone after a scheduling change, node drain or affinity rule may exceed the proportion the hints allow, so traffic crosses zones to balance load. Inspect where pods run with a wide view of the Service's EndpointSlices, and review topology spread constraints on the Deployment. Confirm the balance rule against the version you run.
Workloads that scale faster than hints update
Hints are computed from the endpoints present at the time of the update. During a rapid scale-up or a rollout, new pods may start in a zone before the hints reflect them, or the hints may briefly point at endpoints that are terminating. Traffic can then cross zones for a short window and show up as a spike in cross-zone metrics. Test scaling events in a non-production cluster and watch EndpointSlice changes alongside traffic counters.
Kube-proxy mode and data plane differences
Whether hints are honored depends on the kube-proxy mode and whether a CNI plugin replaces kube-proxy entirely. If your cluster runs a replacement data plane, the rules that consume EndpointSlice hints may not be the ones you expect. Record the kube-proxy mode and CNI version in your build notes, then confirm with the vendor documentation whether it reads topology hints. Do not assume the behavior carries over from a test cluster that uses a different data plane.
Topology routing options and when each one fits
This table compares the four routing choices a self-managed cluster can make for keeping Service traffic in-zone: topology hints, the traffic distribution setting, internal traffic policy and leaving routing unchanged. Read each row as a decision: the option, the trade-off it carries and the cluster version facts to confirm before you commit.
| Option | Decision it supports | Main trade-off | Confirm before choosing |
|---|---|---|---|
| Topology hints annotation | Prefer same-zone endpoints for a Service when zones hold roughly even capacity | Hints are advisory, and the controller disables them when endpoints are unevenly spread across zones | Your kube-apiserver and kube-proxy versions, and that the zone label is set on every node |
| Service traffic distribution setting | Express a preference for same-zone or nearby endpoints without annotation tuning | Behavior depends on the data plane, so the result can differ between kube-proxy modes and CNI plugins | Whether the field is available in your cluster version and whether your CNI honors it |
| Internal traffic policy | Keep node-local traffic on the node that sends it, or fail rather than leave the node | Requests with no local endpoint are dropped or fail, which needs spare capacity on every node that runs clients | Your Kubernetes minor version, and that each node hosting clients also runs a ready endpoint |
| Leave routing unchanged | Accept cross-zone traffic and cost while latency and transfer cost are measured | Cross-zone hops and transfer charges continue, and the team keeps full load balancing across zones | Baseline zone traffic and latency data from your monitoring, so the case for a change can be shown |
Why endpoint balance across zones decides whether hints apply
Topology hints only stay in effect when endpoints are spread across zones roughly in proportion to each zone's share of allocatable capacity. The EndpointSlice hints are computed from the endpoints that exist and the capacity the control plane expects each zone to absorb. If one zone holds far more endpoints than its share, serving traffic locally would overload it, so the controller can withdraw the hints and fall back to routing across all zones. The result is the cross-zone traffic and cost you were trying to remove, with no error to alert on. Confirm the exact balance thresholds, how the controller measures proportion, and any minimum endpoint count in the current Kubernetes documentation for the version you run, since these rules have changed between releases and should not be taken from memory.
To check the spread, list the EndpointSlices behind a Service with kubectl get endpointslices -l kubernetes.io/service-name=<service> and inspect each endpoint's zone and hints fields alongside the pods' node placement from kubectl get pods -o wide and the zone label on each node. Count endpoints per zone and compare that count with the number of schedulable nodes or allocatable CPU per zone. Pay particular attention to uneven node pools: a zone with a small pool of large nodes and a zone with many small nodes can hold the same number of replicas while carrying very different load. Pod anti-affinity rules and topology spread constraints can also push replicas into a pattern that looks balanced on paper but leaves one zone with fewer endpoints than its share. Make the spread a deliberate part of the rollout plan and recheck it after each scale event, node pool change or deployment rollout.
Treat balance as a design input, not a tuning detail. Decide whether the Service should prefer in-zone traffic at all if your zones cannot carry matching replica counts, and size replica counts per zone before enabling hints. Record which node pools span which zones and where the minimum replica count per zone comes from, so that a later autoscaling change does not silently disable the feature. Check the effect by comparing cross-zone traffic from your network or cloud metrics before and after enabling hints, and by confirming the hints are still present in the EndpointSlices after a load test. Your CNI and kube-proxy version also determine whether the hints are honored, so verify that combination in the environment you operate.
Setting up topology aware routing and verifying it
This sequence turns topology aware routing on for one Service, confirms each zone can serve its own traffic, and proves with EndpointSlice data and client tests that requests stay in-zone before the setting is kept.
Confirm consistent zone labels on nodes
Start by listing every node with its topology.kubernetes.io/zone label, for example with kubectl get nodes -L topology.kubernetes.io/zone. Your platform team or cloud provider usually sets these labels, but you should check them rather than assume them. Every schedulable node should carry a zone value, and the zone names should match your actual failure domains. If any node is missing the label, or a zone name is misspelled or duplicated, stop here and fix the labels, because routing hints cannot be built on incomplete zone data. Done means every worker node reports a zone and the zone count matches the infrastructure you expect.
Check replica distribution across zones
For the target Service, list the pods behind it and the zone each pod runs in. Count the ready replicas per zone and compare them with the number of nodes per zone. Routing that keeps traffic local only works well when each zone has enough endpoints to take its share of requests. If one zone has no replicas, or a zone holds far fewer replicas than its share of traffic, pause and adjust pod spreading with topology spread constraints or replica counts before continuing. Confirm the workload's pod anti-affinity or spread rules so that a single zone failure does not remove most endpoints. Continue only when each zone that receives client traffic has at least one ready replica.
Enable the routing setting on the Service
Apply the topology aware routing setting you chose for this cluster to the Service object, using the annotation or field your Kubernetes version and kube-proxy setup support. Confirm the exact key and value in the official Kubernetes documentation for your release before you edit production objects, and record the change in version control. Save the previous Service manifest so you can revert quickly. Done means the Service spec shows the new setting and the change has been applied without errors. Do not change other Service fields in the same edit, so that any later traffic change can be traced to this step.
Roll the workload and read EndpointSlice hints
Restart the Deployment or StatefulSet behind the Service so that the endpoint controller regenerates EndpointSlices with the new hints. Then inspect the EndpointSlice objects for the Service and check that each endpoint carries a zone hint and that the hints map to the zones where the pods run. Count endpoints per zone from the slices and compare them with the per-zone pod counts from the earlier step. A mismatch, missing hints on most endpoints, or hints pointing at a zone with no ready pods means the controller has not caught up or the setting is not taking effect, so stop and investigate before testing traffic. Continue when hints and endpoint counts agree with the pod layout.
Test requests from a client in each zone
Run a short-lived test pod in each zone, pinned with a node selector on the zone label, and send repeated requests to the Service from each one. Record which backend answers, for example by returning the pod name in a test response, and tally the results by zone. Requests from a zone should land on that zone's endpoints in the normal case. If requests from one zone reach other zones at a high rate, check whether that zone has enough endpoints and whether the endpoint balance rules have shifted traffic away, then decide whether to adjust capacity or roll back. Done means each test client shows in-zone responses for the requests you expected to stay local.
Compare traffic and latency before and after
Using the metrics you already collect, compare cross-zone traffic volume and request latency for the Service over a window before and after the change. Your cloud billing data or network flow logs can show inter-zone transfer for the same workload. Ask your platform team to confirm which metrics exist in your environment rather than assuming a specific dashboard. Look for a drop in cross-zone traffic without a rise in error rates or tail latency. If errors rise or one zone shows overload, revert the Service setting, restore the saved manifest, and review the replica layout before trying again. Continue to keep the setting only when the measured effect matches the goal and the service stays healthy.
Document the setting and schedule rechecks
Record the final configuration, the zone label and replica baseline, the test results by zone, and the metrics comparison in the team's runbook or repository. Note the Kubernetes version and kube-proxy mode you tested against, because upgrades can change how hints are handled. Add a check for zone label drift and replica spread to your change review process, and repeat the zone tests after cluster upgrades, node pool changes, or scaling events. Done means another engineer can reproduce the checks and knows the rollback steps.
Operational risks of keeping traffic in-zone
Topology aware routing shifts traffic toward endpoints in the same zone, so the balance of endpoints across zones becomes an operating concern. The cards below cover the failure modes, scaling and rollout effects, scheduling interactions, alerting and security boundaries that the operator must design for and monitor after the hints are enabled.
Zone failure overloads local endpoints
When one zone fails or drains, its clients lose local endpoints and the remaining zones must absorb the load. Hints that keep traffic local can then concentrate requests on a few surviving pods. Before enabling the feature, check how much headroom each zone has for a full zone loss, and confirm with load tests that the remaining endpoints stay within their latency and resource limits. Document the fallback behavior you expect when hints can no longer be satisfied.
Autoscaling shifts endpoint balance
Horizontal autoscaling, node pool scaling and rolling updates change how many endpoints each zone holds, often unevenly. A scale-up that lands mostly in one zone can make hints steer traffic toward it. Review how your autoscaler chooses zones and whether node groups are balanced per zone. Test a scale event and a rollout in a non-production cluster and watch the per-zone endpoint counts while they change.
Disruption budgets and spread constraints
Pod disruption budgets limit how many replicas can be voluntarily evicted, and topology spread constraints decide where replicas land. Together they determine whether each zone keeps enough endpoints during node drains and upgrades. Set spread constraints with zones as the topology key, and size disruption budgets so a drain in one zone cannot leave another zone with too few endpoints to serve its local traffic.
Alert on hint and balance changes
Hints and per-zone endpoint distribution can drift without any error being raised, so a silent change shows up first as higher cross-zone transfer costs or latency. Add alerts for the number of endpoints per zone for critical Services, for hint assignments that are missing, and for cross-zone traffic volume from your monitoring stack. Confirm the exact metric and label names in your version's documentation before writing the alert rules.
Zone labels are not a security boundary
A zone label describes placement and routing, not isolation. Any workload that can create or modify Services and EndpointSlices, or that can set node labels, may influence where traffic goes. Restrict who can change these objects with RBAC, use admission policy to limit label changes on nodes, and keep network policies as the enforcement layer for which workloads may talk to each other, independent of zone placement.
How to check the effect on latency and cross-zone transfer
Record a baseline before you enable topology aware routing, because without one you cannot tell whether the change helped. Capture three measures over a representative period: client-side latency for the calls that matter most, request metrics per Service (rate, error rate and duration, broken down by the zone of the client and the zone of the serving pod) and cross-zone traffic volume. Client-side latency is best taken from the calling application or its service mesh or ingress telemetry, since a Service-level histogram only shows what the server saw. For traffic volume, use whichever source your environment actually exposes: flow logs from your CNI (for example, Cilium's Hubble flow data or Calico flow logs if you have enabled them), node-level network counters, or the cloud provider's own flow logs. Confirm which of these you can collect before the change, because adding a data source after the fact leaves you with no comparison window.
After the change, measure the same series over a comparable window and compare them in the same dashboard. Look at the share of requests that stay in-zone, not only the average latency, because a shift in endpoint balance can move load onto fewer pods and raise tail latency even while the mean looks better. Check error rates and per-zone pod CPU for the same reason. Also confirm the EndpointSlice hints are being applied: the hint is only useful if it appears in the slices your workloads actually use, and the routing decision is made by the data plane you run, so verify with the traffic counters rather than assuming the setting took effect. Expect some cross-zone traffic to remain, for example during rollouts or when a zone has too few endpoints, and record it separately.
Confirm how your provider bills cross-zone transfer before you put a number on the result. Billing rules differ by provider, by region and by whether traffic is inside a single network or crosses a load balancer or a managed service, and some charges are applied on the destination side. Ask your cloud account team or read the provider's current data transfer pricing for your regions, then translate the traffic reduction you measured into billed units. Ask for the same breakdown from your finance or cloud cost tooling so that both the traffic figures and the invoice lines can be reconciled. Keep the baseline and post-change reports together with the change record so that the result can be reviewed later or repeated after a Kubernetes upgrade.
Limits to confirm before you rely on zone routing
Topology aware routing depends on several layers agreeing: the Kubernetes version, the distribution's defaults, the data plane doing the forwarding and the traffic path into the cluster. The cards below are the questions to answer in your own environment before you count on in-zone traffic or its cost savings.
Which version and default setting apply
Ask whether your Kubernetes minor version supports the routing setting you plan to use, and whether your distribution enables it by default or leaves it off. Check the release notes for your exact version rather than relying on older blog posts, since the field's behavior has changed across releases. Record the setting you deploy so the expected behavior is documented during later upgrades.
Kubernetes releasesWhich kube-proxy mode and CNI run the cluster
Confirm whether kube-proxy runs in iptables, IPVS or nftables mode, or whether the CNI replaces kube-proxy entirely. Routing hints are consumed by the component that programs Service forwarding, so a replacement data plane may not honor them the same way. Ask your CNI vendor which Service features it implements and which it leaves to kube-proxy.
Load balancer and external traffic policy fit
Check whether your external load balancer and the Service's external traffic policy interact with zone preference. Traffic entering from outside the cluster may reach a node in another zone before any internal routing decision applies. Ask your network team how the load balancer picks nodes and whether it is zone aware, since that choice sets the cross-zone cost floor.
Headless Services and ingress controllers
Headless Services return pod addresses directly through DNS, so client-side selection may ignore any Service-level zone preference. Ingress controllers usually route to pod endpoints themselves and may bypass kube-proxy entirely. Confirm which of your workloads use headless Services or proxy traffic through an ingress controller, and test those paths separately.
Control plane exposure of the fields
Determine whether your managed or self-hosted control plane lets you set the Service fields that drive zone routing, and whether its admission or policy tools restrict them. Managed providers may expose these settings differently or not at all, and self-hosted clusters need the matching API server and controller configuration in version control. Ask the provider or review your manifests before rollout.
kubeadm HA guideKubernetes topology aware routing questions buyers ask
How much does topology aware routing implementation cost?
Cost depends on how much of the work is configuration and how much is verification and change control. The largest components are the time to confirm which zones each node and workload sits in, the design of how replicas spread across zones, the rollout across namespaces, and the measurement work that shows whether traffic actually stayed in-zone. Setup itself is usually small, so the bigger line items tend to be planning and testing. One-time work covers the design and first rollout. Recurring cost appears only if you retain DeployOpen for ongoing support or periodic review. Ask any quote to itemize discovery, the zone and replica design, the rollout, verification and handover, and to state which items assume your cluster already has consistent zone labels and metrics.
How long does a topology aware routing change take?
Duration is set by the number of clusters and namespaces in scope, how evenly replicas already spread across zones, and how much change approval your organization requires. A single cluster with well-spread deployments moves much faster than a fleet where some services run one replica or where node zone labels are missing or inconsistent. Change windows also matter, because routing changes are best rolled out one service at a time and observed under real load. Ask for a written timeline with separate phases for discovery, a pilot namespace, production rollout and a post-change review, and confirm which dependencies, such as access to metrics or a change calendar, must be ready before the clock starts.
What does our team need to provide for the work?
The work depends on accurate topology data and visibility into traffic. Your team usually needs to provide read access to the cluster, confirmation that nodes carry the zone labels the scheduler and routing logic rely on, and a list of services with their replica counts and autoscaling settings. Metrics access is needed to measure cross-zone traffic before and after the change, and access to logs or flow data helps confirm where requests go. You will also need named owners for each affected service and change windows for production. Ask the engagement scope to list each input, who supplies it, and what happens if a zone label or metrics source is missing.
Can our in-house platform team do topology aware routing alone?
Yes, many platform teams can enable topology aware routing themselves, because the core configuration is a set of annotations and Service settings. The harder parts are judgment calls: deciding which services can tolerate hint-based routing, checking endpoint balance across zones, and interpreting metrics to confirm the change worked. Teams with strong Kubernetes networking knowledge and metrics tooling can often run a pilot internally. Teams with limited cluster time, few replicas per service or no baseline traffic data may benefit from an outside review of the design and effect checks. Ask a partner to state which parts they would hand back to your team and which they would carry out.
What happens to routing when a zone fails?
When a zone fails, traffic that was kept in-zone can be pushed to endpoints in other zones, and the behavior depends on endpoint capacity. If the remaining zones have too few ready endpoints or uneven replicas, hints can cause overload in the surviving zones or fallback behavior you did not plan for. The design therefore needs to set minimum replica counts per zone, check autoscaling headroom and test a zone outage in a non-production environment before relying on the setting. Ask for a failure test plan that covers a single zone loss, verifies that traffic shifts as expected and confirms that services stay within their capacity limits during the shift.
What should we ask for in a written scope?
A written scope should make the boundaries explicit so you can compare proposals. Ask which clusters, namespaces and services are included, and which are excluded. Require the scope to name the Kubernetes version and networking components in use, including the CNI plugin and whether kube-proxy runs in its usual mode. Ask for the zone and replica design, the rollout order, the metrics used to measure cross-zone traffic before and after, and the failure test. Confirm the deliverables, such as configuration changes, a runbook, dashboards and a handover session, and the acceptance criteria. Finally, ask what is out of scope, such as application changes, capacity purchases or changes to other networking features.
Does topology aware routing also affect security or compliance evidence?
Topology aware routing changes where traffic flows inside the cluster, so it can affect network policy design, observability and the records you keep about traffic paths. It does not replace NetworkPolicy, encryption or access controls. Before a change, confirm that policies still match the intended flows and that flow or traffic logs remain available for review. DeployOpen prepares systems and evidence for compliance assessments but does not issue audit reports or certifications, so ask your assessor which records they expect and include them in the scope.
How DeployOpen works on this
DeployOpen scopes topology aware routing as a written, fixed-scope piece of work inside your own clusters. We confirm zone layout, workload traffic and Kubernetes version first, then build, test and hand over the configuration with documentation your platform team can run.
How we scope
- Inventory zones, node labels and per-zone capacity for each cluster in the written scope.
- Identify which Services carry enough traffic to justify hints and which need to stay cluster-wide.
- Confirm the Kubernetes minor version and kube-proxy mode, since hint behavior depends on both.
How we build
- Configure the Service topology setting and check that EndpointSlice hints are populated per zone.
- Test endpoint balance under failover so a single zone cannot overload its local pods.
- Measure cross-zone traffic before and after the change using the metrics your cloud and monitoring stack expose.
How we hand over
- Deliver the manifests, runbook for checking hints, and a record of the verification results.
- Document the fallback behavior when a zone has too few ready endpoints.
- Walk your platform and network teams through the checks they will repeat after each upgrade.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer.
- Retesting after Kubernetes upgrades or topology changes can be added to the written scope.

