loadbalancer: Add hostname support for ring hash and maglev (#10233)

Signed-off-by: Vivian Mathews <vivian.mathews@shopify.com>

Mirrored from https://github.com/envoyproxy/envoy @ 7f80d6346ed3367aca56a669789143433a02224a
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent 158c3a65f0
commit ebbc2b0043
  1. 12
      envoy/api/v2/cluster.proto
  2. 15
      envoy/config/cluster/v3/cluster.proto

@ -354,7 +354,7 @@ message Cluster {
} }
// Common configuration for all load balancer implementations. // Common configuration for all load balancer implementations.
// [#next-free-field: 7] // [#next-free-field: 8]
message CommonLbConfig { message CommonLbConfig {
// Configuration for :ref:`zone aware routing // Configuration for :ref:`zone aware routing
// <arch_overview_load_balancing_zone_aware_routing>`. // <arch_overview_load_balancing_zone_aware_routing>`.
@ -384,6 +384,13 @@ message Cluster {
message LocalityWeightedLbConfig { message LocalityWeightedLbConfig {
} }
// Common Configuration for all consistent hashing load balancers (MaglevLb, RingHashLb, etc.)
message ConsistentHashingLbConfig {
// If set to `true`, the cluster will use hostname instead of the resolved
// address as the key to consistently hash to an upstream host. Only valid for StrictDNS clusters with hostnames which resolve to a single IP address.
bool use_hostname_for_hashing = 1;
}
// Configures the :ref:`healthy panic threshold <arch_overview_load_balancing_panic_threshold>`. // Configures the :ref:`healthy panic threshold <arch_overview_load_balancing_panic_threshold>`.
// If not specified, the default is 50%. // If not specified, the default is 50%.
// To disable panic mode, set to 0%. // To disable panic mode, set to 0%.
@ -438,6 +445,9 @@ message Cluster {
// If set to `true`, the cluster manager will drain all existing // If set to `true`, the cluster manager will drain all existing
// connections to upstream hosts whenever hosts are added or removed from the cluster. // connections to upstream hosts whenever hosts are added or removed from the cluster.
bool close_connections_on_host_set_change = 6; bool close_connections_on_host_set_change = 6;
//Common Configuration for all consistent hashing load balancers (MaglevLb, RingHashLb, etc.)
ConsistentHashingLbConfig consistent_hashing_lb_config = 7;
} }
message RefreshRate { message RefreshRate {

@ -373,7 +373,7 @@ message Cluster {
} }
// Common configuration for all load balancer implementations. // Common configuration for all load balancer implementations.
// [#next-free-field: 7] // [#next-free-field: 8]
message CommonLbConfig { message CommonLbConfig {
option (udpa.annotations.versioning).previous_message_type = option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.Cluster.CommonLbConfig"; "envoy.api.v2.Cluster.CommonLbConfig";
@ -411,6 +411,16 @@ message Cluster {
"envoy.api.v2.Cluster.CommonLbConfig.LocalityWeightedLbConfig"; "envoy.api.v2.Cluster.CommonLbConfig.LocalityWeightedLbConfig";
} }
// Common Configuration for all consistent hashing load balancers (MaglevLb, RingHashLb, etc.)
message ConsistentHashingLbConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.Cluster.CommonLbConfig.ConsistentHashingLbConfig";
// If set to `true`, the cluster will use hostname instead of the resolved
// address as the key to consistently hash to an upstream host. Only valid for StrictDNS clusters with hostnames which resolve to a single IP address.
bool use_hostname_for_hashing = 1;
}
// Configures the :ref:`healthy panic threshold <arch_overview_load_balancing_panic_threshold>`. // Configures the :ref:`healthy panic threshold <arch_overview_load_balancing_panic_threshold>`.
// If not specified, the default is 50%. // If not specified, the default is 50%.
// To disable panic mode, set to 0%. // To disable panic mode, set to 0%.
@ -465,6 +475,9 @@ message Cluster {
// If set to `true`, the cluster manager will drain all existing // If set to `true`, the cluster manager will drain all existing
// connections to upstream hosts whenever hosts are added or removed from the cluster. // connections to upstream hosts whenever hosts are added or removed from the cluster.
bool close_connections_on_host_set_change = 6; bool close_connections_on_host_set_change = 6;
//Common Configuration for all consistent hashing load balancers (MaglevLb, RingHashLb, etc.)
ConsistentHashingLbConfig consistent_hashing_lb_config = 7;
} }
message RefreshRate { message RefreshRate {

Loading…
Cancel
Save