cluster.proto 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. syntax = "proto3";
  2. package envoy.api.v2;
  3. import "envoy/api/v2/auth/tls.proto";
  4. import "envoy/api/v2/cluster/circuit_breaker.proto";
  5. import "envoy/api/v2/cluster/filter.proto";
  6. import "envoy/api/v2/cluster/outlier_detection.proto";
  7. import "envoy/api/v2/core/address.proto";
  8. import "envoy/api/v2/core/base.proto";
  9. import "envoy/api/v2/core/config_source.proto";
  10. import "envoy/api/v2/core/health_check.proto";
  11. import "envoy/api/v2/core/protocol.proto";
  12. import "envoy/api/v2/endpoint.proto";
  13. import "envoy/type/percent.proto";
  14. import "google/protobuf/any.proto";
  15. import "google/protobuf/duration.proto";
  16. import "google/protobuf/struct.proto";
  17. import "google/protobuf/wrappers.proto";
  18. import "envoy/annotations/deprecation.proto";
  19. import "udpa/annotations/migrate.proto";
  20. import "udpa/annotations/status.proto";
  21. import "validate/validate.proto";
  22. option java_package = "io.envoyproxy.envoy.api.v2";
  23. option java_outer_classname = "ClusterProto";
  24. option java_multiple_files = true;
  25. option go_package = "github.com/envoyproxy/go-control-plane/envoy/api/v2;apiv2";
  26. option (udpa.annotations.file_migrate).move_to_package = "envoy.config.cluster.v3";
  27. option (udpa.annotations.file_status).package_version_status = FROZEN;
  28. // [#protodoc-title: Cluster configuration]
  29. // Configuration for a single upstream cluster.
  30. // [#next-free-field: 48]
  31. message Cluster {
  32. // Refer to :ref:`service discovery type <arch_overview_service_discovery_types>`
  33. // for an explanation on each type.
  34. enum DiscoveryType {
  35. // Refer to the :ref:`static discovery type<arch_overview_service_discovery_types_static>`
  36. // for an explanation.
  37. STATIC = 0;
  38. // Refer to the :ref:`strict DNS discovery
  39. // type<arch_overview_service_discovery_types_strict_dns>`
  40. // for an explanation.
  41. STRICT_DNS = 1;
  42. // Refer to the :ref:`logical DNS discovery
  43. // type<arch_overview_service_discovery_types_logical_dns>`
  44. // for an explanation.
  45. LOGICAL_DNS = 2;
  46. // Refer to the :ref:`service discovery type<arch_overview_service_discovery_types_eds>`
  47. // for an explanation.
  48. EDS = 3;
  49. // Refer to the :ref:`original destination discovery
  50. // type<arch_overview_service_discovery_types_original_destination>`
  51. // for an explanation.
  52. ORIGINAL_DST = 4;
  53. }
  54. // Refer to :ref:`load balancer type <arch_overview_load_balancing_types>` architecture
  55. // overview section for information on each type.
  56. enum LbPolicy {
  57. // Refer to the :ref:`round robin load balancing
  58. // policy<arch_overview_load_balancing_types_round_robin>`
  59. // for an explanation.
  60. ROUND_ROBIN = 0;
  61. // Refer to the :ref:`least request load balancing
  62. // policy<arch_overview_load_balancing_types_least_request>`
  63. // for an explanation.
  64. LEAST_REQUEST = 1;
  65. // Refer to the :ref:`ring hash load balancing
  66. // policy<arch_overview_load_balancing_types_ring_hash>`
  67. // for an explanation.
  68. RING_HASH = 2;
  69. // Refer to the :ref:`random load balancing
  70. // policy<arch_overview_load_balancing_types_random>`
  71. // for an explanation.
  72. RANDOM = 3;
  73. // Refer to the :ref:`original destination load balancing
  74. // policy<arch_overview_load_balancing_types_original_destination>`
  75. // for an explanation.
  76. //
  77. // .. attention::
  78. //
  79. // **This load balancing policy is deprecated**. Use CLUSTER_PROVIDED instead.
  80. //
  81. ORIGINAL_DST_LB = 4 [deprecated = true, (envoy.annotations.disallowed_by_default_enum) = true];
  82. // Refer to the :ref:`Maglev load balancing policy<arch_overview_load_balancing_types_maglev>`
  83. // for an explanation.
  84. MAGLEV = 5;
  85. // This load balancer type must be specified if the configured cluster provides a cluster
  86. // specific load balancer. Consult the configured cluster's documentation for whether to set
  87. // this option or not.
  88. CLUSTER_PROVIDED = 6;
  89. // [#not-implemented-hide:] Use the new :ref:`load_balancing_policy
  90. // <envoy_api_field_Cluster.load_balancing_policy>` field to determine the LB policy.
  91. // [#next-major-version: In the v3 API, we should consider deprecating the lb_policy field
  92. // and instead using the new load_balancing_policy field as the one and only mechanism for
  93. // configuring this.]
  94. LOAD_BALANCING_POLICY_CONFIG = 7;
  95. }
  96. // When V4_ONLY is selected, the DNS resolver will only perform a lookup for
  97. // addresses in the IPv4 family. If V6_ONLY is selected, the DNS resolver will
  98. // only perform a lookup for addresses in the IPv6 family. If AUTO is
  99. // specified, the DNS resolver will first perform a lookup for addresses in
  100. // the IPv6 family and fallback to a lookup for addresses in the IPv4 family.
  101. // For cluster types other than
  102. // :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>` and
  103. // :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>`,
  104. // this setting is
  105. // ignored.
  106. enum DnsLookupFamily {
  107. AUTO = 0;
  108. V4_ONLY = 1;
  109. V6_ONLY = 2;
  110. }
  111. enum ClusterProtocolSelection {
  112. // Cluster can only operate on one of the possible upstream protocols (HTTP1.1, HTTP2).
  113. // If :ref:`http2_protocol_options <envoy_api_field_Cluster.http2_protocol_options>` are
  114. // present, HTTP2 will be used, otherwise HTTP1.1 will be used.
  115. USE_CONFIGURED_PROTOCOL = 0;
  116. // Use HTTP1.1 or HTTP2, depending on which one is used on the downstream connection.
  117. USE_DOWNSTREAM_PROTOCOL = 1;
  118. }
  119. // TransportSocketMatch specifies what transport socket config will be used
  120. // when the match conditions are satisfied.
  121. message TransportSocketMatch {
  122. // The name of the match, used in stats generation.
  123. string name = 1 [(validate.rules).string = {min_len: 1}];
  124. // Optional endpoint metadata match criteria.
  125. // The connection to the endpoint with metadata matching what is set in this field
  126. // will use the transport socket configuration specified here.
  127. // The endpoint's metadata entry in *envoy.transport_socket_match* is used to match
  128. // against the values specified in this field.
  129. google.protobuf.Struct match = 2;
  130. // The configuration of the transport socket.
  131. core.TransportSocket transport_socket = 3;
  132. }
  133. // Extended cluster type.
  134. message CustomClusterType {
  135. // The type of the cluster to instantiate. The name must match a supported cluster type.
  136. string name = 1 [(validate.rules).string = {min_bytes: 1}];
  137. // Cluster specific configuration which depends on the cluster being instantiated.
  138. // See the supported cluster for further documentation.
  139. google.protobuf.Any typed_config = 2;
  140. }
  141. // Only valid when discovery type is EDS.
  142. message EdsClusterConfig {
  143. // Configuration for the source of EDS updates for this Cluster.
  144. core.ConfigSource eds_config = 1;
  145. // Optional alternative to cluster name to present to EDS. This does not
  146. // have the same restrictions as cluster name, i.e. it may be arbitrary
  147. // length.
  148. string service_name = 2;
  149. }
  150. // Optionally divide the endpoints in this cluster into subsets defined by
  151. // endpoint metadata and selected by route and weighted cluster metadata.
  152. // [#next-free-field: 8]
  153. message LbSubsetConfig {
  154. // If NO_FALLBACK is selected, a result
  155. // equivalent to no healthy hosts is reported. If ANY_ENDPOINT is selected,
  156. // any cluster endpoint may be returned (subject to policy, health checks,
  157. // etc). If DEFAULT_SUBSET is selected, load balancing is performed over the
  158. // endpoints matching the values from the default_subset field.
  159. enum LbSubsetFallbackPolicy {
  160. NO_FALLBACK = 0;
  161. ANY_ENDPOINT = 1;
  162. DEFAULT_SUBSET = 2;
  163. }
  164. // Specifications for subsets.
  165. message LbSubsetSelector {
  166. // Allows to override top level fallback policy per selector.
  167. enum LbSubsetSelectorFallbackPolicy {
  168. // If NOT_DEFINED top level config fallback policy is used instead.
  169. NOT_DEFINED = 0;
  170. // If NO_FALLBACK is selected, a result equivalent to no healthy hosts is reported.
  171. NO_FALLBACK = 1;
  172. // If ANY_ENDPOINT is selected, any cluster endpoint may be returned
  173. // (subject to policy, health checks, etc).
  174. ANY_ENDPOINT = 2;
  175. // If DEFAULT_SUBSET is selected, load balancing is performed over the
  176. // endpoints matching the values from the default_subset field.
  177. DEFAULT_SUBSET = 3;
  178. // If KEYS_SUBSET is selected, subset selector matching is performed again with metadata
  179. // keys reduced to
  180. // :ref:`fallback_keys_subset<envoy_api_field_Cluster.LbSubsetConfig.LbSubsetSelector.fallback_keys_subset>`.
  181. // It allows for a fallback to a different, less specific selector if some of the keys of
  182. // the selector are considered optional.
  183. KEYS_SUBSET = 4;
  184. }
  185. // List of keys to match with the weighted cluster metadata.
  186. repeated string keys = 1;
  187. // The behavior used when no endpoint subset matches the selected route's
  188. // metadata.
  189. LbSubsetSelectorFallbackPolicy fallback_policy = 2
  190. [(validate.rules).enum = {defined_only: true}];
  191. // Subset of
  192. // :ref:`keys<envoy_api_field_Cluster.LbSubsetConfig.LbSubsetSelector.keys>` used by
  193. // :ref:`KEYS_SUBSET<envoy_api_enum_value_Cluster.LbSubsetConfig.LbSubsetSelector.LbSubsetSelectorFallbackPolicy.KEYS_SUBSET>`
  194. // fallback policy.
  195. // It has to be a non empty list if KEYS_SUBSET fallback policy is selected.
  196. // For any other fallback policy the parameter is not used and should not be set.
  197. // Only values also present in
  198. // :ref:`keys<envoy_api_field_Cluster.LbSubsetConfig.LbSubsetSelector.keys>` are allowed, but
  199. // `fallback_keys_subset` cannot be equal to `keys`.
  200. repeated string fallback_keys_subset = 3;
  201. }
  202. // The behavior used when no endpoint subset matches the selected route's
  203. // metadata. The value defaults to
  204. // :ref:`NO_FALLBACK<envoy_api_enum_value_Cluster.LbSubsetConfig.LbSubsetFallbackPolicy.NO_FALLBACK>`.
  205. LbSubsetFallbackPolicy fallback_policy = 1 [(validate.rules).enum = {defined_only: true}];
  206. // Specifies the default subset of endpoints used during fallback if
  207. // fallback_policy is
  208. // :ref:`DEFAULT_SUBSET<envoy_api_enum_value_Cluster.LbSubsetConfig.LbSubsetFallbackPolicy.DEFAULT_SUBSET>`.
  209. // Each field in default_subset is
  210. // compared to the matching LbEndpoint.Metadata under the *envoy.lb*
  211. // namespace. It is valid for no hosts to match, in which case the behavior
  212. // is the same as a fallback_policy of
  213. // :ref:`NO_FALLBACK<envoy_api_enum_value_Cluster.LbSubsetConfig.LbSubsetFallbackPolicy.NO_FALLBACK>`.
  214. google.protobuf.Struct default_subset = 2;
  215. // For each entry, LbEndpoint.Metadata's
  216. // *envoy.lb* namespace is traversed and a subset is created for each unique
  217. // combination of key and value. For example:
  218. //
  219. // .. code-block:: json
  220. //
  221. // { "subset_selectors": [
  222. // { "keys": [ "version" ] },
  223. // { "keys": [ "stage", "hardware_type" ] }
  224. // ]}
  225. //
  226. // A subset is matched when the metadata from the selected route and
  227. // weighted cluster contains the same keys and values as the subset's
  228. // metadata. The same host may appear in multiple subsets.
  229. repeated LbSubsetSelector subset_selectors = 3;
  230. // If true, routing to subsets will take into account the localities and locality weights of the
  231. // endpoints when making the routing decision.
  232. //
  233. // There are some potential pitfalls associated with enabling this feature, as the resulting
  234. // traffic split after applying both a subset match and locality weights might be undesirable.
  235. //
  236. // Consider for example a situation in which you have 50/50 split across two localities X/Y
  237. // which have 100 hosts each without subsetting. If the subset LB results in X having only 1
  238. // host selected but Y having 100, then a lot more load is being dumped on the single host in X
  239. // than originally anticipated in the load balancing assignment delivered via EDS.
  240. bool locality_weight_aware = 4;
  241. // When used with locality_weight_aware, scales the weight of each locality by the ratio
  242. // of hosts in the subset vs hosts in the original subset. This aims to even out the load
  243. // going to an individual locality if said locality is disproportionately affected by the
  244. // subset predicate.
  245. bool scale_locality_weight = 5;
  246. // If true, when a fallback policy is configured and its corresponding subset fails to find
  247. // a host this will cause any host to be selected instead.
  248. //
  249. // This is useful when using the default subset as the fallback policy, given the default
  250. // subset might become empty. With this option enabled, if that happens the LB will attempt
  251. // to select a host from the entire cluster.
  252. bool panic_mode_any = 6;
  253. // If true, metadata specified for a metadata key will be matched against the corresponding
  254. // endpoint metadata if the endpoint metadata matches the value exactly OR it is a list value
  255. // and any of the elements in the list matches the criteria.
  256. bool list_as_any = 7;
  257. }
  258. // Specific configuration for the LeastRequest load balancing policy.
  259. message LeastRequestLbConfig {
  260. // The number of random healthy hosts from which the host with the fewest active requests will
  261. // be chosen. Defaults to 2 so that we perform two-choice selection if the field is not set.
  262. google.protobuf.UInt32Value choice_count = 1 [(validate.rules).uint32 = {gte: 2}];
  263. }
  264. // Specific configuration for the :ref:`RingHash<arch_overview_load_balancing_types_ring_hash>`
  265. // load balancing policy.
  266. message RingHashLbConfig {
  267. // The hash function used to hash hosts onto the ketama ring.
  268. enum HashFunction {
  269. // Use `xxHash <https://github.com/Cyan4973/xxHash>`_, this is the default hash function.
  270. XX_HASH = 0;
  271. // Use `MurmurHash2 <https://sites.google.com/site/murmurhash/>`_, this is compatible with
  272. // std:hash<string> in GNU libstdc++ 3.4.20 or above. This is typically the case when compiled
  273. // on Linux and not macOS.
  274. MURMUR_HASH_2 = 1;
  275. }
  276. reserved 2;
  277. // Minimum hash ring size. The larger the ring is (that is, the more hashes there are for each
  278. // provided host) the better the request distribution will reflect the desired weights. Defaults
  279. // to 1024 entries, and limited to 8M entries. See also
  280. // :ref:`maximum_ring_size<envoy_api_field_Cluster.RingHashLbConfig.maximum_ring_size>`.
  281. google.protobuf.UInt64Value minimum_ring_size = 1 [(validate.rules).uint64 = {lte: 8388608}];
  282. // The hash function used to hash hosts onto the ketama ring. The value defaults to
  283. // :ref:`XX_HASH<envoy_api_enum_value_Cluster.RingHashLbConfig.HashFunction.XX_HASH>`.
  284. HashFunction hash_function = 3 [(validate.rules).enum = {defined_only: true}];
  285. // Maximum hash ring size. Defaults to 8M entries, and limited to 8M entries, but can be lowered
  286. // to further constrain resource use. See also
  287. // :ref:`minimum_ring_size<envoy_api_field_Cluster.RingHashLbConfig.minimum_ring_size>`.
  288. google.protobuf.UInt64Value maximum_ring_size = 4 [(validate.rules).uint64 = {lte: 8388608}];
  289. }
  290. // Specific configuration for the
  291. // :ref:`Original Destination <arch_overview_load_balancing_types_original_destination>`
  292. // load balancing policy.
  293. message OriginalDstLbConfig {
  294. // When true, :ref:`x-envoy-original-dst-host
  295. // <config_http_conn_man_headers_x-envoy-original-dst-host>` can be used to override destination
  296. // address.
  297. //
  298. // .. attention::
  299. //
  300. // This header isn't sanitized by default, so enabling this feature allows HTTP clients to
  301. // route traffic to arbitrary hosts and/or ports, which may have serious security
  302. // consequences.
  303. //
  304. // .. note::
  305. //
  306. // If the header appears multiple times only the first value is used.
  307. bool use_http_header = 1;
  308. }
  309. // Common configuration for all load balancer implementations.
  310. // [#next-free-field: 8]
  311. message CommonLbConfig {
  312. // Configuration for :ref:`zone aware routing
  313. // <arch_overview_load_balancing_zone_aware_routing>`.
  314. message ZoneAwareLbConfig {
  315. // Configures percentage of requests that will be considered for zone aware routing
  316. // if zone aware routing is configured. If not specified, the default is 100%.
  317. // * :ref:`runtime values <config_cluster_manager_cluster_runtime_zone_routing>`.
  318. // * :ref:`Zone aware routing support <arch_overview_load_balancing_zone_aware_routing>`.
  319. type.Percent routing_enabled = 1;
  320. // Configures minimum upstream cluster size required for zone aware routing
  321. // If upstream cluster size is less than specified, zone aware routing is not performed
  322. // even if zone aware routing is configured. If not specified, the default is 6.
  323. // * :ref:`runtime values <config_cluster_manager_cluster_runtime_zone_routing>`.
  324. // * :ref:`Zone aware routing support <arch_overview_load_balancing_zone_aware_routing>`.
  325. google.protobuf.UInt64Value min_cluster_size = 2;
  326. // If set to true, Envoy will not consider any hosts when the cluster is in :ref:`panic
  327. // mode<arch_overview_load_balancing_panic_threshold>`. Instead, the cluster will fail all
  328. // requests as if all hosts are unhealthy. This can help avoid potentially overwhelming a
  329. // failing service.
  330. bool fail_traffic_on_panic = 3;
  331. }
  332. // Configuration for :ref:`locality weighted load balancing
  333. // <arch_overview_load_balancing_locality_weighted_lb>`
  334. message LocalityWeightedLbConfig {
  335. }
  336. // Common Configuration for all consistent hashing load balancers (MaglevLb, RingHashLb, etc.)
  337. message ConsistentHashingLbConfig {
  338. // If set to `true`, the cluster will use hostname instead of the resolved
  339. // 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.
  340. bool use_hostname_for_hashing = 1;
  341. }
  342. // Configures the :ref:`healthy panic threshold <arch_overview_load_balancing_panic_threshold>`.
  343. // If not specified, the default is 50%.
  344. // To disable panic mode, set to 0%.
  345. //
  346. // .. note::
  347. // The specified percent will be truncated to the nearest 1%.
  348. type.Percent healthy_panic_threshold = 1;
  349. oneof locality_config_specifier {
  350. ZoneAwareLbConfig zone_aware_lb_config = 2;
  351. LocalityWeightedLbConfig locality_weighted_lb_config = 3;
  352. }
  353. // If set, all health check/weight/metadata updates that happen within this duration will be
  354. // merged and delivered in one shot when the duration expires. The start of the duration is when
  355. // the first update happens. This is useful for big clusters, with potentially noisy deploys
  356. // that might trigger excessive CPU usage due to a constant stream of healthcheck state changes
  357. // or metadata updates. The first set of updates to be seen apply immediately (e.g.: a new
  358. // cluster). Please always keep in mind that the use of sandbox technologies may change this
  359. // behavior.
  360. //
  361. // If this is not set, we default to a merge window of 1000ms. To disable it, set the merge
  362. // window to 0.
  363. //
  364. // Note: merging does not apply to cluster membership changes (e.g.: adds/removes); this is
  365. // because merging those updates isn't currently safe. See
  366. // https://github.com/envoyproxy/envoy/pull/3941.
  367. google.protobuf.Duration update_merge_window = 4;
  368. // If set to true, Envoy will not consider new hosts when computing load balancing weights until
  369. // they have been health checked for the first time. This will have no effect unless
  370. // active health checking is also configured.
  371. //
  372. // Ignoring a host means that for any load balancing calculations that adjust weights based
  373. // on the ratio of eligible hosts and total hosts (priority spillover, locality weighting and
  374. // panic mode) Envoy will exclude these hosts in the denominator.
  375. //
  376. // For example, with hosts in two priorities P0 and P1, where P0 looks like
  377. // {healthy, unhealthy (new), unhealthy (new)}
  378. // and where P1 looks like
  379. // {healthy, healthy}
  380. // all traffic will still hit P0, as 1 / (3 - 2) = 1.
  381. //
  382. // Enabling this will allow scaling up the number of hosts for a given cluster without entering
  383. // panic mode or triggering priority spillover, assuming the hosts pass the first health check.
  384. //
  385. // If panic mode is triggered, new hosts are still eligible for traffic; they simply do not
  386. // contribute to the calculation when deciding whether panic mode is enabled or not.
  387. bool ignore_new_hosts_until_first_hc = 5;
  388. // If set to `true`, the cluster manager will drain all existing
  389. // connections to upstream hosts whenever hosts are added or removed from the cluster.
  390. bool close_connections_on_host_set_change = 6;
  391. // Common Configuration for all consistent hashing load balancers (MaglevLb, RingHashLb, etc.)
  392. ConsistentHashingLbConfig consistent_hashing_lb_config = 7;
  393. }
  394. message RefreshRate {
  395. // Specifies the base interval between refreshes. This parameter is required and must be greater
  396. // than zero and less than
  397. // :ref:`max_interval <envoy_api_field_Cluster.RefreshRate.max_interval>`.
  398. google.protobuf.Duration base_interval = 1 [(validate.rules).duration = {
  399. required: true
  400. gt {nanos: 1000000}
  401. }];
  402. // Specifies the maximum interval between refreshes. This parameter is optional, but must be
  403. // greater than or equal to the
  404. // :ref:`base_interval <envoy_api_field_Cluster.RefreshRate.base_interval>` if set. The default
  405. // is 10 times the :ref:`base_interval <envoy_api_field_Cluster.RefreshRate.base_interval>`.
  406. google.protobuf.Duration max_interval = 2 [(validate.rules).duration = {gt {nanos: 1000000}}];
  407. }
  408. reserved 12, 15;
  409. // Configuration to use different transport sockets for different endpoints.
  410. // The entry of *envoy.transport_socket_match* in the
  411. // :ref:`LbEndpoint.Metadata <envoy_api_field_endpoint.LbEndpoint.metadata>`
  412. // is used to match against the transport sockets as they appear in the list. The first
  413. // :ref:`match <envoy_api_msg_Cluster.TransportSocketMatch>` is used.
  414. // For example, with the following match
  415. //
  416. // .. code-block:: yaml
  417. //
  418. // transport_socket_matches:
  419. // - name: "enableMTLS"
  420. // match:
  421. // acceptMTLS: true
  422. // transport_socket:
  423. // name: envoy.transport_sockets.tls
  424. // config: { ... } # tls socket configuration
  425. // - name: "defaultToPlaintext"
  426. // match: {}
  427. // transport_socket:
  428. // name: envoy.transport_sockets.raw_buffer
  429. //
  430. // Connections to the endpoints whose metadata value under *envoy.transport_socket_match*
  431. // having "acceptMTLS"/"true" key/value pair use the "enableMTLS" socket configuration.
  432. //
  433. // If a :ref:`socket match <envoy_api_msg_Cluster.TransportSocketMatch>` with empty match
  434. // criteria is provided, that always match any endpoint. For example, the "defaultToPlaintext"
  435. // socket match in case above.
  436. //
  437. // If an endpoint metadata's value under *envoy.transport_socket_match* does not match any
  438. // *TransportSocketMatch*, socket configuration fallbacks to use the *tls_context* or
  439. // *transport_socket* specified in this cluster.
  440. //
  441. // This field allows gradual and flexible transport socket configuration changes.
  442. //
  443. // The metadata of endpoints in EDS can indicate transport socket capabilities. For example,
  444. // an endpoint's metadata can have two key value pairs as "acceptMTLS": "true",
  445. // "acceptPlaintext": "true". While some other endpoints, only accepting plaintext traffic
  446. // has "acceptPlaintext": "true" metadata information.
  447. //
  448. // Then the xDS server can configure the CDS to a client, Envoy A, to send mutual TLS
  449. // traffic for endpoints with "acceptMTLS": "true", by adding a corresponding
  450. // *TransportSocketMatch* in this field. Other client Envoys receive CDS without
  451. // *transport_socket_match* set, and still send plain text traffic to the same cluster.
  452. //
  453. // [#comment:TODO(incfly): add a detailed architecture doc on intended usage.]
  454. repeated TransportSocketMatch transport_socket_matches = 43;
  455. // Supplies the name of the cluster which must be unique across all clusters.
  456. // The cluster name is used when emitting
  457. // :ref:`statistics <config_cluster_manager_cluster_stats>` if :ref:`alt_stat_name
  458. // <envoy_api_field_Cluster.alt_stat_name>` is not provided.
  459. // Any ``:`` in the cluster name will be converted to ``_`` when emitting statistics.
  460. string name = 1 [(validate.rules).string = {min_bytes: 1}];
  461. // An optional alternative to the cluster name to be used while emitting stats.
  462. // Any ``:`` in the name will be converted to ``_`` when emitting statistics. This should not be
  463. // confused with :ref:`Router Filter Header
  464. // <config_http_filters_router_x-envoy-upstream-alt-stat-name>`.
  465. string alt_stat_name = 28;
  466. oneof cluster_discovery_type {
  467. // The :ref:`service discovery type <arch_overview_service_discovery_types>`
  468. // to use for resolving the cluster.
  469. DiscoveryType type = 2 [(validate.rules).enum = {defined_only: true}];
  470. // The custom cluster type.
  471. CustomClusterType cluster_type = 38;
  472. }
  473. // Configuration to use for EDS updates for the Cluster.
  474. EdsClusterConfig eds_cluster_config = 3;
  475. // The timeout for new network connections to hosts in the cluster.
  476. google.protobuf.Duration connect_timeout = 4 [(validate.rules).duration = {gt {}}];
  477. // Soft limit on size of the cluster’s connections read and write buffers. If
  478. // unspecified, an implementation defined default is applied (1MiB).
  479. google.protobuf.UInt32Value per_connection_buffer_limit_bytes = 5;
  480. // The :ref:`load balancer type <arch_overview_load_balancing_types>` to use
  481. // when picking a host in the cluster.
  482. LbPolicy lb_policy = 6 [(validate.rules).enum = {defined_only: true}];
  483. // If the service discovery type is
  484. // :ref:`STATIC<envoy_api_enum_value_Cluster.DiscoveryType.STATIC>`,
  485. // :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>`
  486. // or :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>`,
  487. // then hosts is required.
  488. //
  489. // .. attention::
  490. //
  491. // **This field is deprecated**. Set the
  492. // :ref:`load_assignment<envoy_api_field_Cluster.load_assignment>` field instead.
  493. //
  494. repeated core.Address hosts = 7 [deprecated = true];
  495. // Setting this is required for specifying members of
  496. // :ref:`STATIC<envoy_api_enum_value_Cluster.DiscoveryType.STATIC>`,
  497. // :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>`
  498. // or :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>` clusters.
  499. // This field supersedes the *hosts* field in the v2 API.
  500. //
  501. // .. attention::
  502. //
  503. // Setting this allows non-EDS cluster types to contain embedded EDS equivalent
  504. // :ref:`endpoint assignments<envoy_api_msg_ClusterLoadAssignment>`.
  505. //
  506. ClusterLoadAssignment load_assignment = 33;
  507. // Optional :ref:`active health checking <arch_overview_health_checking>`
  508. // configuration for the cluster. If no
  509. // configuration is specified no health checking will be done and all cluster
  510. // members will be considered healthy at all times.
  511. repeated core.HealthCheck health_checks = 8;
  512. // Optional maximum requests for a single upstream connection. This parameter
  513. // is respected by both the HTTP/1.1 and HTTP/2 connection pool
  514. // implementations. If not specified, there is no limit. Setting this
  515. // parameter to 1 will effectively disable keep alive.
  516. google.protobuf.UInt32Value max_requests_per_connection = 9;
  517. // Optional :ref:`circuit breaking <arch_overview_circuit_break>` for the cluster.
  518. cluster.CircuitBreakers circuit_breakers = 10;
  519. // The TLS configuration for connections to the upstream cluster.
  520. //
  521. // .. attention::
  522. //
  523. // **This field is deprecated**. Use `transport_socket` with name `tls` instead. If both are
  524. // set, `transport_socket` takes priority.
  525. auth.UpstreamTlsContext tls_context = 11
  526. [deprecated = true, (envoy.annotations.disallowed_by_default) = true];
  527. // HTTP protocol options that are applied only to upstream HTTP connections.
  528. // These options apply to all HTTP versions.
  529. core.UpstreamHttpProtocolOptions upstream_http_protocol_options = 46;
  530. // Additional options when handling HTTP requests upstream. These options will be applicable to
  531. // both HTTP1 and HTTP2 requests.
  532. core.HttpProtocolOptions common_http_protocol_options = 29;
  533. // Additional options when handling HTTP1 requests.
  534. core.Http1ProtocolOptions http_protocol_options = 13;
  535. // Even if default HTTP2 protocol options are desired, this field must be
  536. // set so that Envoy will assume that the upstream supports HTTP/2 when
  537. // making new HTTP connection pool connections. Currently, Envoy only
  538. // supports prior knowledge for upstream connections. Even if TLS is used
  539. // with ALPN, `http2_protocol_options` must be specified. As an aside this allows HTTP/2
  540. // connections to happen over plain text.
  541. core.Http2ProtocolOptions http2_protocol_options = 14;
  542. // The extension_protocol_options field is used to provide extension-specific protocol options
  543. // for upstream connections. The key should match the extension filter name, such as
  544. // "envoy.filters.network.thrift_proxy". See the extension's documentation for details on
  545. // specific options.
  546. map<string, google.protobuf.Struct> extension_protocol_options = 35
  547. [deprecated = true, (envoy.annotations.disallowed_by_default) = true];
  548. // The extension_protocol_options field is used to provide extension-specific protocol options
  549. // for upstream connections. The key should match the extension filter name, such as
  550. // "envoy.filters.network.thrift_proxy". See the extension's documentation for details on
  551. // specific options.
  552. map<string, google.protobuf.Any> typed_extension_protocol_options = 36;
  553. // If the DNS refresh rate is specified and the cluster type is either
  554. // :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>`,
  555. // or :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>`,
  556. // this value is used as the cluster’s DNS refresh
  557. // rate. The value configured must be at least 1ms. If this setting is not specified, the
  558. // value defaults to 5000ms. For cluster types other than
  559. // :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>`
  560. // and :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>`
  561. // this setting is ignored.
  562. google.protobuf.Duration dns_refresh_rate = 16
  563. [(validate.rules).duration = {gt {nanos: 1000000}}];
  564. // If the DNS failure refresh rate is specified and the cluster type is either
  565. // :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>`,
  566. // or :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>`,
  567. // this is used as the cluster’s DNS refresh rate when requests are failing. If this setting is
  568. // not specified, the failure refresh rate defaults to the DNS refresh rate. For cluster types
  569. // other than :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>` and
  570. // :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>` this setting is
  571. // ignored.
  572. RefreshRate dns_failure_refresh_rate = 44;
  573. // Optional configuration for setting cluster's DNS refresh rate. If the value is set to true,
  574. // cluster's DNS refresh rate will be set to resource record's TTL which comes from DNS
  575. // resolution.
  576. bool respect_dns_ttl = 39;
  577. // The DNS IP address resolution policy. If this setting is not specified, the
  578. // value defaults to
  579. // :ref:`AUTO<envoy_api_enum_value_Cluster.DnsLookupFamily.AUTO>`.
  580. DnsLookupFamily dns_lookup_family = 17 [(validate.rules).enum = {defined_only: true}];
  581. // If DNS resolvers are specified and the cluster type is either
  582. // :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>`,
  583. // or :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>`,
  584. // this value is used to specify the cluster’s dns resolvers.
  585. // If this setting is not specified, the value defaults to the default
  586. // resolver, which uses /etc/resolv.conf for configuration. For cluster types
  587. // other than
  588. // :ref:`STRICT_DNS<envoy_api_enum_value_Cluster.DiscoveryType.STRICT_DNS>`
  589. // and :ref:`LOGICAL_DNS<envoy_api_enum_value_Cluster.DiscoveryType.LOGICAL_DNS>`
  590. // this setting is ignored.
  591. // Setting this value causes failure if the
  592. // ``envoy.restart_features.use_apple_api_for_dns_lookups`` runtime value is true during
  593. // server startup. Apple's API only allows overriding DNS resolvers via system settings.
  594. repeated core.Address dns_resolvers = 18;
  595. // [#next-major-version: Reconcile DNS options in a single message.]
  596. // Always use TCP queries instead of UDP queries for DNS lookups.
  597. // Setting this value causes failure if the
  598. // ``envoy.restart_features.use_apple_api_for_dns_lookups`` runtime value is true during
  599. // server startup. Apple' API only uses UDP for DNS resolution.
  600. bool use_tcp_for_dns_lookups = 45;
  601. // If specified, outlier detection will be enabled for this upstream cluster.
  602. // Each of the configuration values can be overridden via
  603. // :ref:`runtime values <config_cluster_manager_cluster_runtime_outlier_detection>`.
  604. cluster.OutlierDetection outlier_detection = 19;
  605. // The interval for removing stale hosts from a cluster type
  606. // :ref:`ORIGINAL_DST<envoy_api_enum_value_Cluster.DiscoveryType.ORIGINAL_DST>`.
  607. // Hosts are considered stale if they have not been used
  608. // as upstream destinations during this interval. New hosts are added
  609. // to original destination clusters on demand as new connections are
  610. // redirected to Envoy, causing the number of hosts in the cluster to
  611. // grow over time. Hosts that are not stale (they are actively used as
  612. // destinations) are kept in the cluster, which allows connections to
  613. // them remain open, saving the latency that would otherwise be spent
  614. // on opening new connections. If this setting is not specified, the
  615. // value defaults to 5000ms. For cluster types other than
  616. // :ref:`ORIGINAL_DST<envoy_api_enum_value_Cluster.DiscoveryType.ORIGINAL_DST>`
  617. // this setting is ignored.
  618. google.protobuf.Duration cleanup_interval = 20 [(validate.rules).duration = {gt {}}];
  619. // Optional configuration used to bind newly established upstream connections.
  620. // This overrides any bind_config specified in the bootstrap proto.
  621. // If the address and port are empty, no bind will be performed.
  622. core.BindConfig upstream_bind_config = 21;
  623. // Configuration for load balancing subsetting.
  624. LbSubsetConfig lb_subset_config = 22;
  625. // Optional configuration for the load balancing algorithm selected by
  626. // LbPolicy. Currently only
  627. // :ref:`RING_HASH<envoy_api_enum_value_Cluster.LbPolicy.RING_HASH>` and
  628. // :ref:`LEAST_REQUEST<envoy_api_enum_value_Cluster.LbPolicy.LEAST_REQUEST>`
  629. // has additional configuration options.
  630. // Specifying ring_hash_lb_config or least_request_lb_config without setting the corresponding
  631. // LbPolicy will generate an error at runtime.
  632. oneof lb_config {
  633. // Optional configuration for the Ring Hash load balancing policy.
  634. RingHashLbConfig ring_hash_lb_config = 23;
  635. // Optional configuration for the Original Destination load balancing policy.
  636. OriginalDstLbConfig original_dst_lb_config = 34;
  637. // Optional configuration for the LeastRequest load balancing policy.
  638. LeastRequestLbConfig least_request_lb_config = 37;
  639. }
  640. // Common configuration for all load balancer implementations.
  641. CommonLbConfig common_lb_config = 27;
  642. // Optional custom transport socket implementation to use for upstream connections.
  643. // To setup TLS, set a transport socket with name `tls` and
  644. // :ref:`UpstreamTlsContexts <envoy_api_msg_auth.UpstreamTlsContext>` in the `typed_config`.
  645. // If no transport socket configuration is specified, new connections
  646. // will be set up with plaintext.
  647. core.TransportSocket transport_socket = 24;
  648. // The Metadata field can be used to provide additional information about the
  649. // cluster. It can be used for stats, logging, and varying filter behavior.
  650. // Fields should use reverse DNS notation to denote which entity within Envoy
  651. // will need the information. For instance, if the metadata is intended for
  652. // the Router filter, the filter name should be specified as *envoy.filters.http.router*.
  653. core.Metadata metadata = 25;
  654. // Determines how Envoy selects the protocol used to speak to upstream hosts.
  655. ClusterProtocolSelection protocol_selection = 26;
  656. // Optional options for upstream connections.
  657. UpstreamConnectionOptions upstream_connection_options = 30;
  658. // If an upstream host becomes unhealthy (as determined by the configured health checks
  659. // or outlier detection), immediately close all connections to the failed host.
  660. //
  661. // .. note::
  662. //
  663. // This is currently only supported for connections created by tcp_proxy.
  664. //
  665. // .. note::
  666. //
  667. // The current implementation of this feature closes all connections immediately when
  668. // the unhealthy status is detected. If there are a large number of connections open
  669. // to an upstream host that becomes unhealthy, Envoy may spend a substantial amount of
  670. // time exclusively closing these connections, and not processing any other traffic.
  671. bool close_connections_on_host_health_failure = 31;
  672. // If set to true, Envoy will ignore the health value of a host when processing its removal
  673. // from service discovery. This means that if active health checking is used, Envoy will *not*
  674. // wait for the endpoint to go unhealthy before removing it.
  675. bool drain_connections_on_host_removal = 32
  676. [(udpa.annotations.field_migrate).rename = "ignore_health_on_host_removal"];
  677. // An (optional) network filter chain, listed in the order the filters should be applied.
  678. // The chain will be applied to all outgoing connections that Envoy makes to the upstream
  679. // servers of this cluster.
  680. repeated cluster.Filter filters = 40;
  681. // [#not-implemented-hide:] New mechanism for LB policy configuration. Used only if the
  682. // :ref:`lb_policy<envoy_api_field_Cluster.lb_policy>` field has the value
  683. // :ref:`LOAD_BALANCING_POLICY_CONFIG<envoy_api_enum_value_Cluster.LbPolicy.LOAD_BALANCING_POLICY_CONFIG>`.
  684. LoadBalancingPolicy load_balancing_policy = 41;
  685. // [#not-implemented-hide:]
  686. // If present, tells the client where to send load reports via LRS. If not present, the
  687. // client will fall back to a client-side default, which may be either (a) don't send any
  688. // load reports or (b) send load reports for all clusters to a single default server
  689. // (which may be configured in the bootstrap file).
  690. //
  691. // Note that if multiple clusters point to the same LRS server, the client may choose to
  692. // create a separate stream for each cluster or it may choose to coalesce the data for
  693. // multiple clusters onto a single stream. Either way, the client must make sure to send
  694. // the data for any given cluster on no more than one stream.
  695. //
  696. // [#next-major-version: In the v3 API, we should consider restructuring this somehow,
  697. // maybe by allowing LRS to go on the ADS stream, or maybe by moving some of the negotiation
  698. // from the LRS stream here.]
  699. core.ConfigSource lrs_server = 42;
  700. // If track_timeout_budgets is true, the :ref:`timeout budget histograms
  701. // <config_cluster_manager_cluster_stats_timeout_budgets>` will be published for each
  702. // request. These show what percentage of a request's per try and global timeout was used. A value
  703. // of 0 would indicate that none of the timeout was used or that the timeout was infinite. A value
  704. // of 100 would indicate that the request took the entirety of the timeout given to it.
  705. bool track_timeout_budgets = 47;
  706. }
  707. // [#not-implemented-hide:] Extensible load balancing policy configuration.
  708. //
  709. // Every LB policy defined via this mechanism will be identified via a unique name using reverse
  710. // DNS notation. If the policy needs configuration parameters, it must define a message for its
  711. // own configuration, which will be stored in the config field. The name of the policy will tell
  712. // clients which type of message they should expect to see in the config field.
  713. //
  714. // Note that there are cases where it is useful to be able to independently select LB policies
  715. // for choosing a locality and for choosing an endpoint within that locality. For example, a
  716. // given deployment may always use the same policy to choose the locality, but for choosing the
  717. // endpoint within the locality, some clusters may use weighted-round-robin, while others may
  718. // use some sort of session-based balancing.
  719. //
  720. // This can be accomplished via hierarchical LB policies, where the parent LB policy creates a
  721. // child LB policy for each locality. For each request, the parent chooses the locality and then
  722. // delegates to the child policy for that locality to choose the endpoint within the locality.
  723. //
  724. // To facilitate this, the config message for the top-level LB policy may include a field of
  725. // type LoadBalancingPolicy that specifies the child policy.
  726. message LoadBalancingPolicy {
  727. message Policy {
  728. // Required. The name of the LB policy.
  729. string name = 1;
  730. // Optional config for the LB policy.
  731. // No more than one of these two fields may be populated.
  732. google.protobuf.Struct config = 2 [deprecated = true];
  733. google.protobuf.Any typed_config = 3;
  734. }
  735. // Each client will iterate over the list in order and stop at the first policy that it
  736. // supports. This provides a mechanism for starting to use new LB policies that are not yet
  737. // supported by all clients.
  738. repeated Policy policies = 1;
  739. }
  740. // An extensible structure containing the address Envoy should bind to when
  741. // establishing upstream connections.
  742. message UpstreamBindConfig {
  743. // The address Envoy should bind to when establishing upstream connections.
  744. core.Address source_address = 1;
  745. }
  746. message UpstreamConnectionOptions {
  747. // If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives.
  748. core.TcpKeepalive tcp_keepalive = 1;
  749. }