Load balancing policies

Extendable load balancing policies can be configured separately for each cluster, also by calling APIs.

Developers can implement custom, configurable policies in C++.

Note

In the past, Envoy used an enum to specify load balancing policies. This enum is still supported for backward compatibility, but deprecated.

extendable load balancing policies should be used instead.

Taking random load balancing policy as an example:

name: example_cluster
type: STRICT_DNS
connect_timeout: 0.25s
load_assignment:
  cluster_name: example_cluster
  endpoints:
  - lb_endpoints:
    - endpoint:
        address:
          socket_address:
            address: example.com
            port_value: 80
load_balancing_policy:
  policies:
  - typed_extension_config:
      name: envoy.load_balancing_policies.random
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.load_balancing_policies.random.v3.Random