async-grpc-xds 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/async/grpc/xds/client_side_weighted_round_robin.rb +53 -0
  4. data/lib/async/grpc/xds/cluster.rb +71 -0
  5. data/lib/async/grpc/xds/control_plane.rb +10 -7
  6. data/lib/async/grpc/xds/discovery_client.rb +5 -2
  7. data/lib/async/grpc/xds/endpoint.rb +102 -0
  8. data/lib/async/grpc/xds/version.rb +1 -1
  9. data/lib/async/grpc/xds.rb +3 -1
  10. data/lib/envoy/config/common/mutation_rules/v3/mutation_rules_pb.rb +33 -0
  11. data/lib/envoy/config/route/v3/route_components_pb.rb +108 -0
  12. data/lib/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin_pb.rb +30 -0
  13. data/lib/envoy/extensions/load_balancing_policies/common/v3/common_pb.rb +41 -0
  14. data/lib/envoy/type/tracing/v3/custom_tag_pb.rb +31 -0
  15. data/lib/xds/data/orca/v3/orca_load_report_pb.rb +24 -0
  16. data/lib/xds/service/orca/v3/open_rca_service.rb +23 -0
  17. data/lib/xds/service/orca/v3/orca_pb.rb +25 -0
  18. data/proto/envoy/config/common/mutation_rules/v3/mutation_rules.proto +113 -0
  19. data/proto/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.proto +96 -0
  20. data/proto/envoy/extensions/load_balancing_policies/common/v3/common.proto +188 -0
  21. data/proto/envoy/type/tracing/v3/custom_tag.proto +109 -0
  22. data/proto/readme.md +3 -0
  23. data/proto/xds/data/orca/v3/orca_load_report.proto +58 -0
  24. data/proto/xds/service/orca/v3/orca.proto +36 -0
  25. data/readme.md +6 -0
  26. data/releases.md +6 -0
  27. data/xds/test/async/grpc/xds/control_plane.rb +0 -1
  28. data.tar.gz.sig +0 -0
  29. metadata +18 -2
  30. metadata.gz.sig +0 -0
  31. data/lib/async/grpc/xds/resource_builder.rb +0 -177
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
4
+ # source: envoy/extensions/load_balancing_policies/common/v3/common.proto
5
+
6
+ require "google/protobuf"
7
+
8
+ require "envoy/config/core/v3/base_pb"
9
+ require "envoy/config/route/v3/route_components_pb"
10
+ require "envoy/type/v3/percent_pb"
11
+ require "google/protobuf/duration_pb"
12
+ require "google/protobuf/struct_pb"
13
+ require "google/protobuf/wrappers_pb"
14
+ require "envoy/annotations/deprecation_pb"
15
+ require "udpa/annotations/status_pb"
16
+ require "validate/validate_pb"
17
+
18
+
19
+ descriptor_data = "\n?envoy/extensions/load_balancing_policies/common/v3/common.proto\x12\x32\x65nvoy.extensions.load_balancing_policies.common.v3\x1a\x1f\x65nvoy/config/core/v3/base.proto\x1a,envoy/config/route/v3/route_components.proto\x1a\x1b\x65nvoy/type/v3/percent.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a#envoy/annotations/deprecation.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xa4\x07\n\x10LocalityLbConfig\x12v\n\x14zone_aware_lb_config\x18\x01 \x01(\x0b\x32V.envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.ZoneAwareLbConfigH\x00\x12\x84\x01\n\x1blocality_weighted_lb_config\x18\x02 \x01(\x0b\x32].envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.LocalityWeightedLbConfigH\x00\x1a\xd2\x04\n\x11ZoneAwareLbConfig\x12/\n\x0frouting_enabled\x18\x01 \x01(\x0b\x32\x16.envoy.type.v3.Percent\x12\x36\n\x10min_cluster_size\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt64Value\x12\x1d\n\x15\x66\x61il_traffic_on_panic\x18\x03 \x01(\x08\x12\x32\n\x1d\x66orce_locality_direct_routing\x18\x04 \x01(\x08\x42\x0b\x18\x01\x92\xc7\x86\xd8\x04\x03\x33.0\x12\x7f\n\x10\x66orce_local_zone\x18\x05 \x01(\x0b\x32\x65.envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.ZoneAwareLbConfig.ForceLocalZone\x12|\n\x0elocality_basis\x18\x06 \x01(\x0e\x32\x64.envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.ZoneAwareLbConfig.LocalityBasis\x1a@\n\x0e\x46orceLocalZone\x12.\n\x08min_size\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\"@\n\rLocalityBasis\x12\x15\n\x11HEALTHY_HOSTS_NUM\x10\x00\x12\x18\n\x14HEALTHY_HOSTS_WEIGHT\x10\x01\x1a\x1a\n\x18LocalityWeightedLbConfigB \n\x19locality_config_specifier\x12\x03\xf8\x42\x01\"\xb4\x01\n\x0fSlowStartConfig\x12\x34\n\x11slow_start_window\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\naggression\x18\x02 \x01(\x0b\x32#.envoy.config.core.v3.RuntimeDouble\x12\x32\n\x12min_weight_percent\x18\x03 \x01(\x0b\x32\x16.envoy.type.v3.Percent\"\xc5\x01\n\x19\x43onsistentHashingLbConfig\x12 \n\x18use_hostname_for_hashing\x18\x01 \x01(\x08\x12\x42\n\x13hash_balance_factor\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x07\xfa\x42\x04*\x02(d\x12\x42\n\x0bhash_policy\x18\x03 \x03(\x0b\x32-.envoy.config.route.v3.RouteAction.HashPolicy\"\x99\x01\n\x16OrcaOobReportingConfig\x12\x1d\n\nport_value\x18\x01 \x01(\rB\t\xfa\x42\x06*\x04\x18\xff\xff\x03\x12\x1e\n\tauthority\x18\x02 \x01(\tB\x0b\xfa\x42\x08r\x06\xc0\x01\x02\xc8\x01\x00\x12@\n\x1ftransport_socket_match_criteria\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\xbd\x01\n@io.envoyproxy.envoy.extensions.load_balancing_policies.common.v3B\x0b\x43ommonProtoP\x01Zbgithub.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/common/v3;commonv3\xba\x80\xc8\xd1\x06\x02\x10\x02\x62\x06proto3"
20
+
21
+ pool = ::Google::Protobuf::DescriptorPool.generated_pool
22
+ pool.add_serialized_file(descriptor_data)
23
+
24
+ module Envoy
25
+ module Extensions
26
+ module LoadBalancingPolicies
27
+ module Common
28
+ module V3
29
+ LocalityLbConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig").msgclass
30
+ LocalityLbConfig::ZoneAwareLbConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.ZoneAwareLbConfig").msgclass
31
+ LocalityLbConfig::ZoneAwareLbConfig::ForceLocalZone = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.ZoneAwareLbConfig.ForceLocalZone").msgclass
32
+ LocalityLbConfig::ZoneAwareLbConfig::LocalityBasis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.ZoneAwareLbConfig.LocalityBasis").enummodule
33
+ LocalityLbConfig::LocalityWeightedLbConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.extensions.load_balancing_policies.common.v3.LocalityLbConfig.LocalityWeightedLbConfig").msgclass
34
+ SlowStartConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.extensions.load_balancing_policies.common.v3.SlowStartConfig").msgclass
35
+ ConsistentHashingLbConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.extensions.load_balancing_policies.common.v3.ConsistentHashingLbConfig").msgclass
36
+ OrcaOobReportingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.extensions.load_balancing_policies.common.v3.OrcaOobReportingConfig").msgclass
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
4
+ # source: envoy/type/tracing/v3/custom_tag.proto
5
+
6
+ require "google/protobuf"
7
+
8
+ require "envoy/type/metadata/v3/metadata_pb"
9
+ require "udpa/annotations/status_pb"
10
+ require "udpa/annotations/versioning_pb"
11
+ require "validate/validate_pb"
12
+
13
+
14
+ descriptor_data = "\n&envoy/type/tracing/v3/custom_tag.proto\x12\x15\x65nvoy.type.tracing.v3\x1a%envoy/type/metadata/v3/metadata.proto\x1a\x1dudpa/annotations/status.proto\x1a!udpa/annotations/versioning.proto\x1a\x17validate/validate.proto\"\xe0\x06\n\tCustomTag\x12\x14\n\x03tag\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01\x12;\n\x07literal\x18\x02 \x01(\x0b\x32(.envoy.type.tracing.v3.CustomTag.LiteralH\x00\x12\x43\n\x0b\x65nvironment\x18\x03 \x01(\x0b\x32,.envoy.type.tracing.v3.CustomTag.EnvironmentH\x00\x12\x41\n\x0erequest_header\x18\x04 \x01(\x0b\x32\'.envoy.type.tracing.v3.CustomTag.HeaderH\x00\x12=\n\x08metadata\x18\x05 \x01(\x0b\x32).envoy.type.tracing.v3.CustomTag.MetadataH\x00\x12\x0f\n\x05value\x18\x06 \x01(\tH\x00\x1aQ\n\x07Literal\x12\x16\n\x05value\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01:.\x9a\xc5\x88\x1e)\n\'envoy.type.tracing.v2.CustomTag.Literal\x1ao\n\x0b\x45nvironment\x12\x15\n\x04name\x18\x01 \x01(\tB\x07\xfa\x42\x04r\x02\x10\x01\x12\x15\n\rdefault_value\x18\x02 \x01(\t:2\x9a\xc5\x88\x1e-\n+envoy.type.tracing.v2.CustomTag.Environment\x1ak\n\x06Header\x12\x1b\n\x04name\x18\x01 \x01(\tB\r\xfa\x42\nr\x08\x10\x01\xc0\x01\x01\xc8\x01\x00\x12\x15\n\rdefault_value\x18\x02 \x01(\t:-\x9a\xc5\x88\x1e(\n&envoy.type.tracing.v2.CustomTag.Header\x1a\xc1\x01\n\x08Metadata\x12\x32\n\x04kind\x18\x01 \x01(\x0b\x32$.envoy.type.metadata.v3.MetadataKind\x12\x39\n\x0cmetadata_key\x18\x02 \x01(\x0b\x32#.envoy.type.metadata.v3.MetadataKey\x12\x15\n\rdefault_value\x18\x03 \x01(\t:/\x9a\xc5\x88\x1e*\n(envoy.type.tracing.v2.CustomTag.Metadata:&\x9a\xc5\x88\x1e!\n\x1f\x65nvoy.type.tracing.v2.CustomTagB\x0b\n\x04type\x12\x03\xf8\x42\x01\x42\x87\x01\n#io.envoyproxy.envoy.type.tracing.v3B\x0e\x43ustomTagProtoP\x01ZFgithub.com/envoyproxy/go-control-plane/envoy/type/tracing/v3;tracingv3\xba\x80\xc8\xd1\x06\x02\x10\x02\x62\x06proto3"
15
+
16
+ pool = ::Google::Protobuf::DescriptorPool.generated_pool
17
+ pool.add_serialized_file(descriptor_data)
18
+
19
+ module Envoy
20
+ module Type
21
+ module Tracing
22
+ module V3
23
+ CustomTag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.type.tracing.v3.CustomTag").msgclass
24
+ CustomTag::Literal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.type.tracing.v3.CustomTag.Literal").msgclass
25
+ CustomTag::Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.type.tracing.v3.CustomTag.Environment").msgclass
26
+ CustomTag::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.type.tracing.v3.CustomTag.Header").msgclass
27
+ CustomTag::Metadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.type.tracing.v3.CustomTag.Metadata").msgclass
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
4
+ # source: xds/data/orca/v3/orca_load_report.proto
5
+
6
+ require "google/protobuf"
7
+
8
+ require "validate/validate_pb"
9
+
10
+
11
+ descriptor_data = "\n\'xds/data/orca/v3/orca_load_report.proto\x12\x10xds.data.orca.v3\x1a\x17validate/validate.proto\"\x89\x05\n\x0eOrcaLoadReport\x12\'\n\x0f\x63pu_utilization\x18\x01 \x01(\x01\x42\x0e\xfa\x42\x0b\x12\t)\x00\x00\x00\x00\x00\x00\x00\x00\x12\x30\n\x0fmem_utilization\x18\x02 \x01(\x01\x42\x17\xfa\x42\x14\x12\x12\x19\x00\x00\x00\x00\x00\x00\xf0?)\x00\x00\x00\x00\x00\x00\x00\x00\x12\x0f\n\x03rps\x18\x03 \x01(\x04\x42\x02\x18\x01\x12G\n\x0crequest_cost\x18\x04 \x03(\x0b\x32\x31.xds.data.orca.v3.OrcaLoadReport.RequestCostEntry\x12\x64\n\x0butilization\x18\x05 \x03(\x0b\x32\x31.xds.data.orca.v3.OrcaLoadReport.UtilizationEntryB\x1c\xfa\x42\x19\x9a\x01\x16*\x14\x12\x12\x19\x00\x00\x00\x00\x00\x00\xf0?)\x00\x00\x00\x00\x00\x00\x00\x00\x12&\n\x0erps_fractional\x18\x06 \x01(\x01\x42\x0e\xfa\x42\x0b\x12\t)\x00\x00\x00\x00\x00\x00\x00\x00\x12\x1b\n\x03\x65ps\x18\x07 \x01(\x01\x42\x0e\xfa\x42\x0b\x12\t)\x00\x00\x00\x00\x00\x00\x00\x00\x12I\n\rnamed_metrics\x18\x08 \x03(\x0b\x32\x32.xds.data.orca.v3.OrcaLoadReport.NamedMetricsEntry\x12/\n\x17\x61pplication_utilization\x18\t \x01(\x01\x42\x0e\xfa\x42\x0b\x12\t)\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x32\n\x10RequestCostEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x32\n\x10UtilizationEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\x33\n\x11NamedMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x42]\n\x1b\x63om.github.xds.data.orca.v3B\x13OrcaLoadReportProtoP\x01Z\'github.com/cncf/xds/go/xds/data/orca/v3b\x06proto3"
12
+
13
+ pool = ::Google::Protobuf::DescriptorPool.generated_pool
14
+ pool.add_serialized_file(descriptor_data)
15
+
16
+ module Xds
17
+ module Data
18
+ module Orca
19
+ module V3
20
+ OrcaLoadReport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("xds.data.orca.v3.OrcaLoadReport").msgclass
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2026, by Samuel Williams.
5
+
6
+ require "protocol/grpc/interface"
7
+ require "xds/service/orca/v3/orca_pb"
8
+
9
+ module Xds
10
+ module Service
11
+ module Orca
12
+ module V3
13
+ # Interface definition for the out-of-band ORCA load reporting service.
14
+ class OpenRcaService < Protocol::GRPC::Interface
15
+ rpc :StreamCoreMetrics,
16
+ request_class: OrcaLoadReportRequest,
17
+ response_class: Xds::Data::Orca::V3::OrcaLoadReport,
18
+ streaming: :server_streaming
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
4
+ # source: xds/service/orca/v3/orca.proto
5
+
6
+ require "google/protobuf"
7
+
8
+ require "xds/data/orca/v3/orca_load_report_pb"
9
+ require "google/protobuf/duration_pb"
10
+
11
+
12
+ descriptor_data = "\n\x1exds/service/orca/v3/orca.proto\x12\x13xds.service.orca.v3\x1a\'xds/data/orca/v3/orca_load_report.proto\x1a\x1egoogle/protobuf/duration.proto\"g\n\x15OrcaLoadReportRequest\x12\x32\n\x0freport_interval\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\x12request_cost_names\x18\x02 \x03(\t2u\n\x0eOpenRcaService\x12\x63\n\x11StreamCoreMetrics\x12*.xds.service.orca.v3.OrcaLoadReportRequest\x1a .xds.data.orca.v3.OrcaLoadReport0\x01\x42Y\n\x1e\x63om.github.xds.service.orca.v3B\tOrcaProtoP\x01Z*github.com/cncf/xds/go/xds/service/orca/v3b\x06proto3"
13
+
14
+ pool = ::Google::Protobuf::DescriptorPool.generated_pool
15
+ pool.add_serialized_file(descriptor_data)
16
+
17
+ module Xds
18
+ module Service
19
+ module Orca
20
+ module V3
21
+ OrcaLoadReportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("xds.service.orca.v3.OrcaLoadReportRequest").msgclass
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,113 @@
1
+ syntax = "proto3";
2
+
3
+ package envoy.config.common.mutation_rules.v3;
4
+
5
+ import "envoy/config/core/v3/base.proto";
6
+ import "envoy/type/matcher/v3/regex.proto";
7
+ import "envoy/type/matcher/v3/string.proto";
8
+
9
+ import "google/protobuf/wrappers.proto";
10
+
11
+ import "udpa/annotations/status.proto";
12
+ import "validate/validate.proto";
13
+
14
+ option java_package = "io.envoyproxy.envoy.config.common.mutation_rules.v3";
15
+ option java_outer_classname = "MutationRulesProto";
16
+ option java_multiple_files = true;
17
+ option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/common/mutation_rules/v3;mutation_rulesv3";
18
+ option (udpa.annotations.file_status).package_version_status = ACTIVE;
19
+
20
+ // [#protodoc-title: Header mutation rules]
21
+
22
+ // The HeaderMutationRules structure specifies what headers may be
23
+ // manipulated by a processing filter. This set of rules makes it
24
+ // possible to control which modifications a filter may make.
25
+ //
26
+ // By default, an external processing server may add, modify, or remove
27
+ // any header except for an "Envoy internal" header (which is typically
28
+ // denoted by an x-envoy prefix) or specific headers that may affect
29
+ // further filter processing:
30
+ //
31
+ // * ``host``
32
+ // * ``:authority``
33
+ // * ``:scheme``
34
+ // * ``:method``
35
+ //
36
+ // Every attempt to add, change, append, or remove a header will be
37
+ // tested against the rules here. Disallowed header mutations will be
38
+ // ignored unless ``disallow_is_error`` is set to true.
39
+ //
40
+ // Attempts to remove headers are further constrained -- regardless of the
41
+ // settings, system-defined headers (that start with ``:``) and the ``host``
42
+ // header may never be removed.
43
+ //
44
+ // In addition, a counter will be incremented whenever a mutation is
45
+ // rejected. In the ext_proc filter, that counter is named
46
+ // ``rejected_header_mutations``.
47
+ // [#next-free-field: 8]
48
+ message HeaderMutationRules {
49
+ // By default, certain headers that could affect processing of subsequent
50
+ // filters or request routing cannot be modified. These headers are
51
+ // ``host``, ``:authority``, ``:scheme``, and ``:method``. Setting this parameter
52
+ // to true allows these headers to be modified as well.
53
+ google.protobuf.BoolValue allow_all_routing = 1;
54
+
55
+ // If true, allow modification of envoy internal headers. By default, these
56
+ // start with ``x-envoy`` but this may be overridden in the ``Bootstrap``
57
+ // configuration using the
58
+ // :ref:`header_prefix <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.header_prefix>`
59
+ // field. Default is false.
60
+ google.protobuf.BoolValue allow_envoy = 2;
61
+
62
+ // If true, prevent modification of any system header, defined as a header
63
+ // that starts with a ``:`` character, regardless of any other settings.
64
+ // A processing server may still override the ``:status`` of an HTTP response
65
+ // using an ``ImmediateResponse`` message. Default is false.
66
+ google.protobuf.BoolValue disallow_system = 3;
67
+
68
+ // If true, prevent modifications of all header values, regardless of any
69
+ // other settings. A processing server may still override the ``:status``
70
+ // of an HTTP response using an ``ImmediateResponse`` message. Default is false.
71
+ google.protobuf.BoolValue disallow_all = 4;
72
+
73
+ // If set, specifically allow any header that matches this regular
74
+ // expression. This overrides all other settings except for
75
+ // ``disallow_expression``.
76
+ type.matcher.v3.RegexMatcher allow_expression = 5;
77
+
78
+ // If set, specifically disallow any header that matches this regular
79
+ // expression regardless of any other settings.
80
+ type.matcher.v3.RegexMatcher disallow_expression = 6;
81
+
82
+ // If true, and if the rules in this list cause a header mutation to be
83
+ // disallowed, then the filter using this configuration will terminate the
84
+ // request with a 500 error. In addition, regardless of the setting of this
85
+ // parameter, any attempt to set, add, or modify a disallowed header will
86
+ // cause the ``rejected_header_mutations`` counter to be incremented.
87
+ // Default is false.
88
+ google.protobuf.BoolValue disallow_is_error = 7;
89
+ }
90
+
91
+ // The HeaderMutation structure specifies an action that may be taken on HTTP
92
+ // headers.
93
+ message HeaderMutation {
94
+ message RemoveOnMatch {
95
+ // A string matcher that will be applied to the header key. If the header key
96
+ // matches, the header will be removed.
97
+ type.matcher.v3.StringMatcher key_matcher = 1 [(validate.rules).message = {required: true}];
98
+ }
99
+
100
+ oneof action {
101
+ option (validate.required) = true;
102
+
103
+ // Remove the specified header if it exists.
104
+ string remove = 1
105
+ [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
106
+
107
+ // Append new header by the specified HeaderValueOption.
108
+ core.v3.HeaderValueOption append = 2;
109
+
110
+ // Remove the header if the key matches the specified string matcher.
111
+ RemoveOnMatch remove_on_match = 3;
112
+ }
113
+ }
@@ -0,0 +1,96 @@
1
+ syntax = "proto3";
2
+
3
+ package envoy.extensions.load_balancing_policies.client_side_weighted_round_robin.v3;
4
+
5
+ import "envoy/extensions/load_balancing_policies/common/v3/common.proto";
6
+
7
+ import "google/protobuf/duration.proto";
8
+ import "google/protobuf/wrappers.proto";
9
+
10
+ import "udpa/annotations/status.proto";
11
+ import "validate/validate.proto";
12
+
13
+ option java_package = "io.envoyproxy.envoy.extensions.load_balancing_policies.client_side_weighted_round_robin.v3";
14
+ option java_outer_classname = "ClientSideWeightedRoundRobinProto";
15
+ option java_multiple_files = true;
16
+ option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3;client_side_weighted_round_robinv3";
17
+ option (udpa.annotations.file_status).package_version_status = ACTIVE;
18
+
19
+ // [#protodoc-title: Client-Side Weighted Round Robin Load Balancing Policy]
20
+ // [#extension: envoy.load_balancing_policies.client_side_weighted_round_robin]
21
+
22
+ // Configuration for the client_side_weighted_round_robin LB policy.
23
+ //
24
+ // This policy differs from the built-in ROUND_ROBIN policy in terms of
25
+ // how the endpoint weights are determined. In the ROUND_ROBIN policy,
26
+ // the endpoint weights are sent by the control plane via EDS. However,
27
+ // in this policy, the endpoint weights are instead determined via qps (queries
28
+ // per second), eps (errors per second), and utilization metrics sent by the
29
+ // endpoint using the Open Request Cost Aggregation (ORCA) protocol. Utilization
30
+ // is determined by using the ORCA application_utilization field, if set, or
31
+ // else falling back to the cpu_utilization field. All queries count toward qps,
32
+ // regardless of result. Only failed queries count toward eps. A config
33
+ // parameter error_utilization_penalty controls the penalty to adjust endpoint
34
+ // weights using eps and qps. The weight of a given endpoint is computed as:
35
+ // ``qps / (utilization + eps/qps * error_utilization_penalty)``.
36
+ //
37
+ // Note that Envoy will forward the ORCA response headers/trailers from the upstream
38
+ // cluster to the downstream client. This means that if the downstream client is also
39
+ // configured to use ``client_side_weighted_round_robin`` it will load balance against
40
+ // Envoy based on upstream weights. This can happen when Envoy is used as a reverse proxy.
41
+ // To avoid this issue you can configure the :ref:`header_mutation filter <envoy_v3_api_msg_extensions.filters.http.header_mutation.v3.HeaderMutation>` to remove
42
+ // the ORCA payload from the response headers/trailers.
43
+ //
44
+ // See the :ref:`load balancing architecture
45
+ // overview<arch_overview_load_balancing_types>` for more information.
46
+ //
47
+ // [#next-free-field: 10]
48
+ message ClientSideWeightedRoundRobin {
49
+ // Whether to enable out-of-band utilization reporting collection from
50
+ // the endpoints. By default, per-request utilization reporting is used.
51
+ google.protobuf.BoolValue enable_oob_load_report = 1;
52
+
53
+ // Load reporting interval to request from the server. Note that the
54
+ // server may not provide reports as frequently as the client requests.
55
+ // Used only when enable_oob_load_report is true. Default is 10 seconds.
56
+ google.protobuf.Duration oob_reporting_period = 2;
57
+
58
+ // A given endpoint must report load metrics continuously for at least
59
+ // this long before the endpoint weight will be used. This avoids
60
+ // churn when the set of endpoint addresses changes. Takes effect
61
+ // both immediately after we establish a connection to an endpoint and
62
+ // after weight_expiration_period has caused us to stop using the most
63
+ // recent load metrics. Default is 10 seconds.
64
+ google.protobuf.Duration blackout_period = 3;
65
+
66
+ // If a given endpoint has not reported load metrics in this long,
67
+ // then we stop using the reported weight. This ensures that we do
68
+ // not continue to use very stale weights. Once we stop using a stale
69
+ // value, if we later start seeing fresh reports again, the
70
+ // blackout_period applies. Defaults to 3 minutes.
71
+ google.protobuf.Duration weight_expiration_period = 4;
72
+
73
+ // How often endpoint weights are recalculated. Values less than 100ms are
74
+ // capped at 100ms. Default is 1 second.
75
+ google.protobuf.Duration weight_update_period = 5;
76
+
77
+ // The multiplier used to adjust endpoint weights with the error rate
78
+ // calculated as eps/qps. Configuration is rejected if this value is negative.
79
+ // Default is 1.0.
80
+ google.protobuf.FloatValue error_utilization_penalty = 6 [(validate.rules).float = {gte: 0.0}];
81
+
82
+ // By default, endpoint weight is computed based on the :ref:`application_utilization <envoy_v3_api_field_.xds.data.orca.v3.OrcaLoadReport.application_utilization>` field reported by the endpoint.
83
+ // If that field is not set, then utilization will instead be computed by taking the max of the values of the metrics specified here.
84
+ // For map fields in the ORCA proto, the string will be of the form ``<map_field_name>.<map_key>``. For example, the string ``named_metrics.foo`` will mean to look for the key ``foo`` in the ORCA :ref:`named_metrics <envoy_v3_api_field_.xds.data.orca.v3.OrcaLoadReport.named_metrics>` field.
85
+ // If none of the specified metrics are present in the load report, then :ref:`cpu_utilization <envoy_v3_api_field_.xds.data.orca.v3.OrcaLoadReport.cpu_utilization>` is used instead.
86
+ repeated string metric_names_for_computing_utilization = 7;
87
+
88
+ // Configuration for slow start mode.
89
+ // If this configuration is not set, slow start will not be not enabled.
90
+ common.v3.SlowStartConfig slow_start_config = 8;
91
+
92
+ // Optional overrides for the OOB reporting connection (alternative port,
93
+ // ``:authority``, transport socket selection). Honored only when
94
+ // ``enable_oob_load_report`` is true.
95
+ common.v3.OrcaOobReportingConfig oob_reporting_config = 9;
96
+ }
@@ -0,0 +1,188 @@
1
+ syntax = "proto3";
2
+
3
+ package envoy.extensions.load_balancing_policies.common.v3;
4
+
5
+ import "envoy/config/core/v3/base.proto";
6
+ import "envoy/config/route/v3/route_components.proto";
7
+ import "envoy/type/v3/percent.proto";
8
+
9
+ import "google/protobuf/duration.proto";
10
+ import "google/protobuf/struct.proto";
11
+ import "google/protobuf/wrappers.proto";
12
+
13
+ import "envoy/annotations/deprecation.proto";
14
+ import "udpa/annotations/status.proto";
15
+ import "validate/validate.proto";
16
+
17
+ option java_package = "io.envoyproxy.envoy.extensions.load_balancing_policies.common.v3";
18
+ option java_outer_classname = "CommonProto";
19
+ option java_multiple_files = true;
20
+ option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/common/v3;commonv3";
21
+ option (udpa.annotations.file_status).package_version_status = ACTIVE;
22
+
23
+ // [#protodoc-title: Common configuration for two or more load balancing policy extensions]
24
+
25
+ message LocalityLbConfig {
26
+ // Configuration for :ref:`zone aware routing
27
+ // <arch_overview_load_balancing_zone_aware_routing>`.
28
+ // [#next-free-field: 7]
29
+ message ZoneAwareLbConfig {
30
+ // Basis for computing per-locality percentages in zone-aware routing.
31
+ enum LocalityBasis {
32
+ // Use the number of healthy hosts in each locality.
33
+ HEALTHY_HOSTS_NUM = 0;
34
+
35
+ // Use the weights of healthy hosts in each locality.
36
+ HEALTHY_HOSTS_WEIGHT = 1;
37
+ }
38
+
39
+ // Configures Envoy to always route requests to the local zone regardless of the
40
+ // upstream zone structure. In Envoy's default configuration, traffic is distributed proportionally
41
+ // across all upstream hosts while trying to maximize local routing when possible. The approach
42
+ // with force_local_zone aims to be more predictable and if there are upstream hosts in the local
43
+ // zone, they will receive all traffic.
44
+ // * :ref:`runtime values <config_cluster_manager_cluster_runtime_zone_routing>`.
45
+ // * :ref:`Zone aware routing support <arch_overview_load_balancing_zone_aware_routing>`.
46
+ message ForceLocalZone {
47
+ // Configures the minimum number of upstream hosts in the local zone required when force_local_zone
48
+ // is enabled. If the number of upstream hosts in the local zone is less than the specified value,
49
+ // Envoy will fall back to the default proportional-based distribution across localities.
50
+ // If not specified, the default is 1.
51
+ // * :ref:`runtime values <config_cluster_manager_cluster_runtime_zone_routing>`.
52
+ // * :ref:`Zone aware routing support <arch_overview_load_balancing_zone_aware_routing>`.
53
+ google.protobuf.UInt32Value min_size = 1;
54
+ }
55
+
56
+ // Configures percentage of requests that will be considered for zone aware routing
57
+ // if zone aware routing is configured. If not specified, the default is 100%.
58
+ // * :ref:`runtime values <config_cluster_manager_cluster_runtime_zone_routing>`.
59
+ // * :ref:`Zone aware routing support <arch_overview_load_balancing_zone_aware_routing>`.
60
+ type.v3.Percent routing_enabled = 1;
61
+
62
+ // Configures minimum upstream cluster size required for zone aware routing
63
+ // If upstream cluster size is less than specified, zone aware routing is not performed
64
+ // even if zone aware routing is configured. If not specified, the default is 6.
65
+ // * :ref:`runtime values <config_cluster_manager_cluster_runtime_zone_routing>`.
66
+ // * :ref:`Zone aware routing support <arch_overview_load_balancing_zone_aware_routing>`.
67
+ google.protobuf.UInt64Value min_cluster_size = 2;
68
+
69
+ // If set to true, Envoy will not consider any hosts when the cluster is in :ref:`panic
70
+ // mode<arch_overview_load_balancing_panic_threshold>`. Instead, the cluster will fail all
71
+ // requests as if all hosts are unhealthy. This can help avoid potentially overwhelming a
72
+ // failing service.
73
+ bool fail_traffic_on_panic = 3;
74
+
75
+ // If set to true, Envoy will force LocalityDirect routing if a local locality exists.
76
+ bool force_locality_direct_routing = 4
77
+ [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
78
+
79
+ ForceLocalZone force_local_zone = 5;
80
+
81
+ // Determines how locality percentages are computed:
82
+ // - HEALTHY_HOSTS_NUM: proportional to the count of healthy hosts.
83
+ // - HEALTHY_HOSTS_WEIGHT: proportional to the weights of healthy hosts.
84
+ // Default value is HEALTHY_HOSTS_NUM if unset.
85
+ LocalityBasis locality_basis = 6;
86
+ }
87
+
88
+ // Configuration for :ref:`locality weighted load balancing
89
+ // <arch_overview_load_balancing_locality_weighted_lb>`
90
+ message LocalityWeightedLbConfig {
91
+ }
92
+
93
+ oneof locality_config_specifier {
94
+ option (validate.required) = true;
95
+
96
+ // Configuration for local zone aware load balancing.
97
+ ZoneAwareLbConfig zone_aware_lb_config = 1;
98
+
99
+ // Enable locality weighted load balancing.
100
+ LocalityWeightedLbConfig locality_weighted_lb_config = 2;
101
+ }
102
+ }
103
+
104
+ // Configuration for :ref:`slow start mode <arch_overview_load_balancing_slow_start>`.
105
+ message SlowStartConfig {
106
+ // Represents the size of slow start window.
107
+ // If set, the newly created host remains in slow start mode starting from its creation time
108
+ // for the duration of slow start window.
109
+ google.protobuf.Duration slow_start_window = 1;
110
+
111
+ // This parameter controls the speed of traffic increase over the slow start window. Defaults to 1.0,
112
+ // so that endpoint would get linearly increasing amount of traffic.
113
+ // When increasing the value for this parameter, the speed of traffic ramp-up increases non-linearly.
114
+ // The value of aggression parameter should be greater than 0.0.
115
+ // By tuning the parameter, is possible to achieve polynomial or exponential shape of ramp-up curve.
116
+ //
117
+ // During slow start window, effective weight of an endpoint would be scaled with time factor and aggression:
118
+ // ``new_weight = weight * max(min_weight_percent, time_factor ^ (1 / aggression))``,
119
+ // where ``time_factor=(time_since_start_seconds / slow_start_time_seconds)``.
120
+ //
121
+ // As time progresses, more and more traffic would be sent to endpoint, which is in slow start window.
122
+ // Once host exits slow start, time_factor and aggression no longer affect its weight.
123
+ config.core.v3.RuntimeDouble aggression = 2;
124
+
125
+ // Configures the minimum percentage of origin weight that avoids too small new weight,
126
+ // which may cause endpoints in slow start mode receive no traffic in slow start window.
127
+ // If not specified, the default is 10%.
128
+ type.v3.Percent min_weight_percent = 3;
129
+ }
130
+
131
+ // Common Configuration for all consistent hashing load balancers (MaglevLb, RingHashLb, etc.)
132
+ message ConsistentHashingLbConfig {
133
+ // If set to ``true``, the cluster will use hostname instead of the resolved
134
+ // 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.
135
+ bool use_hostname_for_hashing = 1;
136
+
137
+ // Configures percentage of average cluster load to bound per upstream host. For example, with a value of 150
138
+ // no upstream host will get a load more than 1.5 times the average load of all the hosts in the cluster.
139
+ // If not specified, the load is not bounded for any upstream host. Typical value for this parameter is between 120 and 200.
140
+ // Minimum is 100.
141
+ //
142
+ // Applies to both Ring Hash and Maglev load balancers.
143
+ //
144
+ // This is implemented based on the method described in the paper https://arxiv.org/abs/1608.01350. For the specified
145
+ // ``hash_balance_factor``, requests to any upstream host are capped at ``hash_balance_factor/100`` times the average number of requests
146
+ // across the cluster. When a request arrives for an upstream host that is currently serving at its max capacity, linear probing
147
+ // is used to identify an eligible host. Further, the linear probe is implemented using a random jump in hosts ring/table to identify
148
+ // the eligible host (this technique is as described in the paper https://arxiv.org/abs/1908.08762 - the random jump avoids the
149
+ // cascading overflow effect when choosing the next host in the ring/table).
150
+ //
151
+ // If weights are specified on the hosts, they are respected.
152
+ //
153
+ // This is an O(N) algorithm, unlike other load balancers. Using a lower ``hash_balance_factor`` results in more hosts
154
+ // being probed, so use a higher value if you require better performance.
155
+ google.protobuf.UInt32Value hash_balance_factor = 2 [(validate.rules).uint32 = {gte: 100}];
156
+
157
+ // Specifies a list of hash policies to use for ring hash load balancing. If ``hash_policy`` is
158
+ // set, then
159
+ // :ref:`route level hash policy <envoy_v3_api_field_config.route.v3.RouteAction.hash_policy>`
160
+ // will be ignored.
161
+ repeated config.route.v3.RouteAction.HashPolicy hash_policy = 3;
162
+ }
163
+
164
+ // Connection overrides for the ORCA out-of-band (OOB) reporting stream, used by
165
+ // load balancing policies that consume ORCA load reports (e.g.
166
+ // :ref:`client_side_weighted_round_robin
167
+ // <envoy_v3_api_msg_extensions.load_balancing_policies.client_side_weighted_round_robin.v3.ClientSideWeightedRoundRobin>`).
168
+ // Whether and when OOB reporting runs is controlled by the embedding policy.
169
+ message OrcaOobReportingConfig {
170
+ // Optional alternative port for the OOB reporting connection, for example an
171
+ // ORCA reporting sidecar listening on a dedicated port. If 0 or unset, the
172
+ // port of the host's ORCA reporting address is used. Ignored for non-IP
173
+ // (pipe/UDS) host addresses.
174
+ uint32 port_value = 1 [(validate.rules).uint32 = {lte: 65535}];
175
+
176
+ // Value of the ``:authority`` header on the OOB gRPC stream. If empty, the
177
+ // endpoint hostname is used, then the dialed address, then the cluster name.
178
+ string authority = 2
179
+ [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
180
+
181
+ // Optional key/value pairs used to select a transport socket from the
182
+ // cluster's :ref:`transport_socket_matches
183
+ // <envoy_v3_api_field_config.cluster.v3.Cluster.transport_socket_matches>`
184
+ // for the OOB connection. If unset, or if no match is found, the cluster's
185
+ // default transport socket is used. ALPN ``h2`` is always forced on the OOB
186
+ // connection regardless of this setting.
187
+ google.protobuf.Struct transport_socket_match_criteria = 3;
188
+ }