cluster.proto 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181
  1. syntax = "proto3";
  2. package envoy.config.cluster.v3;
  3. import "envoy/config/cluster/v3/circuit_breaker.proto";
  4. import "envoy/config/cluster/v3/filter.proto";
  5. import "envoy/config/cluster/v3/outlier_detection.proto";
  6. import "envoy/config/core/v3/address.proto";
  7. import "envoy/config/core/v3/base.proto";
  8. import "envoy/config/core/v3/config_source.proto";
  9. import "envoy/config/core/v3/extension.proto";
  10. import "envoy/config/core/v3/health_check.proto";
  11. import "envoy/config/core/v3/protocol.proto";
  12. import "envoy/config/core/v3/resolver.proto";
  13. import "envoy/config/endpoint/v3/endpoint.proto";
  14. import "envoy/type/v3/percent.proto";
  15. import "google/protobuf/any.proto";
  16. import "google/protobuf/duration.proto";
  17. import "google/protobuf/struct.proto";
  18. import "google/protobuf/wrappers.proto";
  19. import "xds/core/v3/collection_entry.proto";
  20. import "envoy/annotations/deprecation.proto";
  21. import "udpa/annotations/migrate.proto";
  22. import "udpa/annotations/security.proto";
  23. import "udpa/annotations/status.proto";
  24. import "udpa/annotations/versioning.proto";
  25. import "validate/validate.proto";
  26. option java_package = "io.envoyproxy.envoy.config.cluster.v3";
  27. option java_outer_classname = "ClusterProto";
  28. option java_multiple_files = true;
  29. option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3;clusterv3";
  30. option (udpa.annotations.file_status).package_version_status = ACTIVE;
  31. // [#protodoc-title: Cluster configuration]
  32. // Cluster list collections. Entries are *Cluster* resources or references.
  33. // [#not-implemented-hide:]
  34. message ClusterCollection {
  35. xds.core.v3.CollectionEntry entries = 1;
  36. }
  37. // Configuration for a single upstream cluster.
  38. // [#next-free-field: 57]
  39. message Cluster {
  40. option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.Cluster";
  41. // Refer to :ref:`service discovery type <arch_overview_service_discovery_types>`
  42. // for an explanation on each type.
  43. enum DiscoveryType {
  44. // Refer to the :ref:`static discovery type<arch_overview_service_discovery_types_static>`
  45. // for an explanation.
  46. STATIC = 0;
  47. // Refer to the :ref:`strict DNS discovery
  48. // type<arch_overview_service_discovery_types_strict_dns>`
  49. // for an explanation.
  50. STRICT_DNS = 1;
  51. // Refer to the :ref:`logical DNS discovery
  52. // type<arch_overview_service_discovery_types_logical_dns>`
  53. // for an explanation.
  54. LOGICAL_DNS = 2;
  55. // Refer to the :ref:`service discovery type<arch_overview_service_discovery_types_eds>`
  56. // for an explanation.
  57. EDS = 3;
  58. // Refer to the :ref:`original destination discovery
  59. // type<arch_overview_service_discovery_types_original_destination>`
  60. // for an explanation.
  61. ORIGINAL_DST = 4;
  62. }
  63. // Refer to :ref:`load balancer type <arch_overview_load_balancing_types>` architecture
  64. // overview section for information on each type.
  65. enum LbPolicy {
  66. reserved 4;
  67. reserved "ORIGINAL_DST_LB";
  68. // Refer to the :ref:`round robin load balancing
  69. // policy<arch_overview_load_balancing_types_round_robin>`
  70. // for an explanation.
  71. ROUND_ROBIN = 0;
  72. // Refer to the :ref:`least request load balancing
  73. // policy<arch_overview_load_balancing_types_least_request>`
  74. // for an explanation.
  75. LEAST_REQUEST = 1;
  76. // Refer to the :ref:`ring hash load balancing
  77. // policy<arch_overview_load_balancing_types_ring_hash>`
  78. // for an explanation.
  79. RING_HASH = 2;
  80. // Refer to the :ref:`random load balancing
  81. // policy<arch_overview_load_balancing_types_random>`
  82. // for an explanation.
  83. RANDOM = 3;
  84. // Refer to the :ref:`Maglev load balancing policy<arch_overview_load_balancing_types_maglev>`
  85. // for an explanation.
  86. MAGLEV = 5;
  87. // This load balancer type must be specified if the configured cluster provides a cluster
  88. // specific load balancer. Consult the configured cluster's documentation for whether to set
  89. // this option or not.
  90. CLUSTER_PROVIDED = 6;
  91. // Use the new :ref:`load_balancing_policy
  92. // <envoy_v3_api_field_config.cluster.v3.Cluster.load_balancing_policy>` field to determine the LB policy.
  93. // This has been deprecated in favor of using the :ref:`load_balancing_policy
  94. // <envoy_v3_api_field_config.cluster.v3.Cluster.load_balancing_policy>` field without
  95. // setting any value in :ref:`lb_policy<envoy_v3_api_field_config.cluster.v3.Cluster.lb_policy>`.
  96. LOAD_BALANCING_POLICY_CONFIG = 7;
  97. }
  98. // When V4_ONLY is selected, the DNS resolver will only perform a lookup for
  99. // addresses in the IPv4 family. If V6_ONLY is selected, the DNS resolver will
  100. // only perform a lookup for addresses in the IPv6 family. If AUTO is
  101. // specified, the DNS resolver will first perform a lookup for addresses in
  102. // the IPv6 family and fallback to a lookup for addresses in the IPv4 family.
  103. // This is semantically equivalent to a non-existent V6_PREFERRED option.
  104. // AUTO is a legacy name that is more opaque than
  105. // necessary and will be deprecated in favor of V6_PREFERRED in a future major version of the API.
  106. // If V4_PREFERRED is specified, the DNS resolver will first perform a lookup for addresses in the
  107. // IPv4 family and fallback to a lookup for addresses in the IPv6 family. i.e., the callback
  108. // target will only get v6 addresses if there were NO v4 addresses to return.
  109. // If ALL is specified, the DNS resolver will perform a lookup for both IPv4 and IPv6 families,
  110. // and return all resolved addresses.
  111. // For cluster types other than
  112. // :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>` and
  113. // :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>`,
  114. // this setting is
  115. // ignored.
  116. // [#next-major-version: deprecate AUTO in favor of a V6_PREFERRED option.]
  117. enum DnsLookupFamily {
  118. AUTO = 0;
  119. V4_ONLY = 1;
  120. V6_ONLY = 2;
  121. V4_PREFERRED = 3;
  122. ALL = 4;
  123. }
  124. enum ClusterProtocolSelection {
  125. // Cluster can only operate on one of the possible upstream protocols (HTTP1.1, HTTP2).
  126. // If :ref:`http2_protocol_options <envoy_v3_api_field_config.cluster.v3.Cluster.http2_protocol_options>` are
  127. // present, HTTP2 will be used, otherwise HTTP1.1 will be used.
  128. USE_CONFIGURED_PROTOCOL = 0;
  129. // Use HTTP1.1 or HTTP2, depending on which one is used on the downstream connection.
  130. USE_DOWNSTREAM_PROTOCOL = 1;
  131. }
  132. // TransportSocketMatch specifies what transport socket config will be used
  133. // when the match conditions are satisfied.
  134. message TransportSocketMatch {
  135. option (udpa.annotations.versioning).previous_message_type =
  136. "envoy.api.v2.Cluster.TransportSocketMatch";
  137. // The name of the match, used in stats generation.
  138. string name = 1 [(validate.rules).string = {min_len: 1}];
  139. // Optional endpoint metadata match criteria.
  140. // The connection to the endpoint with metadata matching what is set in this field
  141. // will use the transport socket configuration specified here.
  142. // The endpoint's metadata entry in *envoy.transport_socket_match* is used to match
  143. // against the values specified in this field.
  144. google.protobuf.Struct match = 2;
  145. // The configuration of the transport socket.
  146. // [#extension-category: envoy.transport_sockets.upstream]
  147. core.v3.TransportSocket transport_socket = 3;
  148. }
  149. // Extended cluster type.
  150. message CustomClusterType {
  151. option (udpa.annotations.versioning).previous_message_type =
  152. "envoy.api.v2.Cluster.CustomClusterType";
  153. // The type of the cluster to instantiate. The name must match a supported cluster type.
  154. string name = 1 [(validate.rules).string = {min_len: 1}];
  155. // Cluster specific configuration which depends on the cluster being instantiated.
  156. // See the supported cluster for further documentation.
  157. // [#extension-category: envoy.clusters]
  158. google.protobuf.Any typed_config = 2;
  159. }
  160. // Only valid when discovery type is EDS.
  161. message EdsClusterConfig {
  162. option (udpa.annotations.versioning).previous_message_type =
  163. "envoy.api.v2.Cluster.EdsClusterConfig";
  164. // Configuration for the source of EDS updates for this Cluster.
  165. core.v3.ConfigSource eds_config = 1;
  166. // Optional alternative to cluster name to present to EDS. This does not
  167. // have the same restrictions as cluster name, i.e. it may be arbitrary
  168. // length. This may be a xdstp:// URL.
  169. string service_name = 2;
  170. }
  171. // Optionally divide the endpoints in this cluster into subsets defined by
  172. // endpoint metadata and selected by route and weighted cluster metadata.
  173. // [#next-free-field: 8]
  174. message LbSubsetConfig {
  175. option (udpa.annotations.versioning).previous_message_type =
  176. "envoy.api.v2.Cluster.LbSubsetConfig";
  177. // If NO_FALLBACK is selected, a result
  178. // equivalent to no healthy hosts is reported. If ANY_ENDPOINT is selected,
  179. // any cluster endpoint may be returned (subject to policy, health checks,
  180. // etc). If DEFAULT_SUBSET is selected, load balancing is performed over the
  181. // endpoints matching the values from the default_subset field.
  182. enum LbSubsetFallbackPolicy {
  183. NO_FALLBACK = 0;
  184. ANY_ENDPOINT = 1;
  185. DEFAULT_SUBSET = 2;
  186. }
  187. // Specifications for subsets.
  188. message LbSubsetSelector {
  189. option (udpa.annotations.versioning).previous_message_type =
  190. "envoy.api.v2.Cluster.LbSubsetConfig.LbSubsetSelector";
  191. // Allows to override top level fallback policy per selector.
  192. enum LbSubsetSelectorFallbackPolicy {
  193. // If NOT_DEFINED top level config fallback policy is used instead.
  194. NOT_DEFINED = 0;
  195. // If NO_FALLBACK is selected, a result equivalent to no healthy hosts is reported.
  196. NO_FALLBACK = 1;
  197. // If ANY_ENDPOINT is selected, any cluster endpoint may be returned
  198. // (subject to policy, health checks, etc).
  199. ANY_ENDPOINT = 2;
  200. // If DEFAULT_SUBSET is selected, load balancing is performed over the
  201. // endpoints matching the values from the default_subset field.
  202. DEFAULT_SUBSET = 3;
  203. // If KEYS_SUBSET is selected, subset selector matching is performed again with metadata
  204. // keys reduced to
  205. // :ref:`fallback_keys_subset<envoy_v3_api_field_config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector.fallback_keys_subset>`.
  206. // It allows for a fallback to a different, less specific selector if some of the keys of
  207. // the selector are considered optional.
  208. KEYS_SUBSET = 4;
  209. }
  210. // List of keys to match with the weighted cluster metadata.
  211. repeated string keys = 1;
  212. // Selects a mode of operation in which each subset has only one host. This mode uses the same rules for
  213. // choosing a host, but updating hosts is faster, especially for large numbers of hosts.
  214. //
  215. // If a match is found to a host, that host will be used regardless of priority levels, unless the host is unhealthy.
  216. //
  217. // Currently, this mode is only supported if `subset_selectors` has only one entry, and `keys` contains
  218. // only one entry.
  219. //
  220. // When this mode is enabled, configurations that contain more than one host with the same metadata value for the single key in `keys`
  221. // will use only one of the hosts with the given key; no requests will be routed to the others. The cluster gauge
  222. // :ref:`lb_subsets_single_host_per_subset_duplicate<config_cluster_manager_cluster_stats_subset_lb>` indicates how many duplicates are
  223. // present in the current configuration.
  224. bool single_host_per_subset = 4;
  225. // The behavior used when no endpoint subset matches the selected route's
  226. // metadata.
  227. LbSubsetSelectorFallbackPolicy fallback_policy = 2
  228. [(validate.rules).enum = {defined_only: true}];
  229. // Subset of
  230. // :ref:`keys<envoy_v3_api_field_config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector.keys>` used by
  231. // :ref:`KEYS_SUBSET<envoy_v3_api_enum_value_config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector.LbSubsetSelectorFallbackPolicy.KEYS_SUBSET>`
  232. // fallback policy.
  233. // It has to be a non empty list if KEYS_SUBSET fallback policy is selected.
  234. // For any other fallback policy the parameter is not used and should not be set.
  235. // Only values also present in
  236. // :ref:`keys<envoy_v3_api_field_config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector.keys>` are allowed, but
  237. // `fallback_keys_subset` cannot be equal to `keys`.
  238. repeated string fallback_keys_subset = 3;
  239. }
  240. // The behavior used when no endpoint subset matches the selected route's
  241. // metadata. The value defaults to
  242. // :ref:`NO_FALLBACK<envoy_v3_api_enum_value_config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetFallbackPolicy.NO_FALLBACK>`.
  243. LbSubsetFallbackPolicy fallback_policy = 1 [(validate.rules).enum = {defined_only: true}];
  244. // Specifies the default subset of endpoints used during fallback if
  245. // fallback_policy is
  246. // :ref:`DEFAULT_SUBSET<envoy_v3_api_enum_value_config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetFallbackPolicy.DEFAULT_SUBSET>`.
  247. // Each field in default_subset is
  248. // compared to the matching LbEndpoint.Metadata under the *envoy.lb*
  249. // namespace. It is valid for no hosts to match, in which case the behavior
  250. // is the same as a fallback_policy of
  251. // :ref:`NO_FALLBACK<envoy_v3_api_enum_value_config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetFallbackPolicy.NO_FALLBACK>`.
  252. google.protobuf.Struct default_subset = 2;
  253. // For each entry, LbEndpoint.Metadata's
  254. // *envoy.lb* namespace is traversed and a subset is created for each unique
  255. // combination of key and value. For example:
  256. //
  257. // .. code-block:: json
  258. //
  259. // { "subset_selectors": [
  260. // { "keys": [ "version" ] },
  261. // { "keys": [ "stage", "hardware_type" ] }
  262. // ]}
  263. //
  264. // A subset is matched when the metadata from the selected route and
  265. // weighted cluster contains the same keys and values as the subset's
  266. // metadata. The same host may appear in multiple subsets.
  267. repeated LbSubsetSelector subset_selectors = 3;
  268. // If true, routing to subsets will take into account the localities and locality weights of the
  269. // endpoints when making the routing decision.
  270. //
  271. // There are some potential pitfalls associated with enabling this feature, as the resulting
  272. // traffic split after applying both a subset match and locality weights might be undesirable.
  273. //
  274. // Consider for example a situation in which you have 50/50 split across two localities X/Y
  275. // which have 100 hosts each without subsetting. If the subset LB results in X having only 1
  276. // host selected but Y having 100, then a lot more load is being dumped on the single host in X
  277. // than originally anticipated in the load balancing assignment delivered via EDS.
  278. bool locality_weight_aware = 4;
  279. // When used with locality_weight_aware, scales the weight of each locality by the ratio
  280. // of hosts in the subset vs hosts in the original subset. This aims to even out the load
  281. // going to an individual locality if said locality is disproportionately affected by the
  282. // subset predicate.
  283. bool scale_locality_weight = 5;
  284. // If true, when a fallback policy is configured and its corresponding subset fails to find
  285. // a host this will cause any host to be selected instead.
  286. //
  287. // This is useful when using the default subset as the fallback policy, given the default
  288. // subset might become empty. With this option enabled, if that happens the LB will attempt
  289. // to select a host from the entire cluster.
  290. bool panic_mode_any = 6;
  291. // If true, metadata specified for a metadata key will be matched against the corresponding
  292. // endpoint metadata if the endpoint metadata matches the value exactly OR it is a list value
  293. // and any of the elements in the list matches the criteria.
  294. bool list_as_any = 7;
  295. }
  296. // Configuration for :ref:`slow start mode <arch_overview_load_balancing_slow_start>`.
  297. message SlowStartConfig {
  298. // Represents the size of slow start window.
  299. // If set, the newly created host remains in slow start mode starting from its creation time
  300. // for the duration of slow start window.
  301. google.protobuf.Duration slow_start_window = 1;
  302. // This parameter controls the speed of traffic increase over the slow start window. Defaults to 1.0,
  303. // so that endpoint would get linearly increasing amount of traffic.
  304. // When increasing the value for this parameter, the speed of traffic ramp-up increases non-linearly.
  305. // The value of aggression parameter should be greater than 0.0.
  306. // By tuning the parameter, is possible to achieve polynomial or exponential shape of ramp-up curve.
  307. //
  308. // During slow start window, effective weight of an endpoint would be scaled with time factor and aggression:
  309. // `new_weight = weight * time_factor ^ (1 / aggression)`,
  310. // where `time_factor=(time_since_start_seconds / slow_start_time_seconds)`.
  311. //
  312. // As time progresses, more and more traffic would be sent to endpoint, which is in slow start window.
  313. // Once host exits slow start, time_factor and aggression no longer affect its weight.
  314. core.v3.RuntimeDouble aggression = 2;
  315. }
  316. // Specific configuration for the RoundRobin load balancing policy.
  317. message RoundRobinLbConfig {
  318. // Configuration for slow start mode.
  319. // If this configuration is not set, slow start will not be not enabled.
  320. SlowStartConfig slow_start_config = 1;
  321. }
  322. // Specific configuration for the LeastRequest load balancing policy.
  323. message LeastRequestLbConfig {
  324. option (udpa.annotations.versioning).previous_message_type =
  325. "envoy.api.v2.Cluster.LeastRequestLbConfig";
  326. // The number of random healthy hosts from which the host with the fewest active requests will
  327. // be chosen. Defaults to 2 so that we perform two-choice selection if the field is not set.
  328. google.protobuf.UInt32Value choice_count = 1 [(validate.rules).uint32 = {gte: 2}];
  329. // The following formula is used to calculate the dynamic weights when hosts have different load
  330. // balancing weights:
  331. //
  332. // `weight = load_balancing_weight / (active_requests + 1)^active_request_bias`
  333. //
  334. // The larger the active request bias is, the more aggressively active requests will lower the
  335. // effective weight when all host weights are not equal.
  336. //
  337. // `active_request_bias` must be greater than or equal to 0.0.
  338. //
  339. // When `active_request_bias == 0.0` the Least Request Load Balancer doesn't consider the number
  340. // of active requests at the time it picks a host and behaves like the Round Robin Load
  341. // Balancer.
  342. //
  343. // When `active_request_bias > 0.0` the Least Request Load Balancer scales the load balancing
  344. // weight by the number of active requests at the time it does a pick.
  345. //
  346. // The value is cached for performance reasons and refreshed whenever one of the Load Balancer's
  347. // host sets changes, e.g., whenever there is a host membership update or a host load balancing
  348. // weight change.
  349. //
  350. // .. note::
  351. // This setting only takes effect if all host weights are not equal.
  352. core.v3.RuntimeDouble active_request_bias = 2;
  353. // Configuration for slow start mode.
  354. // If this configuration is not set, slow start will not be not enabled.
  355. SlowStartConfig slow_start_config = 3;
  356. }
  357. // Specific configuration for the :ref:`RingHash<arch_overview_load_balancing_types_ring_hash>`
  358. // load balancing policy.
  359. message RingHashLbConfig {
  360. option (udpa.annotations.versioning).previous_message_type =
  361. "envoy.api.v2.Cluster.RingHashLbConfig";
  362. // The hash function used to hash hosts onto the ketama ring.
  363. enum HashFunction {
  364. // Use `xxHash <https://github.com/Cyan4973/xxHash>`_, this is the default hash function.
  365. XX_HASH = 0;
  366. // Use `MurmurHash2 <https://sites.google.com/site/murmurhash/>`_, this is compatible with
  367. // std:hash<string> in GNU libstdc++ 3.4.20 or above. This is typically the case when compiled
  368. // on Linux and not macOS.
  369. MURMUR_HASH_2 = 1;
  370. }
  371. reserved 2;
  372. // Minimum hash ring size. The larger the ring is (that is, the more hashes there are for each
  373. // provided host) the better the request distribution will reflect the desired weights. Defaults
  374. // to 1024 entries, and limited to 8M entries. See also
  375. // :ref:`maximum_ring_size<envoy_v3_api_field_config.cluster.v3.Cluster.RingHashLbConfig.maximum_ring_size>`.
  376. google.protobuf.UInt64Value minimum_ring_size = 1 [(validate.rules).uint64 = {lte: 8388608}];
  377. // The hash function used to hash hosts onto the ketama ring. The value defaults to
  378. // :ref:`XX_HASH<envoy_v3_api_enum_value_config.cluster.v3.Cluster.RingHashLbConfig.HashFunction.XX_HASH>`.
  379. HashFunction hash_function = 3 [(validate.rules).enum = {defined_only: true}];
  380. // Maximum hash ring size. Defaults to 8M entries, and limited to 8M entries, but can be lowered
  381. // to further constrain resource use. See also
  382. // :ref:`minimum_ring_size<envoy_v3_api_field_config.cluster.v3.Cluster.RingHashLbConfig.minimum_ring_size>`.
  383. google.protobuf.UInt64Value maximum_ring_size = 4 [(validate.rules).uint64 = {lte: 8388608}];
  384. }
  385. // Specific configuration for the :ref:`Maglev<arch_overview_load_balancing_types_maglev>`
  386. // load balancing policy.
  387. message MaglevLbConfig {
  388. // The table size for Maglev hashing. The Maglev aims for ‘minimal disruption’ rather than an absolute guarantee.
  389. // Minimal disruption means that when the set of upstreams changes, a connection will likely be sent to the same
  390. // upstream as it was before. Increasing the table size reduces the amount of disruption.
  391. // The table size must be prime number limited to 5000011. If it is not specified, the default is 65537.
  392. google.protobuf.UInt64Value table_size = 1 [(validate.rules).uint64 = {lte: 5000011}];
  393. }
  394. // Specific configuration for the
  395. // :ref:`Original Destination <arch_overview_load_balancing_types_original_destination>`
  396. // load balancing policy.
  397. message OriginalDstLbConfig {
  398. option (udpa.annotations.versioning).previous_message_type =
  399. "envoy.api.v2.Cluster.OriginalDstLbConfig";
  400. // When true, :ref:`x-envoy-original-dst-host
  401. // <config_http_conn_man_headers_x-envoy-original-dst-host>` can be used to override destination
  402. // address.
  403. //
  404. // .. attention::
  405. //
  406. // This header isn't sanitized by default, so enabling this feature allows HTTP clients to
  407. // route traffic to arbitrary hosts and/or ports, which may have serious security
  408. // consequences.
  409. //
  410. // .. note::
  411. //
  412. // If the header appears multiple times only the first value is used.
  413. bool use_http_header = 1;
  414. }
  415. // Common configuration for all load balancer implementations.
  416. // [#next-free-field: 8]
  417. message CommonLbConfig {
  418. option (udpa.annotations.versioning).previous_message_type =
  419. "envoy.api.v2.Cluster.CommonLbConfig";
  420. // Configuration for :ref:`zone aware routing
  421. // <arch_overview_load_balancing_zone_aware_routing>`.
  422. message ZoneAwareLbConfig {
  423. option (udpa.annotations.versioning).previous_message_type =
  424. "envoy.api.v2.Cluster.CommonLbConfig.ZoneAwareLbConfig";
  425. // Configures percentage of requests that will be considered for zone aware routing
  426. // if zone aware routing is configured. If not specified, the default is 100%.
  427. // * :ref:`runtime values <config_cluster_manager_cluster_runtime_zone_routing>`.
  428. // * :ref:`Zone aware routing support <arch_overview_load_balancing_zone_aware_routing>`.
  429. type.v3.Percent routing_enabled = 1;
  430. // Configures minimum upstream cluster size required for zone aware routing
  431. // If upstream cluster size is less than specified, zone aware routing is not performed
  432. // even if zone aware routing is configured. If not specified, the default is 6.
  433. // * :ref:`runtime values <config_cluster_manager_cluster_runtime_zone_routing>`.
  434. // * :ref:`Zone aware routing support <arch_overview_load_balancing_zone_aware_routing>`.
  435. google.protobuf.UInt64Value min_cluster_size = 2;
  436. // If set to true, Envoy will not consider any hosts when the cluster is in :ref:`panic
  437. // mode<arch_overview_load_balancing_panic_threshold>`. Instead, the cluster will fail all
  438. // requests as if all hosts are unhealthy. This can help avoid potentially overwhelming a
  439. // failing service.
  440. bool fail_traffic_on_panic = 3;
  441. }
  442. // Configuration for :ref:`locality weighted load balancing
  443. // <arch_overview_load_balancing_locality_weighted_lb>`
  444. message LocalityWeightedLbConfig {
  445. option (udpa.annotations.versioning).previous_message_type =
  446. "envoy.api.v2.Cluster.CommonLbConfig.LocalityWeightedLbConfig";
  447. }
  448. // Common Configuration for all consistent hashing load balancers (MaglevLb, RingHashLb, etc.)
  449. message ConsistentHashingLbConfig {
  450. option (udpa.annotations.versioning).previous_message_type =
  451. "envoy.api.v2.Cluster.CommonLbConfig.ConsistentHashingLbConfig";
  452. // If set to `true`, the cluster will use hostname instead of the resolved
  453. // 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.
  454. bool use_hostname_for_hashing = 1;
  455. // Configures percentage of average cluster load to bound per upstream host. For example, with a value of 150
  456. // no upstream host will get a load more than 1.5 times the average load of all the hosts in the cluster.
  457. // If not specified, the load is not bounded for any upstream host. Typical value for this parameter is between 120 and 200.
  458. // Minimum is 100.
  459. //
  460. // Applies to both Ring Hash and Maglev load balancers.
  461. //
  462. // This is implemented based on the method described in the paper https://arxiv.org/abs/1608.01350. For the specified
  463. // `hash_balance_factor`, requests to any upstream host are capped at `hash_balance_factor/100` times the average number of requests
  464. // across the cluster. When a request arrives for an upstream host that is currently serving at its max capacity, linear probing
  465. // is used to identify an eligible host. Further, the linear probe is implemented using a random jump in hosts ring/table to identify
  466. // the eligible host (this technique is as described in the paper https://arxiv.org/abs/1908.08762 - the random jump avoids the
  467. // cascading overflow effect when choosing the next host in the ring/table).
  468. //
  469. // If weights are specified on the hosts, they are respected.
  470. //
  471. // This is an O(N) algorithm, unlike other load balancers. Using a lower `hash_balance_factor` results in more hosts
  472. // being probed, so use a higher value if you require better performance.
  473. google.protobuf.UInt32Value hash_balance_factor = 2 [(validate.rules).uint32 = {gte: 100}];
  474. }
  475. // Configures the :ref:`healthy panic threshold <arch_overview_load_balancing_panic_threshold>`.
  476. // If not specified, the default is 50%.
  477. // To disable panic mode, set to 0%.
  478. //
  479. // .. note::
  480. // The specified percent will be truncated to the nearest 1%.
  481. type.v3.Percent healthy_panic_threshold = 1;
  482. oneof locality_config_specifier {
  483. ZoneAwareLbConfig zone_aware_lb_config = 2;
  484. LocalityWeightedLbConfig locality_weighted_lb_config = 3;
  485. }
  486. // If set, all health check/weight/metadata updates that happen within this duration will be
  487. // merged and delivered in one shot when the duration expires. The start of the duration is when
  488. // the first update happens. This is useful for big clusters, with potentially noisy deploys
  489. // that might trigger excessive CPU usage due to a constant stream of healthcheck state changes
  490. // or metadata updates. The first set of updates to be seen apply immediately (e.g.: a new
  491. // cluster). Please always keep in mind that the use of sandbox technologies may change this
  492. // behavior.
  493. //
  494. // If this is not set, we default to a merge window of 1000ms. To disable it, set the merge
  495. // window to 0.
  496. //
  497. // Note: merging does not apply to cluster membership changes (e.g.: adds/removes); this is
  498. // because merging those updates isn't currently safe. See
  499. // https://github.com/envoyproxy/envoy/pull/3941.
  500. google.protobuf.Duration update_merge_window = 4;
  501. // If set to true, Envoy will :ref:`exclude <arch_overview_load_balancing_excluded>` new hosts
  502. // when computing load balancing weights until they have been health checked for the first time.
  503. // This will have no effect unless active health checking is also configured.
  504. bool ignore_new_hosts_until_first_hc = 5;
  505. // If set to `true`, the cluster manager will drain all existing
  506. // connections to upstream hosts whenever hosts are added or removed from the cluster.
  507. bool close_connections_on_host_set_change = 6;
  508. // Common Configuration for all consistent hashing load balancers (MaglevLb, RingHashLb, etc.)
  509. ConsistentHashingLbConfig consistent_hashing_lb_config = 7;
  510. }
  511. message RefreshRate {
  512. option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.Cluster.RefreshRate";
  513. // Specifies the base interval between refreshes. This parameter is required and must be greater
  514. // than zero and less than
  515. // :ref:`max_interval <envoy_v3_api_field_config.cluster.v3.Cluster.RefreshRate.max_interval>`.
  516. google.protobuf.Duration base_interval = 1 [(validate.rules).duration = {
  517. required: true
  518. gt {nanos: 1000000}
  519. }];
  520. // Specifies the maximum interval between refreshes. This parameter is optional, but must be
  521. // greater than or equal to the
  522. // :ref:`base_interval <envoy_v3_api_field_config.cluster.v3.Cluster.RefreshRate.base_interval>` if set. The default
  523. // is 10 times the :ref:`base_interval <envoy_v3_api_field_config.cluster.v3.Cluster.RefreshRate.base_interval>`.
  524. google.protobuf.Duration max_interval = 2 [(validate.rules).duration = {gt {nanos: 1000000}}];
  525. }
  526. message PreconnectPolicy {
  527. // Indicates how many streams (rounded up) can be anticipated per-upstream for each
  528. // incoming stream. This is useful for high-QPS or latency-sensitive services. Preconnecting
  529. // will only be done if the upstream is healthy and the cluster has traffic.
  530. //
  531. // For example if this is 2, for an incoming HTTP/1.1 stream, 2 connections will be
  532. // established, one for the new incoming stream, and one for a presumed follow-up stream. For
  533. // HTTP/2, only one connection would be established by default as one connection can
  534. // serve both the original and presumed follow-up stream.
  535. //
  536. // In steady state for non-multiplexed connections a value of 1.5 would mean if there were 100
  537. // active streams, there would be 100 connections in use, and 50 connections preconnected.
  538. // This might be a useful value for something like short lived single-use connections,
  539. // for example proxying HTTP/1.1 if keep-alive were false and each stream resulted in connection
  540. // termination. It would likely be overkill for long lived connections, such as TCP proxying SMTP
  541. // or regular HTTP/1.1 with keep-alive. For long lived traffic, a value of 1.05 would be more
  542. // reasonable, where for every 100 connections, 5 preconnected connections would be in the queue
  543. // in case of unexpected disconnects where the connection could not be reused.
  544. //
  545. // If this value is not set, or set explicitly to one, Envoy will fetch as many connections
  546. // as needed to serve streams in flight. This means in steady state if a connection is torn down,
  547. // a subsequent streams will pay an upstream-rtt latency penalty waiting for a new connection.
  548. //
  549. // This is limited somewhat arbitrarily to 3 because preconnecting too aggressively can
  550. // harm latency more than the preconnecting helps.
  551. google.protobuf.DoubleValue per_upstream_preconnect_ratio = 1
  552. [(validate.rules).double = {lte: 3.0 gte: 1.0}];
  553. // Indicates how many many streams (rounded up) can be anticipated across a cluster for each
  554. // stream, useful for low QPS services. This is currently supported for a subset of
  555. // deterministic non-hash-based load-balancing algorithms (weighted round robin, random).
  556. // Unlike *per_upstream_preconnect_ratio* this preconnects across the upstream instances in a
  557. // cluster, doing best effort predictions of what upstream would be picked next and
  558. // pre-establishing a connection.
  559. //
  560. // Preconnecting will be limited to one preconnect per configured upstream in the cluster and will
  561. // only be done if there are healthy upstreams and the cluster has traffic.
  562. //
  563. // For example if preconnecting is set to 2 for a round robin HTTP/2 cluster, on the first
  564. // incoming stream, 2 connections will be preconnected - one to the first upstream for this
  565. // cluster, one to the second on the assumption there will be a follow-up stream.
  566. //
  567. // If this value is not set, or set explicitly to one, Envoy will fetch as many connections
  568. // as needed to serve streams in flight, so during warm up and in steady state if a connection
  569. // is closed (and per_upstream_preconnect_ratio is not set), there will be a latency hit for
  570. // connection establishment.
  571. //
  572. // If both this and preconnect_ratio are set, Envoy will make sure both predicted needs are met,
  573. // basically preconnecting max(predictive-preconnect, per-upstream-preconnect), for each
  574. // upstream.
  575. google.protobuf.DoubleValue predictive_preconnect_ratio = 2
  576. [(validate.rules).double = {lte: 3.0 gte: 1.0}];
  577. }
  578. reserved 12, 15, 7, 11, 35;
  579. reserved "hosts", "tls_context", "extension_protocol_options";
  580. // Configuration to use different transport sockets for different endpoints.
  581. // The entry of *envoy.transport_socket_match* in the
  582. // :ref:`LbEndpoint.Metadata <envoy_v3_api_field_config.endpoint.v3.LbEndpoint.metadata>`
  583. // is used to match against the transport sockets as they appear in the list. The first
  584. // :ref:`match <envoy_v3_api_msg_config.cluster.v3.Cluster.TransportSocketMatch>` is used.
  585. // For example, with the following match
  586. //
  587. // .. code-block:: yaml
  588. //
  589. // transport_socket_matches:
  590. // - name: "enableMTLS"
  591. // match:
  592. // acceptMTLS: true
  593. // transport_socket:
  594. // name: envoy.transport_sockets.tls
  595. // config: { ... } # tls socket configuration
  596. // - name: "defaultToPlaintext"
  597. // match: {}
  598. // transport_socket:
  599. // name: envoy.transport_sockets.raw_buffer
  600. //
  601. // Connections to the endpoints whose metadata value under *envoy.transport_socket_match*
  602. // having "acceptMTLS"/"true" key/value pair use the "enableMTLS" socket configuration.
  603. //
  604. // If a :ref:`socket match <envoy_v3_api_msg_config.cluster.v3.Cluster.TransportSocketMatch>` with empty match
  605. // criteria is provided, that always match any endpoint. For example, the "defaultToPlaintext"
  606. // socket match in case above.
  607. //
  608. // If an endpoint metadata's value under *envoy.transport_socket_match* does not match any
  609. // *TransportSocketMatch*, socket configuration fallbacks to use the *tls_context* or
  610. // *transport_socket* specified in this cluster.
  611. //
  612. // This field allows gradual and flexible transport socket configuration changes.
  613. //
  614. // The metadata of endpoints in EDS can indicate transport socket capabilities. For example,
  615. // an endpoint's metadata can have two key value pairs as "acceptMTLS": "true",
  616. // "acceptPlaintext": "true". While some other endpoints, only accepting plaintext traffic
  617. // has "acceptPlaintext": "true" metadata information.
  618. //
  619. // Then the xDS server can configure the CDS to a client, Envoy A, to send mutual TLS
  620. // traffic for endpoints with "acceptMTLS": "true", by adding a corresponding
  621. // *TransportSocketMatch* in this field. Other client Envoys receive CDS without
  622. // *transport_socket_match* set, and still send plain text traffic to the same cluster.
  623. //
  624. // This field can be used to specify custom transport socket configurations for health
  625. // checks by adding matching key/value pairs in a health check's
  626. // :ref:`transport socket match criteria <envoy_v3_api_field_config.core.v3.HealthCheck.transport_socket_match_criteria>` field.
  627. //
  628. // [#comment:TODO(incfly): add a detailed architecture doc on intended usage.]
  629. repeated TransportSocketMatch transport_socket_matches = 43;
  630. // Supplies the name of the cluster which must be unique across all clusters.
  631. // The cluster name is used when emitting
  632. // :ref:`statistics <config_cluster_manager_cluster_stats>` if :ref:`alt_stat_name
  633. // <envoy_v3_api_field_config.cluster.v3.Cluster.alt_stat_name>` is not provided.
  634. // Any ``:`` in the cluster name will be converted to ``_`` when emitting statistics.
  635. string name = 1 [(validate.rules).string = {min_len: 1}];
  636. // An optional alternative to the cluster name to be used for observability. This name is used
  637. // emitting stats for the cluster and access logging the cluster name. This will appear as
  638. // additional information in configuration dumps of a cluster's current status as
  639. // :ref:`observability_name <envoy_v3_api_field_admin.v3.ClusterStatus.observability_name>`
  640. // and as an additional tag "upstream_cluster.name" while tracing. Note: Any ``:`` in the name
  641. // will be converted to ``_`` when emitting statistics. This should not be confused with
  642. // :ref:`Router Filter Header <config_http_filters_router_x-envoy-upstream-alt-stat-name>`.
  643. string alt_stat_name = 28 [(udpa.annotations.field_migrate).rename = "observability_name"];
  644. oneof cluster_discovery_type {
  645. // The :ref:`service discovery type <arch_overview_service_discovery_types>`
  646. // to use for resolving the cluster.
  647. DiscoveryType type = 2 [(validate.rules).enum = {defined_only: true}];
  648. // The custom cluster type.
  649. CustomClusterType cluster_type = 38;
  650. }
  651. // Configuration to use for EDS updates for the Cluster.
  652. EdsClusterConfig eds_cluster_config = 3;
  653. // The timeout for new network connections to hosts in the cluster.
  654. // If not set, a default value of 5s will be used.
  655. google.protobuf.Duration connect_timeout = 4 [(validate.rules).duration = {gt {}}];
  656. // Soft limit on size of the cluster’s connections read and write buffers. If
  657. // unspecified, an implementation defined default is applied (1MiB).
  658. google.protobuf.UInt32Value per_connection_buffer_limit_bytes = 5
  659. [(udpa.annotations.security).configure_for_untrusted_upstream = true];
  660. // The :ref:`load balancer type <arch_overview_load_balancing_types>` to use
  661. // when picking a host in the cluster.
  662. LbPolicy lb_policy = 6 [(validate.rules).enum = {defined_only: true}];
  663. // Setting this is required for specifying members of
  664. // :ref:`STATIC<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STATIC>`,
  665. // :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`
  666. // or :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` clusters.
  667. // This field supersedes the *hosts* field in the v2 API.
  668. //
  669. // .. attention::
  670. //
  671. // Setting this allows non-EDS cluster types to contain embedded EDS equivalent
  672. // :ref:`endpoint assignments<envoy_v3_api_msg_config.endpoint.v3.ClusterLoadAssignment>`.
  673. //
  674. endpoint.v3.ClusterLoadAssignment load_assignment = 33;
  675. // Optional :ref:`active health checking <arch_overview_health_checking>`
  676. // configuration for the cluster. If no
  677. // configuration is specified no health checking will be done and all cluster
  678. // members will be considered healthy at all times.
  679. repeated core.v3.HealthCheck health_checks = 8;
  680. // Optional maximum requests for a single upstream connection. This parameter
  681. // is respected by both the HTTP/1.1 and HTTP/2 connection pool
  682. // implementations. If not specified, there is no limit. Setting this
  683. // parameter to 1 will effectively disable keep alive.
  684. //
  685. // .. attention::
  686. // This field has been deprecated in favor of the :ref:`max_requests_per_connection <envoy_v3_api_field_config.core.v3.HttpProtocolOptions.max_requests_per_connection>` field.
  687. google.protobuf.UInt32Value max_requests_per_connection = 9
  688. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  689. // Optional :ref:`circuit breaking <arch_overview_circuit_break>` for the cluster.
  690. CircuitBreakers circuit_breakers = 10;
  691. // HTTP protocol options that are applied only to upstream HTTP connections.
  692. // These options apply to all HTTP versions.
  693. // This has been deprecated in favor of
  694. // :ref:`upstream_http_protocol_options <envoy_v3_api_field_extensions.upstreams.http.v3.HttpProtocolOptions.upstream_http_protocol_options>`
  695. // in the :ref:`http_protocol_options <envoy_v3_api_msg_extensions.upstreams.http.v3.HttpProtocolOptions>` message.
  696. // upstream_http_protocol_options can be set via the cluster's
  697. // :ref:`extension_protocol_options<envoy_v3_api_field_config.cluster.v3.Cluster.typed_extension_protocol_options>`.
  698. // See :ref:`upstream_http_protocol_options
  699. // <envoy_v3_api_field_extensions.upstreams.http.v3.HttpProtocolOptions.upstream_http_protocol_options>`
  700. // for example usage.
  701. core.v3.UpstreamHttpProtocolOptions upstream_http_protocol_options = 46
  702. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  703. // Additional options when handling HTTP requests upstream. These options will be applicable to
  704. // both HTTP1 and HTTP2 requests.
  705. // This has been deprecated in favor of
  706. // :ref:`common_http_protocol_options <envoy_v3_api_field_extensions.upstreams.http.v3.HttpProtocolOptions.common_http_protocol_options>`
  707. // in the :ref:`http_protocol_options <envoy_v3_api_msg_extensions.upstreams.http.v3.HttpProtocolOptions>` message.
  708. // common_http_protocol_options can be set via the cluster's
  709. // :ref:`extension_protocol_options<envoy_v3_api_field_config.cluster.v3.Cluster.typed_extension_protocol_options>`.
  710. // See :ref:`upstream_http_protocol_options
  711. // <envoy_v3_api_field_extensions.upstreams.http.v3.HttpProtocolOptions.upstream_http_protocol_options>`
  712. // for example usage.
  713. core.v3.HttpProtocolOptions common_http_protocol_options = 29
  714. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  715. // Additional options when handling HTTP1 requests.
  716. // This has been deprecated in favor of http_protocol_options fields in the
  717. // :ref:`http_protocol_options <envoy_v3_api_msg_extensions.upstreams.http.v3.HttpProtocolOptions>` message.
  718. // http_protocol_options can be set via the cluster's
  719. // :ref:`extension_protocol_options<envoy_v3_api_field_config.cluster.v3.Cluster.typed_extension_protocol_options>`.
  720. // See :ref:`upstream_http_protocol_options
  721. // <envoy_v3_api_field_extensions.upstreams.http.v3.HttpProtocolOptions.upstream_http_protocol_options>`
  722. // for example usage.
  723. core.v3.Http1ProtocolOptions http_protocol_options = 13
  724. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  725. // Even if default HTTP2 protocol options are desired, this field must be
  726. // set so that Envoy will assume that the upstream supports HTTP/2 when
  727. // making new HTTP connection pool connections. Currently, Envoy only
  728. // supports prior knowledge for upstream connections. Even if TLS is used
  729. // with ALPN, `http2_protocol_options` must be specified. As an aside this allows HTTP/2
  730. // connections to happen over plain text.
  731. // This has been deprecated in favor of http2_protocol_options fields in the
  732. // :ref:`http_protocol_options <envoy_v3_api_msg_extensions.upstreams.http.v3.HttpProtocolOptions>`
  733. // message. http2_protocol_options can be set via the cluster's
  734. // :ref:`extension_protocol_options<envoy_v3_api_field_config.cluster.v3.Cluster.typed_extension_protocol_options>`.
  735. // See :ref:`upstream_http_protocol_options
  736. // <envoy_v3_api_field_extensions.upstreams.http.v3.HttpProtocolOptions.upstream_http_protocol_options>`
  737. // for example usage.
  738. core.v3.Http2ProtocolOptions http2_protocol_options = 14 [
  739. deprecated = true,
  740. (udpa.annotations.security).configure_for_untrusted_upstream = true,
  741. (envoy.annotations.deprecated_at_minor_version) = "3.0"
  742. ];
  743. // The extension_protocol_options field is used to provide extension-specific protocol options
  744. // for upstream connections. The key should match the extension filter name, such as
  745. // "envoy.filters.network.thrift_proxy". See the extension's documentation for details on
  746. // specific options.
  747. // [#next-major-version: make this a list of typed extensions.]
  748. map<string, google.protobuf.Any> typed_extension_protocol_options = 36;
  749. // If the DNS refresh rate is specified and the cluster type is either
  750. // :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`,
  751. // or :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>`,
  752. // this value is used as the cluster’s DNS refresh
  753. // rate. The value configured must be at least 1ms. If this setting is not specified, the
  754. // value defaults to 5000ms. For cluster types other than
  755. // :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`
  756. // and :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>`
  757. // this setting is ignored.
  758. google.protobuf.Duration dns_refresh_rate = 16
  759. [(validate.rules).duration = {gt {nanos: 1000000}}];
  760. // If the DNS failure refresh rate is specified and the cluster type is either
  761. // :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`,
  762. // or :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>`,
  763. // this is used as the cluster’s DNS refresh rate when requests are failing. If this setting is
  764. // not specified, the failure refresh rate defaults to the DNS refresh rate. For cluster types
  765. // other than :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>` and
  766. // :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` this setting is
  767. // ignored.
  768. RefreshRate dns_failure_refresh_rate = 44;
  769. // Optional configuration for setting cluster's DNS refresh rate. If the value is set to true,
  770. // cluster's DNS refresh rate will be set to resource record's TTL which comes from DNS
  771. // resolution.
  772. bool respect_dns_ttl = 39;
  773. // The DNS IP address resolution policy. If this setting is not specified, the
  774. // value defaults to
  775. // :ref:`AUTO<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DnsLookupFamily.AUTO>`.
  776. DnsLookupFamily dns_lookup_family = 17 [(validate.rules).enum = {defined_only: true}];
  777. // If DNS resolvers are specified and the cluster type is either
  778. // :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`,
  779. // or :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>`,
  780. // this value is used to specify the cluster’s dns resolvers.
  781. // If this setting is not specified, the value defaults to the default
  782. // resolver, which uses /etc/resolv.conf for configuration. For cluster types
  783. // other than
  784. // :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`
  785. // and :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>`
  786. // this setting is ignored.
  787. // This field is deprecated in favor of *dns_resolution_config*
  788. // which aggregates all of the DNS resolver configuration in a single message.
  789. repeated core.v3.Address dns_resolvers = 18
  790. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  791. // Always use TCP queries instead of UDP queries for DNS lookups.
  792. // This field is deprecated in favor of *dns_resolution_config*
  793. // which aggregates all of the DNS resolver configuration in a single message.
  794. bool use_tcp_for_dns_lookups = 45
  795. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  796. // DNS resolution configuration which includes the underlying dns resolver addresses and options.
  797. // This field is deprecated in favor of
  798. // :ref:`typed_dns_resolver_config <envoy_v3_api_field_config.cluster.v3.Cluster.typed_dns_resolver_config>`.
  799. core.v3.DnsResolutionConfig dns_resolution_config = 53
  800. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  801. // DNS resolver type configuration extension. This extension can be used to configure c-ares, apple,
  802. // or any other DNS resolver types and the related parameters.
  803. // For example, an object of
  804. // :ref:`CaresDnsResolverConfig <envoy_v3_api_msg_extensions.network.dns_resolver.cares.v3.CaresDnsResolverConfig>`
  805. // can be packed into this *typed_dns_resolver_config*. This configuration replaces the
  806. // :ref:`dns_resolution_config <envoy_v3_api_field_config.cluster.v3.Cluster.dns_resolution_config>`
  807. // configuration.
  808. // During the transition period when both *dns_resolution_config* and *typed_dns_resolver_config* exists,
  809. // when *typed_dns_resolver_config* is in place, Envoy will use it and ignore *dns_resolution_config*.
  810. // When *typed_dns_resolver_config* is missing, the default behavior is in place.
  811. // [#extension-category: envoy.network.dns_resolver]
  812. core.v3.TypedExtensionConfig typed_dns_resolver_config = 55;
  813. // Optional configuration for having cluster readiness block on warm-up. Currently, only applicable for
  814. // :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`,
  815. // or :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>`.
  816. // If true, cluster readiness blocks on warm-up. If false, the cluster will complete
  817. // initialization whether or not warm-up has completed. Defaults to true.
  818. google.protobuf.BoolValue wait_for_warm_on_init = 54;
  819. // If specified, outlier detection will be enabled for this upstream cluster.
  820. // Each of the configuration values can be overridden via
  821. // :ref:`runtime values <config_cluster_manager_cluster_runtime_outlier_detection>`.
  822. OutlierDetection outlier_detection = 19;
  823. // The interval for removing stale hosts from a cluster type
  824. // :ref:`ORIGINAL_DST<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.ORIGINAL_DST>`.
  825. // Hosts are considered stale if they have not been used
  826. // as upstream destinations during this interval. New hosts are added
  827. // to original destination clusters on demand as new connections are
  828. // redirected to Envoy, causing the number of hosts in the cluster to
  829. // grow over time. Hosts that are not stale (they are actively used as
  830. // destinations) are kept in the cluster, which allows connections to
  831. // them remain open, saving the latency that would otherwise be spent
  832. // on opening new connections. If this setting is not specified, the
  833. // value defaults to 5000ms. For cluster types other than
  834. // :ref:`ORIGINAL_DST<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.ORIGINAL_DST>`
  835. // this setting is ignored.
  836. google.protobuf.Duration cleanup_interval = 20 [(validate.rules).duration = {gt {}}];
  837. // Optional configuration used to bind newly established upstream connections.
  838. // This overrides any bind_config specified in the bootstrap proto.
  839. // If the address and port are empty, no bind will be performed.
  840. core.v3.BindConfig upstream_bind_config = 21;
  841. // Configuration for load balancing subsetting.
  842. LbSubsetConfig lb_subset_config = 22;
  843. // Optional configuration for the load balancing algorithm selected by
  844. // LbPolicy. Currently only
  845. // :ref:`RING_HASH<envoy_v3_api_enum_value_config.cluster.v3.Cluster.LbPolicy.RING_HASH>`,
  846. // :ref:`MAGLEV<envoy_v3_api_enum_value_config.cluster.v3.Cluster.LbPolicy.MAGLEV>` and
  847. // :ref:`LEAST_REQUEST<envoy_v3_api_enum_value_config.cluster.v3.Cluster.LbPolicy.LEAST_REQUEST>`
  848. // has additional configuration options.
  849. // Specifying ring_hash_lb_config or maglev_lb_config or least_request_lb_config without setting the corresponding
  850. // LbPolicy will generate an error at runtime.
  851. oneof lb_config {
  852. // Optional configuration for the Ring Hash load balancing policy.
  853. RingHashLbConfig ring_hash_lb_config = 23;
  854. // Optional configuration for the Maglev load balancing policy.
  855. MaglevLbConfig maglev_lb_config = 52;
  856. // Optional configuration for the Original Destination load balancing policy.
  857. OriginalDstLbConfig original_dst_lb_config = 34;
  858. // Optional configuration for the LeastRequest load balancing policy.
  859. LeastRequestLbConfig least_request_lb_config = 37;
  860. // Optional configuration for the RoundRobin load balancing policy.
  861. RoundRobinLbConfig round_robin_lb_config = 56;
  862. }
  863. // Common configuration for all load balancer implementations.
  864. CommonLbConfig common_lb_config = 27;
  865. // Optional custom transport socket implementation to use for upstream connections.
  866. // To setup TLS, set a transport socket with name `envoy.transport_sockets.tls` and
  867. // :ref:`UpstreamTlsContexts <envoy_v3_api_msg_extensions.transport_sockets.tls.v3.UpstreamTlsContext>` in the `typed_config`.
  868. // If no transport socket configuration is specified, new connections
  869. // will be set up with plaintext.
  870. core.v3.TransportSocket transport_socket = 24;
  871. // The Metadata field can be used to provide additional information about the
  872. // cluster. It can be used for stats, logging, and varying filter behavior.
  873. // Fields should use reverse DNS notation to denote which entity within Envoy
  874. // will need the information. For instance, if the metadata is intended for
  875. // the Router filter, the filter name should be specified as *envoy.filters.http.router*.
  876. core.v3.Metadata metadata = 25;
  877. // Determines how Envoy selects the protocol used to speak to upstream hosts.
  878. // This has been deprecated in favor of setting explicit protocol selection
  879. // in the :ref:`http_protocol_options
  880. // <envoy_v3_api_msg_extensions.upstreams.http.v3.HttpProtocolOptions>` message.
  881. // http_protocol_options can be set via the cluster's
  882. // :ref:`extension_protocol_options<envoy_v3_api_field_config.cluster.v3.Cluster.typed_extension_protocol_options>`.
  883. ClusterProtocolSelection protocol_selection = 26
  884. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  885. // Optional options for upstream connections.
  886. UpstreamConnectionOptions upstream_connection_options = 30;
  887. // If an upstream host becomes unhealthy (as determined by the configured health checks
  888. // or outlier detection), immediately close all connections to the failed host.
  889. //
  890. // .. note::
  891. //
  892. // This is currently only supported for connections created by tcp_proxy.
  893. //
  894. // .. note::
  895. //
  896. // The current implementation of this feature closes all connections immediately when
  897. // the unhealthy status is detected. If there are a large number of connections open
  898. // to an upstream host that becomes unhealthy, Envoy may spend a substantial amount of
  899. // time exclusively closing these connections, and not processing any other traffic.
  900. bool close_connections_on_host_health_failure = 31;
  901. // If set to true, Envoy will ignore the health value of a host when processing its removal
  902. // from service discovery. This means that if active health checking is used, Envoy will *not*
  903. // wait for the endpoint to go unhealthy before removing it.
  904. bool ignore_health_on_host_removal = 32;
  905. // An (optional) network filter chain, listed in the order the filters should be applied.
  906. // The chain will be applied to all outgoing connections that Envoy makes to the upstream
  907. // servers of this cluster.
  908. repeated Filter filters = 40;
  909. // If this field is set and is supported by the client, it will supersede the value of
  910. // :ref:`lb_policy<envoy_v3_api_field_config.cluster.v3.Cluster.lb_policy>`.
  911. LoadBalancingPolicy load_balancing_policy = 41;
  912. // [#not-implemented-hide:]
  913. // If present, tells the client where to send load reports via LRS. If not present, the
  914. // client will fall back to a client-side default, which may be either (a) don't send any
  915. // load reports or (b) send load reports for all clusters to a single default server
  916. // (which may be configured in the bootstrap file).
  917. //
  918. // Note that if multiple clusters point to the same LRS server, the client may choose to
  919. // create a separate stream for each cluster or it may choose to coalesce the data for
  920. // multiple clusters onto a single stream. Either way, the client must make sure to send
  921. // the data for any given cluster on no more than one stream.
  922. //
  923. // [#next-major-version: In the v3 API, we should consider restructuring this somehow,
  924. // maybe by allowing LRS to go on the ADS stream, or maybe by moving some of the negotiation
  925. // from the LRS stream here.]
  926. core.v3.ConfigSource lrs_server = 42;
  927. // If track_timeout_budgets is true, the :ref:`timeout budget histograms
  928. // <config_cluster_manager_cluster_stats_timeout_budgets>` will be published for each
  929. // request. These show what percentage of a request's per try and global timeout was used. A value
  930. // of 0 would indicate that none of the timeout was used or that the timeout was infinite. A value
  931. // of 100 would indicate that the request took the entirety of the timeout given to it.
  932. //
  933. // .. attention::
  934. //
  935. // This field has been deprecated in favor of `timeout_budgets`, part of
  936. // :ref:`track_cluster_stats <envoy_v3_api_field_config.cluster.v3.Cluster.track_cluster_stats>`.
  937. bool track_timeout_budgets = 47
  938. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  939. // Optional customization and configuration of upstream connection pool, and upstream type.
  940. //
  941. // Currently this field only applies for HTTP traffic but is designed for eventual use for custom
  942. // TCP upstreams.
  943. //
  944. // For HTTP traffic, Envoy will generally take downstream HTTP and send it upstream as upstream
  945. // HTTP, using the http connection pool and the codec from `http2_protocol_options`
  946. //
  947. // For routes where CONNECT termination is configured, Envoy will take downstream CONNECT
  948. // requests and forward the CONNECT payload upstream over raw TCP using the tcp connection pool.
  949. //
  950. // The default pool used is the generic connection pool which creates the HTTP upstream for most
  951. // HTTP requests, and the TCP upstream if CONNECT termination is configured.
  952. //
  953. // If users desire custom connection pool or upstream behavior, for example terminating
  954. // CONNECT only if a custom filter indicates it is appropriate, the custom factories
  955. // can be registered and configured here.
  956. // [#extension-category: envoy.upstreams]
  957. core.v3.TypedExtensionConfig upstream_config = 48;
  958. // Configuration to track optional cluster stats.
  959. TrackClusterStats track_cluster_stats = 49;
  960. // Preconnect configuration for this cluster.
  961. PreconnectPolicy preconnect_policy = 50;
  962. // If `connection_pool_per_downstream_connection` is true, the cluster will use a separate
  963. // connection pool for every downstream connection
  964. bool connection_pool_per_downstream_connection = 51;
  965. }
  966. // Extensible load balancing policy configuration.
  967. //
  968. // Every LB policy defined via this mechanism will be identified via a unique name using reverse
  969. // DNS notation. If the policy needs configuration parameters, it must define a message for its
  970. // own configuration, which will be stored in the config field. The name of the policy will tell
  971. // clients which type of message they should expect to see in the config field.
  972. //
  973. // Note that there are cases where it is useful to be able to independently select LB policies
  974. // for choosing a locality and for choosing an endpoint within that locality. For example, a
  975. // given deployment may always use the same policy to choose the locality, but for choosing the
  976. // endpoint within the locality, some clusters may use weighted-round-robin, while others may
  977. // use some sort of session-based balancing.
  978. //
  979. // This can be accomplished via hierarchical LB policies, where the parent LB policy creates a
  980. // child LB policy for each locality. For each request, the parent chooses the locality and then
  981. // delegates to the child policy for that locality to choose the endpoint within the locality.
  982. //
  983. // To facilitate this, the config message for the top-level LB policy may include a field of
  984. // type LoadBalancingPolicy that specifies the child policy.
  985. message LoadBalancingPolicy {
  986. option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.LoadBalancingPolicy";
  987. message Policy {
  988. option (udpa.annotations.versioning).previous_message_type =
  989. "envoy.api.v2.LoadBalancingPolicy.Policy";
  990. reserved 2, 1, 3;
  991. reserved "config", "name", "typed_config";
  992. core.v3.TypedExtensionConfig typed_extension_config = 4;
  993. }
  994. // Each client will iterate over the list in order and stop at the first policy that it
  995. // supports. This provides a mechanism for starting to use new LB policies that are not yet
  996. // supported by all clients.
  997. repeated Policy policies = 1;
  998. }
  999. // An extensible structure containing the address Envoy should bind to when
  1000. // establishing upstream connections.
  1001. message UpstreamBindConfig {
  1002. option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.UpstreamBindConfig";
  1003. // The address Envoy should bind to when establishing upstream connections.
  1004. core.v3.Address source_address = 1;
  1005. }
  1006. message UpstreamConnectionOptions {
  1007. option (udpa.annotations.versioning).previous_message_type =
  1008. "envoy.api.v2.UpstreamConnectionOptions";
  1009. // If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives.
  1010. core.v3.TcpKeepalive tcp_keepalive = 1;
  1011. }
  1012. message TrackClusterStats {
  1013. // If timeout_budgets is true, the :ref:`timeout budget histograms
  1014. // <config_cluster_manager_cluster_stats_timeout_budgets>` will be published for each
  1015. // request. These show what percentage of a request's per try and global timeout was used. A value
  1016. // of 0 would indicate that none of the timeout was used or that the timeout was infinite. A value
  1017. // of 100 would indicate that the request took the entirety of the timeout given to it.
  1018. bool timeout_budgets = 1;
  1019. // If request_response_sizes is true, then the :ref:`histograms
  1020. // <config_cluster_manager_cluster_stats_request_response_sizes>` tracking header and body sizes
  1021. // of requests and responses will be published.
  1022. bool request_response_sizes = 2;
  1023. }