LoadBalancer
The LoadBalancer
filter distributes packets received downstream among all upstream endpoints.
Filter name
quilkin.filters.load_balancer.v1alpha1.LoadBalancer
Configuration Examples
#[tokio::main] async fn main() { let yaml = " version: v1alpha1 static: filters: - name: quilkin.filters.load_balancer.v1alpha1.LoadBalancer config: policy: ROUND_ROBIN endpoints: - address: 127.0.0.1:7001 "; let config = quilkin::config::Config::from_reader(yaml.as_bytes()).unwrap(); assert_eq!(config.source.get_static_filters().unwrap().len(), 1); quilkin::Builder::from(std::sync::Arc::new(config)).validate().unwrap(); }
The load balancing policy (the strategy to use to select what endpoint to send traffic to) is configurable. In the example above, packets will be distributed by selecting endpoints in turn, in round robin fashion.
Configuration Options (Rust Doc)
---
$schema: "http://json-schema.org/draft-07/schema#"
title: Config
description: "The configuration for [`load_balancer`][super]."
type: object
properties:
policy:
default: ROUND_ROBIN
allOf:
- $ref: "#/definitions/Policy"
definitions:
Policy:
description: "Policy represents how a [`load_balancer`][super] distributes packets across endpoints."
type: string
enum:
- ROUND_ROBIN
- RANDOM
- HASH
Metrics
This filter currently does not expose any metrics.