tcp proxy: use source IP for tcp proxy hash (#8778)

Signed-off-by: Yan Xue <yxyan@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 174ba21bb88b7d50d0b7efeefd0c43268b2afd5e
master-ci-test
data-plane-api(CircleCI) 6 years ago
parent 169d539554
commit a8602cd5d4
  1. 1
      envoy/config/filter/network/tcp_proxy/v2/BUILD
  2. 8
      envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.proto
  3. 1
      envoy/config/filter/network/tcp_proxy/v3alpha/BUILD
  4. 8
      envoy/config/filter/network/tcp_proxy/v3alpha/tcp_proxy.proto
  5. 25
      envoy/type/hash_policy.proto
  6. 25
      envoy/type/v3alpha/hash_policy.proto

@ -8,5 +8,6 @@ api_proto_package(
deps = [
"//envoy/api/v2/core:pkg",
"//envoy/config/filter/accesslog/v2:pkg",
"//envoy/type:pkg",
],
)

@ -9,6 +9,7 @@ option java_package = "io.envoyproxy.envoy.config.filter.network.tcp_proxy.v2";
import "envoy/api/v2/core/address.proto";
import "envoy/api/v2/core/base.proto";
import "envoy/config/filter/accesslog/v2/accesslog.proto";
import "envoy/type/hash_policy.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
@ -18,7 +19,7 @@ import "validate/validate.proto";
// [#protodoc-title: TCP Proxy]
// TCP Proxy :ref:`configuration overview <config_network_filters_tcp_proxy>`.
// [#next-free-field: 11]
// [#next-free-field: 12]
message TcpProxy {
// [#not-implemented-hide:] Deprecated.
// TCP Proxy filter configuration using V1 format.
@ -148,4 +149,9 @@ message TcpProxy {
// The maximum number of unsuccessful connection attempts that will be made before
// giving up. If the parameter is not specified, 1 connection attempt will be made.
google.protobuf.UInt32Value max_connect_attempts = 7 [(validate.rules).uint32 = {gte: 1}];
// Optional configuration for TCP proxy hash policy. If hash_policy is not set, the hash-based
// load balancing algorithms will select a host randomly. Currently the number of hash policies is
// limited to 1.
repeated type.HashPolicy hash_policy = 11 [(validate.rules).repeated = {max_items: 1}];
}

@ -8,5 +8,6 @@ api_proto_package(
deps = [
"//envoy/api/v3alpha/core:pkg",
"//envoy/config/filter/accesslog/v3alpha:pkg",
"//envoy/type/v3alpha:pkg",
],
)

@ -9,6 +9,7 @@ option java_package = "io.envoyproxy.envoy.config.filter.network.tcp_proxy.v3alp
import "envoy/api/v3alpha/core/address.proto";
import "envoy/api/v3alpha/core/base.proto";
import "envoy/config/filter/accesslog/v3alpha/accesslog.proto";
import "envoy/type/v3alpha/hash_policy.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
@ -18,7 +19,7 @@ import "validate/validate.proto";
// [#protodoc-title: TCP Proxy]
// TCP Proxy :ref:`configuration overview <config_network_filters_tcp_proxy>`.
// [#next-free-field: 11]
// [#next-free-field: 12]
message TcpProxy {
// Allows for specification of multiple upstream clusters along with weights
@ -93,4 +94,9 @@ message TcpProxy {
// The maximum number of unsuccessful connection attempts that will be made before
// giving up. If the parameter is not specified, 1 connection attempt will be made.
google.protobuf.UInt32Value max_connect_attempts = 7 [(validate.rules).uint32 = {gte: 1}];
// Optional configuration for TCP proxy hash policy. If hash_policy is not set, the hash-based
// load balancing algorithms will select a host randomly. Currently the number of hash policies is
// limited to 1.
repeated type.v3alpha.HashPolicy hash_policy = 11 [(validate.rules).repeated = {max_items: 1}];
}

@ -0,0 +1,25 @@
syntax = "proto3";
package envoy.type;
option java_outer_classname = "HashPolicyProto";
option java_multiple_files = true;
option java_package = "io.envoyproxy.envoy.type";
import "validate/validate.proto";
// [#protodoc-title: Hash Policy]
// Specifies the hash policy
message HashPolicy {
// The source IP will be used to compute the hash used by hash-based load balancing
// algorithms.
message SourceIp {
}
oneof policy_specifier {
option (validate.required) = true;
SourceIp source_ip = 1;
}
}

@ -0,0 +1,25 @@
syntax = "proto3";
package envoy.type.v3alpha;
option java_outer_classname = "HashPolicyProto";
option java_multiple_files = true;
option java_package = "io.envoyproxy.envoy.type.v3alpha";
import "validate/validate.proto";
// [#protodoc-title: Hash Policy]
// Specifies the hash policy
message HashPolicy {
// The source IP will be used to compute the hash used by hash-based load balancing
// algorithms.
message SourceIp {
}
oneof policy_specifier {
option (validate.required) = true;
SourceIp source_ip = 1;
}
}
Loading…
Cancel
Save