From fbae81c941195bc0e7ebf6813a6a1debe868e63a Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Sun, 28 Jul 2019 19:46:20 +0000 Subject: [PATCH] filter: add network filters to the upstreams (#7503) Signed-off-by: Kuat Yessenov Mirrored from https://github.com/envoyproxy/envoy @ 0f892c2385e7051d325d22b3f603cc60facedd6e --- envoy/api/v2/BUILD | 2 ++ envoy/api/v2/cds.proto | 8 +++++++- envoy/api/v2/cluster/BUILD | 13 +++++++++++++ envoy/api/v2/cluster/filter.proto | 30 ++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 envoy/api/v2/cluster/filter.proto diff --git a/envoy/api/v2/BUILD b/envoy/api/v2/BUILD index 3cc2d6b2..48ddb2e1 100644 --- a/envoy/api/v2/BUILD +++ b/envoy/api/v2/BUILD @@ -67,6 +67,7 @@ api_proto_library_internal( ":eds", "//envoy/api/v2/auth:cert", "//envoy/api/v2/cluster:circuit_breaker", + "//envoy/api/v2/cluster:filter", "//envoy/api/v2/cluster:outlier_detection", "//envoy/api/v2/core:address", "//envoy/api/v2/core:base", @@ -86,6 +87,7 @@ api_go_grpc_library( ":eds_go_grpc", "//envoy/api/v2/auth:cert_go_proto", "//envoy/api/v2/cluster:circuit_breaker_go_proto", + "//envoy/api/v2/cluster:filter_go_proto", "//envoy/api/v2/cluster:outlier_detection_go_proto", "//envoy/api/v2/core:address_go_proto", "//envoy/api/v2/core:base_go_proto", diff --git a/envoy/api/v2/cds.proto b/envoy/api/v2/cds.proto index 44d2d750..bddcf1d5 100644 --- a/envoy/api/v2/cds.proto +++ b/envoy/api/v2/cds.proto @@ -16,6 +16,7 @@ import "envoy/api/v2/discovery.proto"; import "envoy/api/v2/core/health_check.proto"; import "envoy/api/v2/core/protocol.proto"; import "envoy/api/v2/cluster/circuit_breaker.proto"; +import "envoy/api/v2/cluster/filter.proto"; import "envoy/api/v2/cluster/outlier_detection.proto"; import "envoy/api/v2/eds.proto"; import "envoy/type/percent.proto"; @@ -51,7 +52,7 @@ service ClusterDiscoveryService { // [#protodoc-title: Clusters] // Configuration for a single upstream cluster. -// [#comment:next free field: 40] +// [#comment:next free field: 41] message Cluster { // Supplies the name of the cluster which must be unique across all clusters. // The cluster name is used when emitting @@ -632,6 +633,11 @@ message Cluster { // If this flag is not set to true, Envoy will wait until the hosts fail active health // checking before removing it from the cluster. bool drain_connections_on_host_removal = 32; + + // An optional list of network filters that make up the filter chain for + // outgoing connections made by the cluster. Order matters as the filters are + // processed sequentially as connection events happen. + repeated cluster.Filter filters = 40; } // An extensible structure containing the address Envoy should bind to when diff --git a/envoy/api/v2/cluster/BUILD b/envoy/api/v2/cluster/BUILD index ab34f59d..5589905d 100644 --- a/envoy/api/v2/cluster/BUILD +++ b/envoy/api/v2/cluster/BUILD @@ -33,3 +33,16 @@ api_go_proto_library( name = "outlier_detection", proto = ":outlier_detection", ) + +api_proto_library_internal( + name = "filter", + srcs = ["filter.proto"], + visibility = [ + "//envoy/api/v2:__pkg__", + ], +) + +api_go_proto_library( + name = "filter", + proto = ":filter", +) diff --git a/envoy/api/v2/cluster/filter.proto b/envoy/api/v2/cluster/filter.proto new file mode 100644 index 00000000..03a82697 --- /dev/null +++ b/envoy/api/v2/cluster/filter.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package envoy.api.v2.cluster; + +option java_outer_classname = "FilterProto"; +option java_multiple_files = true; +option java_package = "io.envoyproxy.envoy.api.v2.cluster"; +option csharp_namespace = "Envoy.Api.V2.ClusterNS"; +option ruby_package = "Envoy.Api.V2.ClusterNS"; + +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; + +import "validate/validate.proto"; +import "gogoproto/gogo.proto"; + +option (gogoproto.equal_all) = true; + +// [#protodoc-title: Upstream filters] +// +// Upstream filters apply to the connections to the upstream cluster hosts. +message Filter { + // The name of the filter to instantiate. The name must match a + // :ref:`supported filter `. + string name = 1 [(validate.rules).string.min_bytes = 1]; + + // Filter specific configuration which depends on the filter being + // instantiated. See the supported filters for further documentation. + google.protobuf.Any typed_config = 2; +}