From 0233530d0708de1fefb89a2820e6b7e9eafbf80c Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Thu, 1 Mar 2018 19:20:35 -0500 Subject: [PATCH 1/2] tcp proxy: add metadata_match to tcp proxy config This should allow the tcp proxy to target a specific subset of endpoints in a cluster by matching on the metadata, similar to what is currently possible in the http_connection_manager filter. See https://github.com/envoyproxy/envoy/issues/2696 Signed-off-by: Snow Pettersen --- envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.proto | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.proto b/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.proto index af2bb2839..fa5fc8e9b 100644 --- a/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.proto +++ b/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.proto @@ -5,6 +5,7 @@ option go_package = "v2"; import "envoy/config/filter/accesslog/v2/accesslog.proto"; import "envoy/api/v2/core/address.proto"; +import "envoy/api/v2/core/base.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; @@ -34,6 +35,12 @@ message TcpProxy { // string cluster = 2; + // [#not-implemented-hide:] + // Optional endpoint metadata match criteria. Only endpoints in the upstream + // cluster with metadata matching that set in metadata_match will be + // considered. The filter name should be specified as *envoy.lb*. + envoy.api.v2.core.Metadata metadata_match = 9; + // The idle timeout for connections managed by the TCP proxy filter. The idle timeout // is defined as the period in which there are no bytes sent or received on either // the upstream or downstream connection. If not set, connections will never be closed From 0de9e0d1150561911170d9eb4dc2109511fb70e2 Mon Sep 17 00:00:00 2001 From: Snow Pettersen Date: Thu, 1 Mar 2018 19:28:27 -0500 Subject: [PATCH 2/2] Add dependency on core/base.proto Signed-off-by: Snow Pettersen --- envoy/config/filter/network/tcp_proxy/v2/BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/envoy/config/filter/network/tcp_proxy/v2/BUILD b/envoy/config/filter/network/tcp_proxy/v2/BUILD index 20bcbbad8..2e7296fa3 100644 --- a/envoy/config/filter/network/tcp_proxy/v2/BUILD +++ b/envoy/config/filter/network/tcp_proxy/v2/BUILD @@ -7,6 +7,7 @@ api_proto_library( srcs = ["tcp_proxy.proto"], deps = [ "//envoy/api/v2/core:address", + "//envoy/api/v2/core:base", "//envoy/config/filter/accesslog/v2:accesslog", ], )