Locality-aware Load Balancing

New to Kuma? You don’t need this, Check the MeshLoadBalancingStrategy policy instead.

In a multi-zone deployment, locality-aware load balancing instructs data plane proxies to try to keep requests within one zone. The amount of traffic that remains in one zone depends on the health of the service endpoints in that zone.

By way of example, consider a request from a service in Kuma zone east to another service backend. If all of the endpoints for backend in zone east are healthy, the request will be sent to one of those endpoints rather than to another zone.

As more backend endpoints in zone east become unhealthy, some traffic begins to flow to backend instances in other zones. Locality-aware load balancing is currently implemented using Envoy priorites, see the Envoy documentation for more details.

Enabling locality-aware load balancing

Locality-aware load balancing is configured at the Mesh level. It can be enabled as follows:

  1. apiVersion: kuma.io/v1alpha1
  2. kind: Mesh
  3. metadata:
  4. name: default
  5. spec:
  6. routing:
  7. localityAwareLoadBalancing: true

The configuration can be applied with kubectl apply -f [..].

  1. type: Mesh
  2. name: default
  3. routing:
  4. localityAwareLoadBalancing: true

The configuration can be applied with kumactl apply -f [..] or via the HTTP API.