From f03a90795fd5479f628306cfd913a66b7409154e Mon Sep 17 00:00:00 2001 From: Matt Klein Date: Wed, 7 Feb 2018 10:59:14 -0800 Subject: [PATCH] cds: add configuration for healthy_panic_threshold (#465) Also setup a message that we can use for other missing settings such as zone aware LB settings. Signed-off-by: Matt Klein --- STYLE.md | 10 +++++++++- docs/root/intro/arch_overview/load_balancing.rst | 6 ++++-- envoy/api/v2/cds.proto | 16 +++++++++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/STYLE.md b/STYLE.md index c8abd336..56c2328c 100644 --- a/STYLE.md +++ b/STYLE.md @@ -42,7 +42,8 @@ In addition, the following conventions should be followed: * Consuming code will break and require source change to match the changes. -* Non-frozen fields should be tagged with `[#not-implemented-hide:]`, `[#not-implemented-warn:]`, `[#proto-status: draft]` or `[#proto-status: experimental]`. +* Non-frozen fields should be tagged with `[#not-implemented-hide:]`, `[#not-implemented-warn:]`, + `[#proto-status: draft]` or `[#proto-status: experimental]`. * Every proto directory should have a `README.md` describing its content. See for example [envoy.service](envoy/service/README.md). @@ -93,6 +94,13 @@ In addition, the following conventions should be followed: pattern forces developers to explicitly choose the correct enum value for their use case, and avoid misunderstanding of the default behavior. +* Proto fields should be sorted logically, not by field number. For large protos, place a comment + at the top that specifies the next free field number. E.g., + + ``` + // [#comment:next free field: 28] + ``` + ## Package organization API definitions are layered hierarchically in packages from top-to-bottom: diff --git a/docs/root/intro/arch_overview/load_balancing.rst b/docs/root/intro/arch_overview/load_balancing.rst index 271419c5..d02d3c51 100644 --- a/docs/root/intro/arch_overview/load_balancing.rst +++ b/docs/root/intro/arch_overview/load_balancing.rst @@ -88,8 +88,10 @@ During load balancing, Envoy will generally only consider healthy hosts in an up However, if the percentage of healthy hosts in the cluster becomes too low, Envoy will disregard health status and balance amongst all hosts. This is known as the *panic threshold*. The default panic threshold is 50%. This is :ref:`configurable ` via -runtime. The panic threshold is used to avoid a situation in which host failures cascade throughout -the cluster as load increases. +runtime as well as in the :ref:`cluster configuration +`. The panic threshold +is used to avoid a situation in which host failures cascade throughout the cluster as load +increases. .. _arch_overview_load_balancing_priority_levels: diff --git a/envoy/api/v2/cds.proto b/envoy/api/v2/cds.proto index 1efc8c5b..f63cb1fb 100644 --- a/envoy/api/v2/cds.proto +++ b/envoy/api/v2/cds.proto @@ -37,6 +37,8 @@ service ClusterDiscoveryService { // [#protodoc-title: Clusters] +// Configuration for a single upstream cluster. +// [#comment:next free field: 28] message Cluster { // Supplies the name of the cluster which must be unique across all clusters. // The cluster name is used when emitting @@ -343,7 +345,17 @@ message Cluster { RingHashLbConfig ring_hash_lb_config = 23; } - // See :ref:`base.TransportSocket` description. + // Common configuration for all load balancer implementations. + message CommonLbConfig { + // Configures the :ref:`healthy panic threshold `. + // If not specified, the default is 50%. + core.Percent healthy_panic_threshold = 1; + } + + // Common configuration for all load balancer implementations. + CommonLbConfig common_lb_config = 27; + + // Optional custom transport socket implementation to use for upstream connections. core.TransportSocket transport_socket = 24; // The Metadata field can be used to provide additional information about the @@ -361,6 +373,8 @@ message Cluster { // Use HTTP1.1 or HTTP2, depending on which one is used on the downstream connection. USE_DOWNSTREAM_PROTOCOL = 1; } + + // Determines how Envoy selects the protocol used to speak to upstream hosts. ClusterProtocolSelection protocol_selection = 26; }