For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Waypoint
Learn how L7 load balancing, outlier detection, and failover work for waypoint proxies.
When a waypoint proxy is in the path, L7 load balancing applies. Waypoints use the HBONE protocol to talk directly to the backend or to the next hop. On that leg of the path, traffic is not captured by the ztunnel, so Envoy performs L7 load balancing.
Traffic distribution still applies, such as on the waypoint’s service and on the backend service. When you need finer control than traffic distribution provides, you can apply an Istio DestinationRule, such as for HTTP-based outlier detection or a custom failover order. The rule is enforced at the waypoint and overrides the traffic distribution setting for that host.
Cluster scenarios
The following diagrams give examples of how the waypoint handles load balancing, outlier detection, and failover in single-cluster and multicluster setups.
Single-cluster scenario
- The request routes from the client app to the backend app.
- Both the client and backend services are enrolled in the ambient mesh and run in the same cluster.
- The backend app has L7 policies defined that are enforced by a waypoint proxy.
- The backend service has multiple replicas distributed across different zones or regions within the cluster.
- Optionally, the
spec.trafficDistributionornetworking.istio.io/traffic-distributionsetting is configured on the backend service to control locality-based load balancing.
graph LR
Client[Client pod] -->|1. L4| Ztunnel1[Client<br/>ztunnel]
Ztunnel1 -->|2. HBONE| Waypoint[Waypoint<br/>L7 proxy]
Waypoint -->|3. Load balancing| Backend1[Backend pod<br/>✓ Healthy]
Waypoint -->|3. Load balancing| Backend2[Backend pod<br/>✓ Healthy]
Waypoint -.->|"Outlier detection: ejected"| Backend3[Backend pod<br/>✗ Unhealthy]
style Waypoint fill:#2068F3,color:#fff
Multicluster scenario
- The request routes from the client app to the backend app.
- Both the client and backend services are enrolled in the ambient mesh.
- The backend app has L7 policies defined that are enforced by a waypoint proxy.
- The backend app is exposed as a global service with the
solo.io/service-scope=globalannotation. - The
networking.istio.io/traffic-distributionannotation is set on the global service. Note that other service-scope annotations likesolo.io/service-scope=global-only,solo.io/service-scope=segment,solo.io/service-scope=cluster, orsolo.io/service-takeover: true, behave in the same way. Only the number of endpoints that can be addressed differs, such as only the endpoints within the same cluster or segment.
graph LR
subgraph Cluster1["Cluster 1"]
Client[Client pod]
Ztunnel1[Client<br/>ztunnel]
Waypoint[Waypoint]
Backend1[Backend pod<br/>✓ Healthy]
Client -->|1. L4| Ztunnel1
Ztunnel1 -->|2. HBONE| Waypoint
Waypoint -->|"3. Local endpoint<br/>(global service)"| Backend1
end
subgraph Cluster2["Cluster 2"]
Backend2[Backend pod<br/>✓ Healthy]
Backend3[Backend pod<br/>✗ Unhealthy]
end
Waypoint -->|"3. Cross-cluster<br/>(global service)"| Backend2
Waypoint -.->|"Outlier detection: ejected"| Backend3
style Waypoint fill:#2068F3,color:#fff
Locality determination
Traffic flows through two paths when using waypoints, and locality is determined separately in each path.
Client (ztunnel) → waypoint:
- Endpoints are determined by comparing the client’s ztunnel locality with the locality labels on the waypoint.
- After locality is determined, the traffic distribution mode on the waypoint applies. For example, the default
PreferClosemode prefers a waypoint that is in the same network, region, and zone as the client, and falls back to a waypoint in a farther locality when no closer waypoint is available. - This behavior follows the L4 ztunnel failover behavior.
Waypoint → backend:
- Endpoints are determined by comparing the waypoint’s locality with the locality of the backend.
- After locality is determined, the traffic distribution mode on the backend applies. For example, if the backend has the
Anymode, the waypoint distributes requests across all backend endpoints with no locality preference. - This behavior follows the L7 Envoy failover behavior.
Load balancing
Client (ztunnel) → waypoint:
Traffic distribution is enforced via the traffic distribution setting on the service that exposes the waypoint Gateway. The following precedence order applies:
- Service
spec.trafficDistribution(highest precedence, Kubernetes-native, supportsPreferCloseonly) - Service
networking.istio.io/traffic-distributionannotation (Istio-extended, supports all modes) - Namespace
networking.istio.io/traffic-distributionannotation (Istio-extended, supports all modes) Any(lowest precedence). In this case, no locality preference applies, and the client ztunnel selects uniformly across every waypoint endpoint.
Defaults: When you create a waypoint Gateway, Istio generates the service for the waypoint and annotates that service with networking.istio.io/traffic-distribution: PreferClose. The waypoint therefore defaults to PreferClose.
Warning
The PreferClose default for a waypoint comes from the generated annotation, not from the lowest level of the precedence order. To set your own annotations on the generated waypoint service, use the spec.infrastructure.annotations field on the waypoint Gateway. An annotation that you set there replaces the generated one. If you replace PreferClose with Any, the waypoint loses every locality preference, including the preference for waypoint endpoints in the client’s own network.
Waypoint → backend:
Traffic distribution is enforced via the traffic distribution setting on the global service. The following precedence order applies:
- Service
spec.trafficDistribution(highest precedence, Kubernetes-native, supportsPreferCloseonly) - Service
networking.istio.io/traffic-distributionannotation (Istio-extended, supports all modes) - ServiceEntry
networking.istio.io/traffic-distributionannotation (Istio-extended, supports all modes). Use this when you use a ServiceEntry. - Namespace
networking.istio.io/traffic-distributionannotation (Istio-extended, supports all modes) UNSPECIFIED_MODE(default, lowest precedence). In this case, the behavior of thePreferNetworkmode is used.
Defaults: If you do not explicitly set traffic distribution modes, PreferClose is used for the waypoint, because Istio annotates the generated waypoint service with that mode. For a global service, PreferNetwork is used for the backend, because multicluster peering annotates the generated ServiceEntry with that mode. A backend service that is not exposed across clusters uses Any.
To review the available traffic distribution modes and how each mode prioritizes endpoints, see Traffic distribution modes and endpoint priority. Note that these modes apply only if no DestinationRule is in place.
Waypoint selection across peered clusters
When you peer clusters, the waypoint instances that share a name and namespace merge into a single waypoint service. Each instance becomes an endpoint of that merged service, and the client ztunnel selects between those endpoints.
Only the instances in the client’s own network are selectable. An instance that runs in a cluster on a remote network is reached through the east-west gateway of that cluster, and does not become an endpoint of the merged waypoint service.
Priority level spillover
When traffic distribution creates priority levels for endpoints, Envoy selects a priority level for each request before it selects a locality or an endpoint. While all endpoints in the highest priority level are healthy, Envoy sends all traffic to that level, regardless of request load. For details, see Priority levels in the Envoy documentation.
Envoy spills over traffic to a lower priority level only as endpoints in a higher priority level become unhealthy, such as when outlier detection ejects them. Envoy multiplies the percentage of healthy endpoints in a priority level by an overprovisioning factor (default 1.4) to calculate the share of traffic that level keeps. With the default factor, a priority level keeps all traffic until fewer than approximately 71% (100 / 1.4) of its endpoints are healthy. Below that threshold, Envoy sends the remaining share to the next priority level. For example, if 60% of the endpoints in the highest priority level are healthy, that level keeps 84% of traffic and the next level receives 16%.
Because request load does not move traffic between priority levels, the waypoints in each zone must have enough capacity for the traffic from clients in that zone. If waypoint replicas are unevenly distributed relative to client traffic, the waypoints in an under-provisioned zone can become overloaded while waypoints in other zones are underused. To prevent these hot spots, spread waypoint replicas across zones in proportion to the client traffic in each zone.
Outlier detection and failover
The traffic distribution settings that are previously described are the recommended method for detecting and handling unhealthy endpoints.
If these settings cannot meet your requirements, you can define an Istio DestinationRule with outlier detection settings in the spec.trafficPolicy.outlierDetection section. For more information, see the Istio reference for outlierDetection.
The DestinationRule is applied at the waypoint and targets the backend service hostname. In a multicluster setup, use the global service hostname (such as productpage.bookinfo.mesh.internal). In a single-cluster setup, use the standard Kubernetes service hostname (such as productpage.bookinfo.svc.cluster.local or productpage). If multiple services are served by the waypoint, you can specify the hostname of each service in the DestinationRule to set different behavior for each service.
Note that you cannot define a DestinationRule on the request path from the client to the waypoint. However, the logic in DestinationRule that you create for the backend hosts also applies to the path from the client to the waypoint.
For example configurations, see DestinationRule examples.