Load Balancing Settings
Load Balancing Policy
Load Balancing Policy defines the load balancing strategy between multiple upstream servers.
See Envoy documentation for more details.
How to configure
Some policy types support additional configuration.
- Core
- Enterprise
- Kubernetes
Config file keys | Type | Usage | Default |
---|---|---|---|
lb_policy | enum | optional | ROUND_ROBIN |
Examples
routes:
- from: https://myapp.localhost.pomerium.io
to:
- http://myapp-srv-1:8080
- http://myapp-srv-2:8080
- http://myapp-srv-3:8080
- http://myapp-srv-4:8080
- http://myapp-srv-5:8080
lb_policy: LEAST_REQUEST
least_request_lb_config:
choice_count: 2 # current envoy default
Set the Load Balancing Policy in the Console:
Annotation name | Type | Usage | Default |
---|---|---|---|
lb_policy | enum | optional | ROUND_ROBIN |
Examples
ingress.pomerium.io/lb_policy: LEAST_REQUEST
ingress.pomerium.io/least_request_lb_config: '{"choice_count": 2}'
See Kubernetes - Ingress Configuration for more information.
Load Balancing Policy options
Load Balancer Policy options |
---|
ROUND_ROBIN |
RING_HASH (may be further configured using ring_hash_lb_config option) |
LEAST_REQUEST (may be further configured using least_request_lb_config ) |
RANDOM |
MAGLEV (may be further configured using maglev_lb_config option) |
Health Checks
When defined, Health Checks will issue periodic health check requests to upstream servers and unhealthy upstream servers won't serve traffic.
See Envoy's outlier_detection
for automatic upstream server health detection. In the presence of multiple upstream servers, it is recommended to set up either health_checks
, outlier_detection
, or both.
Supported health checks parameters
Config file keys | Definition | Type | Usage |
---|---|---|---|
timeout | The total time to wait for a health check response. | Duration | required |
interval | The interval between health checks. | Duration | required |
unhealthy_threshold | The number of unhealthy health checks required before a host is marked unhealthy. | UInt32Value | required |
healthy_threshold | The number of healthy health checks required before a host is marked healthy. | UInt32Value | required |
See the Envoy documentation for a list of supported parameters.
How to configure
You may configure only one of the following options per health_check
object definition:
http_health_check
tcp_health_check
grpc_health_check