@@ -209,7 +209,7 @@ message Cluster {
209209
210210 // Optionally divide the endpoints in this cluster into subsets defined by
211211 // endpoint metadata and selected by route and weighted cluster metadata.
212- // [#next-free-field: 8 ]
212+ // [#next-free-field: 9 ]
213213 message LbSubsetConfig {
214214 option (udpa.annotations.versioning ).previous_message_type =
215215 "envoy.api.v2.Cluster.LbSubsetConfig" ;
@@ -225,6 +225,52 @@ message Cluster {
225225 DEFAULT_SUBSET = 2 ;
226226 }
227227
228+ enum LbSubsetMetadataFallbackPolicy {
229+ // No fallback. Route metadata will be used as-is.
230+ METADATA_NO_FALLBACK = 0 ;
231+
232+ // A special metadata key ``fallback_list`` will be used to provide variants of metadata to try.
233+ // Value of ``fallback_list`` key has to be a list. Every list element has to be a struct - it will
234+ // be merged with route metadata, overriding keys that appear in both places.
235+ // ``fallback_list`` entries will be used in order until a host is found.
236+ //
237+ // ``fallback_list`` key itself is removed from metadata before subset load balancing is performed.
238+ //
239+ // Example:
240+ //
241+ // for metadata:
242+ //
243+ // .. code-block:: yaml
244+ //
245+ // version: 1.0
246+ // fallback_list:
247+ // - version: 2.0
248+ // hardware: c64
249+ // - hardware: c32
250+ // - version: 3.0
251+ //
252+ // at first, metadata:
253+ //
254+ // .. code-block:: json
255+ //
256+ // {"version": "2.0", "hardware": "c64"}
257+ //
258+ // will be used for load balancing. If no host is found, metadata:
259+ //
260+ // .. code-block:: json
261+ //
262+ // {"version": "1.0", "hardware": "c32"}
263+ //
264+ // is next to try. If it still results in no host, finally metadata:
265+ //
266+ // .. code-block:: json
267+ //
268+ // {"version": "3.0"}
269+ //
270+ // is used.
271+ FALLBACK_LIST = 1 ;
272+ }
273+
228274 // Specifications for subsets.
229275 message LbSubsetSelector {
230276 option (udpa.annotations.versioning ).previous_message_type =
@@ -260,10 +306,7 @@ message Cluster {
260306 // Selects a mode of operation in which each subset has only one host. This mode uses the same rules for
261307 // choosing a host, but updating hosts is faster, especially for large numbers of hosts.
262308 //
263- // If a match is found to a host, that host will be used regardless of priority levels, unless the host is unhealthy.
264- //
265- // Currently, this mode is only supported if ``subset_selectors`` has only one entry, and ``keys`` contains
266- // only one entry.
309+ // If a match is found to a host, that host will be used regardless of priority levels.
267310 //
268311 // When this mode is enabled, configurations that contain more than one host with the same metadata value for the single key in ``keys``
269312 // will use only one of the hosts with the given key; no requests will be routed to the others. The cluster gauge
@@ -349,6 +392,16 @@ message Cluster {
349392 // endpoint metadata if the endpoint metadata matches the value exactly OR it is a list value
350393 // and any of the elements in the list matches the criteria.
351394 bool list_as_any = 7 ;
395+
396+ // Fallback mechanism that allows to try different route metadata until a host is found.
397+ // If load balancing process, including all its mechanisms (like
398+ // :ref:`fallback_policy<envoy_v3_api_field_config.cluster.v3.Cluster.LbSubsetConfig.fallback_policy>`)
399+ // fails to select a host, this policy decides if and how the process is repeated using another metadata.
400+ //
401+ // The value defaults to
402+ // :ref:`METADATA_NO_FALLBACK<envoy_v3_api_enum_value_config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetMetadataFallbackPolicy.METADATA_NO_FALLBACK>`.
403+ LbSubsetMetadataFallbackPolicy metadata_fallback_policy = 8
404+ [(validate.rules ).enum = {defined_only : true}];
352405 }
353406
354407 // Configuration for :ref:`slow start mode <arch_overview_load_balancing_slow_start>`.
@@ -462,8 +515,8 @@ message Cluster {
462515 // Specific configuration for the :ref:`Maglev<arch_overview_load_balancing_types_maglev>`
463516 // load balancing policy.
464517 message MaglevLbConfig {
465- // The table size for Maglev hashing. The Maglev aims for ‘ minimal disruption’ rather than an absolute guarantee.
466- // Minimal disruption means that when the set of upstreams changes , a connection will likely be sent to the same
518+ // The table size for Maglev hashing. Maglev aims for " minimal disruption" rather than an absolute guarantee.
519+ // Minimal disruption means that when the set of upstream hosts change , a connection will likely be sent to the same
467520 // upstream as it was before. Increasing the table size reduces the amount of disruption.
468521 // The table size must be prime number limited to 5000011. If it is not specified, the default is 65537.
469522 google.protobuf.UInt64Value table_size = 1 [(validate.rules ).uint64 = {lte : 5000011 }];
@@ -493,6 +546,10 @@ message Cluster {
493546 // The http header to override destination address if :ref:`use_http_header <envoy_v3_api_field_config.cluster.v3.Cluster.OriginalDstLbConfig.use_http_header>`.
494547 // is set to true. If the value is empty, :ref:`x-envoy-original-dst-host <config_http_conn_man_headers_x-envoy-original-dst-host>` will be used.
495548 string http_header_name = 2 ;
549+
550+ // The port to override for the original dst address. This port
551+ // will take precedence over filter state and header override ports
552+ google.protobuf.UInt32Value upstream_port_override = 3 [(validate.rules ).uint32 = {lte : 65535 }];
496553 }
497554
498555 // Common configuration for all load balancer implementations.
@@ -1167,15 +1224,6 @@ message LoadBalancingPolicy {
11671224 repeated Policy policies = 1 ;
11681225}
11691226
1170- // An extensible structure containing the address Envoy should bind to when
1171- // establishing upstream connections.
1172- message UpstreamBindConfig {
1173- option (udpa.annotations.versioning ).previous_message_type = "envoy.api.v2.UpstreamBindConfig" ;
1174-
1175- // The address Envoy should bind to when establishing upstream connections.
1176- core.v3.Address source_address = 1 ;
1177- }
1178-
11791227message UpstreamConnectionOptions {
11801228 option (udpa.annotations.versioning ).previous_message_type =
11811229 "envoy.api.v2.UpstreamConnectionOptions" ;
0 commit comments