From 2c4ba984c28a037b520386a413aef750d481a54d Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 16 Jan 2018 21:32:47 -0800 Subject: [PATCH 01/47] shuffle files and create discovery/cluster packages Signed-off-by: Kuat Yessenov --- api/{ => auth}/auth.proto | 0 api/cluster/BUILD | 30 +++++++++++++ api/{cds.proto => cluster/cluster.proto} | 0 api/discovery/BUILD | 57 ++++++++++++++++++++++++ api/discovery/cds.proto | 21 +++++++++ api/{ => discovery}/discovery.proto | 0 api/{ => discovery}/eds.proto | 0 7 files changed, 108 insertions(+) rename api/{ => auth}/auth.proto (100%) create mode 100644 api/cluster/BUILD rename api/{cds.proto => cluster/cluster.proto} (100%) create mode 100644 api/discovery/BUILD create mode 100644 api/discovery/cds.proto rename api/{ => discovery}/discovery.proto (100%) rename api/{ => discovery}/eds.proto (100%) diff --git a/api/auth.proto b/api/auth/auth.proto similarity index 100% rename from api/auth.proto rename to api/auth/auth.proto diff --git a/api/cluster/BUILD b/api/cluster/BUILD new file mode 100644 index 000000000..f3dea63df --- /dev/null +++ b/api/cluster/BUILD @@ -0,0 +1,30 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library", "api_go_grpc_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "cluster", + srcs = ["cluster.proto"], + has_services = 1, + deps = [ + "//api:address", + "//api:base", + "//api:config_source", + "//api:health_check", + "//api:protocol", + "//api:sds", + ], +) + +api_go_proto_library( + name = "cluster", + proto = ":cluster", + deps = [ + "//api:address_go_proto", + "//api:base_go_proto", + "//api:config_source_go_proto", + "//api:health_check_go_proto", + "//api:protocol_go_proto", + "//api:sds_go_grpc", + ], +) diff --git a/api/cds.proto b/api/cluster/cluster.proto similarity index 100% rename from api/cds.proto rename to api/cluster/cluster.proto diff --git a/api/discovery/BUILD b/api/discovery/BUILD new file mode 100644 index 000000000..872eefd9b --- /dev/null +++ b/api/discovery/BUILD @@ -0,0 +1,57 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library", "api_go_grpc_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "discovery", + srcs = ["discovery.proto"], + has_services = 1, + deps = ["//api:base"], +) + +api_go_grpc_library( + name = "discovery", + proto = ":discovery", + deps = ["//api:base_go_proto"], +) + +api_proto_library( + name = "eds", + srcs = ["eds.proto"], + has_services = 1, + deps = [ + ":discovery", + "//api:address", + "//api:base", + "//api:health_check", + ], +) + +api_go_grpc_library( + name = "eds", + proto = ":eds", + deps = [ + ":discovery_go_grpc", + "//api:address_go_proto", + "//api:base_go_proto", + "//api:health_check_go_proto", + ], +) + + +api_proto_library( + name = "cds", + srcs = ["cds.proto"], + has_services = 1, + deps = [ + ":discovery", + ], +) + +api_go_grpc_library( + name = "cds", + proto = ":cds", + deps = [ + ":discovery_go_grpc", + ], +) diff --git a/api/discovery/cds.proto b/api/discovery/cds.proto new file mode 100644 index 000000000..0020a2e61 --- /dev/null +++ b/api/discovery/cds.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package envoy.api.v2.discovery; + +import "api/discovery/discovery.proto"; + +import "google/api/annotations.proto"; + +// Return list of all clusters this proxy will load balance to. +service ClusterDiscoveryService { + rpc StreamClusters(stream DiscoveryRequest) returns (stream DiscoveryResponse) { + } + + rpc FetchClusters(DiscoveryRequest) returns (DiscoveryResponse) { + option (google.api.http) = { + post: "/v2/discovery:clusters" + body: "*" + }; + } +} + diff --git a/api/discovery.proto b/api/discovery/discovery.proto similarity index 100% rename from api/discovery.proto rename to api/discovery/discovery.proto diff --git a/api/eds.proto b/api/discovery/eds.proto similarity index 100% rename from api/eds.proto rename to api/discovery/eds.proto From 5f7b32202f10a64e19f58d234026260b96ba85c8 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 16 Jan 2018 21:38:49 -0800 Subject: [PATCH 02/47] shuffle files and create discovery/cluster packages Signed-off-by: Kuat Yessenov --- api/BUILD | 108 ++++------------------------------ api/auth/BUILD | 22 ++++++- api/bootstrap.proto | 4 +- api/cluster/cluster.proto | 17 +----- api/discovery/discovery.proto | 2 +- api/discovery/eds.proto | 4 +- api/lds.proto | 6 +- api/rds.proto | 8 +-- api/sds.proto | 6 +- test/build/BUILD | 12 ++-- test/build/build_test.cc | 10 ++-- test/validate/BUILD | 4 +- test/validate/pgv_test.cc | 4 +- 13 files changed, 64 insertions(+), 143 deletions(-) diff --git a/api/BUILD b/api/BUILD index b79285355..7dd2554dd 100644 --- a/api/BUILD +++ b/api/BUILD @@ -30,7 +30,7 @@ api_proto_library( deps = [ ":address", ":base", - ":cds", + "//api/cluster:cluster", ":config_source", ":grpc_service", ":lds", @@ -46,7 +46,7 @@ api_go_proto_library( deps = [ ":address_go_proto", ":base_go_proto", - ":cds_go_grpc", + "//api/cluster:cluster_go_proto", ":config_source_go_proto", ":grpc_service_go_proto", ":lds_go_grpc", @@ -68,35 +68,6 @@ api_go_proto_library( deps = [":base_go_proto"], ) -api_proto_library( - name = "cds", - srcs = ["cds.proto"], - has_services = 1, - deps = [ - ":address", - ":base", - ":config_source", - ":discovery", - ":health_check", - ":protocol", - ":sds", - ], -) - -api_go_grpc_library( - name = "cds", - proto = ":cds", - deps = [ - ":address_go_proto", - ":base_go_proto", - ":config_source_go_proto", - ":discovery_go_grpc", - ":health_check_go_proto", - ":protocol_go_proto", - ":sds_go_grpc", - ], -) - api_proto_library( name = "config_source", srcs = ["config_source.proto"], @@ -115,42 +86,6 @@ api_go_proto_library( ], ) -api_proto_library( - name = "discovery", - srcs = ["discovery.proto"], - has_services = 1, - deps = [":base"], -) - -api_go_grpc_library( - name = "discovery", - proto = ":discovery", - deps = [":base_go_proto"], -) - -api_proto_library( - name = "eds", - srcs = ["eds.proto"], - has_services = 1, - deps = [ - ":address", - ":base", - ":discovery", - ":health_check", - ], -) - -api_go_grpc_library( - name = "eds", - proto = ":eds", - deps = [ - ":address_go_proto", - ":base_go_proto", - ":discovery_go_grpc", - ":health_check_go_proto", - ], -) - api_proto_library( name = "grpc_service", srcs = ["grpc_service.proto"], @@ -189,7 +124,7 @@ api_proto_library( deps = [ ":address", ":base", - ":discovery", + "//api/discovery:discovery", ":sds", ], ) @@ -200,7 +135,7 @@ api_go_grpc_library( deps = [ ":address_go_proto", ":base_go_proto", - ":discovery_go_grpc", + "//api/discovery:discovery_go_grpc", ":sds_go_grpc", ], ) @@ -243,9 +178,9 @@ api_proto_library( srcs = ["rds.proto"], has_services = 1, deps = [ - ":auth", + "//api/auth:auth", ":base", - ":discovery", + "//api/discovery:discovery", ], ) @@ -253,9 +188,9 @@ api_go_grpc_library( name = "rds", proto = ":rds", deps = [ - ":auth_go_proto", + "//api/auth:auth_go_proto", ":base_go_proto", - ":discovery_go_grpc", + "//api/discovery:discovery_go_grpc", ], ) @@ -266,7 +201,7 @@ api_proto_library( deps = [ ":base", ":config_source", - ":discovery", + "//api/discovery:discovery", ], ) @@ -276,7 +211,7 @@ api_go_grpc_library( deps = [ ":base_go_proto", ":config_source_go_proto", - ":discovery_go_grpc", + "//api/discovery:discovery_go_grpc", ], ) @@ -306,37 +241,20 @@ api_go_proto_library( proto = ":trace", ) -api_proto_library( - name = "auth", - srcs = ["auth.proto"], - deps = [ - ":sds", - ], -) - -api_go_proto_library( - name = "auth", - proto = ":auth", - deps = [ - "//api:address_go_proto", - "//api:sds_go_grpc", - "@googleapis//:rpc_status_go_proto", - ], -) - # TODO(htuch): Grow this to cover everything we want to generate docs for, so we can just invoke # bazel build //api --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst proto_library( name = "api", deps = [ ":bootstrap", - ":cds", - ":eds", ":lds", ":metrics", ":protocol", ":rds", ":rls", + "//api/cluster:cluster", + "//api/discovery:eds", + "//api/discovery:cds", "//api/filter/accesslog", "//api/filter/http:buffer", "//api/filter/http:ext_authz", diff --git a/api/auth/BUILD b/api/auth/BUILD index 4c6a60e91..e7f3df0c8 100644 --- a/api/auth/BUILD +++ b/api/auth/BUILD @@ -1,9 +1,9 @@ -load("//bazel:api_build_system.bzl", "api_proto_library") +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") licenses(["notice"]) # Apache 2 api_proto_library( - name = "auth", + name = "external_auth", srcs = [ "external_auth.proto", ], @@ -12,3 +12,21 @@ api_proto_library( "//api:address", ], ) + +api_proto_library( + name = "auth", + srcs = ["auth.proto"], + deps = [ + "//api:sds", + ], +) + +api_go_proto_library( + name = "auth", + proto = ":auth", + deps = [ + "//api:address_go_proto", + "//api:sds_go_grpc", + "@googleapis//:rpc_status_go_proto", + ], +) diff --git a/api/bootstrap.proto b/api/bootstrap.proto index ad87f43a0..fcbff4043 100644 --- a/api/bootstrap.proto +++ b/api/bootstrap.proto @@ -10,7 +10,7 @@ package envoy.api.v2; import "api/address.proto"; import "api/base.proto"; import "api/config_source.proto"; -import "api/cds.proto"; +import "api/cluster/cluster.proto"; import "api/grpc_service.proto"; import "api/lds.proto"; import "api/sds.proto"; @@ -39,7 +39,7 @@ message Bootstrap { // how to speak to the management server. These cluster definitions may not // use :ref:`EDS ` (i.e. they should be static // IP or DNS-based). - repeated Cluster clusters = 2; + repeated cluster.Cluster clusters = 2; // [#not-implemented-hide:] repeated Secret secrets = 3; diff --git a/api/cluster/cluster.proto b/api/cluster/cluster.proto index 178e645ae..05b797486 100644 --- a/api/cluster/cluster.proto +++ b/api/cluster/cluster.proto @@ -1,16 +1,14 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.cluster; import "api/address.proto"; import "api/base.proto"; import "api/config_source.proto"; -import "api/discovery.proto"; import "api/health_check.proto"; import "api/protocol.proto"; import "api/sds.proto"; -import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; @@ -20,19 +18,6 @@ import "gogoproto/gogo.proto"; // [#protodoc-title: Clusters and CDS] -// Return list of all clusters this proxy will load balance to. -service ClusterDiscoveryService { - rpc StreamClusters(stream DiscoveryRequest) returns (stream DiscoveryResponse) { - } - - rpc FetchClusters(DiscoveryRequest) returns (DiscoveryResponse) { - option (google.api.http) = { - post: "/v2/discovery:clusters" - body: "*" - }; - } -} - message Cluster { // Supplies the name of the cluster which must be unique across all clusters. // The cluster name is used when emitting diff --git a/api/discovery/discovery.proto b/api/discovery/discovery.proto index eba088cf3..af7f766ac 100644 --- a/api/discovery/discovery.proto +++ b/api/discovery/discovery.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.discovery; import "api/base.proto"; diff --git a/api/discovery/eds.proto b/api/discovery/eds.proto index 7b25d00db..f81a8942a 100644 --- a/api/discovery/eds.proto +++ b/api/discovery/eds.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.discovery; import "api/base.proto"; -import "api/discovery.proto"; +import "api/discovery/discovery.proto"; import "api/health_check.proto"; import "google/api/annotations.proto"; diff --git a/api/lds.proto b/api/lds.proto index 8fdc97def..bfa1c0146 100644 --- a/api/lds.proto +++ b/api/lds.proto @@ -4,7 +4,7 @@ package envoy.api.v2; import "api/address.proto"; import "api/base.proto"; -import "api/discovery.proto"; +import "api/discovery/discovery.proto"; import "api/sds.proto"; import "google/api/annotations.proto"; @@ -21,10 +21,10 @@ import "validate/validate.proto"; // consist of a complete update of all listeners. Existing connections will be // allowed to drain from listeners that are no longer present. service ListenerDiscoveryService { - rpc StreamListeners(stream DiscoveryRequest) returns (stream DiscoveryResponse) { + rpc StreamListeners(stream discovery.DiscoveryRequest) returns (stream discovery.DiscoveryResponse) { } - rpc FetchListeners(DiscoveryRequest) returns (DiscoveryResponse) { + rpc FetchListeners(discovery.DiscoveryRequest) returns (discovery.DiscoveryResponse) { option (google.api.http) = { post: "/v2/discovery:listeners" body: "*" diff --git a/api/rds.proto b/api/rds.proto index a45dcd301..71767ef6a 100644 --- a/api/rds.proto +++ b/api/rds.proto @@ -2,9 +2,9 @@ syntax = "proto3"; package envoy.api.v2; -import "api/auth.proto"; +import "api/auth/auth.proto"; import "api/base.proto"; -import "api/discovery.proto"; +import "api/discovery/discovery.proto"; import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; @@ -21,10 +21,10 @@ import "gogoproto/gogo.proto"; // configurations. Each listener will bind its HTTP connection manager filter to // a route table via this identifier. service RouteDiscoveryService { - rpc StreamRoutes(stream DiscoveryRequest) returns (stream DiscoveryResponse) { + rpc StreamRoutes(stream discovery.DiscoveryRequest) returns (stream discovery.DiscoveryResponse) { } - rpc FetchRoutes(DiscoveryRequest) returns (DiscoveryResponse) { + rpc FetchRoutes(discovery.DiscoveryRequest) returns (discovery.DiscoveryResponse) { option (google.api.http) = { post: "/v2/discovery:routes" body: "*" diff --git a/api/sds.proto b/api/sds.proto index 148c185e1..447b585df 100644 --- a/api/sds.proto +++ b/api/sds.proto @@ -4,7 +4,7 @@ package envoy.api.v2; import "api/base.proto"; import "api/config_source.proto"; -import "api/discovery.proto"; +import "api/discovery/discovery.proto"; import "google/api/annotations.proto"; import "google/protobuf/wrappers.proto"; @@ -14,10 +14,10 @@ import "validate/validate.proto"; // [#protodoc-title: Common TLS configuration] service SecretDiscoveryService { - rpc StreamSecrets(stream DiscoveryRequest) returns (stream DiscoveryResponse) { + rpc StreamSecrets(stream discovery.DiscoveryRequest) returns (stream discovery.DiscoveryResponse) { } - rpc FetchSecrets(DiscoveryRequest) returns (DiscoveryResponse) { + rpc FetchSecrets(discovery.DiscoveryRequest) returns (discovery.DiscoveryResponse) { option (google.api.http) = { post: "/v2/discovery:secrets" body: "*" diff --git a/test/build/BUILD b/test/build/BUILD index d214a2dc1..1ba7bbc5c 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -6,9 +6,9 @@ api_cc_test( name = "build_test", srcs = ["build_test.cc"], proto_deps = [ - "//api:cds", - "//api:discovery", - "//api:eds", + "//api/discovery:cds", + "//api/discovery:discovery", + "//api/discovery:eds", "//api:hds", "//api:lds", "//api:metrics", @@ -25,9 +25,9 @@ api_go_test( importpath = "go_build_test", deps = [ "//api:bootstrap_go_proto", - "//api:cds_go_grpc", - "//api:discovery_go_grpc", - "//api:eds_go_grpc", + "//api/discovery:cds_go_grpc", + "//api/discovery:discovery_go_grpc", + "//api/discovery:eds_go_grpc", "//api:hds_go_grpc", "//api:lds_go_grpc", "//api:rds_go_grpc", diff --git a/test/build/build_test.cc b/test/build/build_test.cc index cc4ff80e7..7502fdbf0 100644 --- a/test/build/build_test.cc +++ b/test/build/build_test.cc @@ -7,11 +7,11 @@ int main(int argc, char* argv[]) { const auto methods = { "envoy.api.v2.filter.accesslog.AccessLogService.StreamAccessLogs", - "envoy.api.v2.AggregatedDiscoveryService.StreamAggregatedResources", - "envoy.api.v2.ClusterDiscoveryService.FetchClusters", - "envoy.api.v2.ClusterDiscoveryService.StreamClusters", - "envoy.api.v2.EndpointDiscoveryService.FetchEndpoints", - "envoy.api.v2.EndpointDiscoveryService.StreamEndpoints", + "envoy.api.v2.discovery.AggregatedDiscoveryService.StreamAggregatedResources", + "envoy.api.v2.discovery.ClusterDiscoveryService.FetchClusters", + "envoy.api.v2.discovery.ClusterDiscoveryService.StreamClusters", + "envoy.api.v2.discovery.EndpointDiscoveryService.FetchEndpoints", + "envoy.api.v2.discovery.EndpointDiscoveryService.StreamEndpoints", "envoy.api.v2.HealthDiscoveryService.FetchHealthCheck", "envoy.api.v2.HealthDiscoveryService.StreamHealthCheck", "envoy.api.v2.ListenerDiscoveryService.FetchListeners", diff --git a/test/validate/BUILD b/test/validate/BUILD index 6ae1a8073..da83b212b 100644 --- a/test/validate/BUILD +++ b/test/validate/BUILD @@ -7,8 +7,8 @@ api_cc_test( srcs = ["pgv_test.cc"], proto_deps = [ "//api:bootstrap", - "//api:cds", - "//api:eds", + "//api/discovery:cds", + "//api/discovery:eds", "//api:lds", "//api:protocol", "//api:rds", diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index b6060abc8..c7439d7c7 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -5,8 +5,8 @@ // a cheap way to get some C++ compiler sanity checking. #include "api/bootstrap.pb.validate.h" #include "api/protocol.pb.validate.h" -#include "api/cds.pb.validate.h" -#include "api/eds.pb.validate.h" +#include "api/cluster/cluster.pb.validate.h" +#include "api/discovery/eds.pb.validate.h" #include "api/lds.pb.validate.h" #include "api/rds.pb.validate.h" #include "api/rds.pb.validate.h" From 7861bba38212d0b18acc1e7b39b100877901ccdd Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 16 Jan 2018 22:07:31 -0800 Subject: [PATCH 03/47] split cluster.proto Signed-off-by: Kuat Yessenov --- api/BUILD | 31 ++------ api/auth/BUILD | 4 +- api/auth/auth.proto | 4 +- api/bootstrap.proto | 4 +- api/cert/BUILD | 21 ++++++ api/{sds.proto => cert/cert.proto} | 16 +--- api/cluster/BUILD | 37 +++++++++- api/cluster/circuit_breaker.proto | 45 ++++++++++++ api/cluster/cluster.proto | 109 +--------------------------- api/cluster/outlier_detection.proto | 74 +++++++++++++++++++ api/discovery/BUILD | 18 +++++ api/discovery/sds.proto | 20 +++++ api/lds.proto | 4 +- test/build/BUILD | 3 +- 14 files changed, 232 insertions(+), 158 deletions(-) create mode 100644 api/cert/BUILD rename api/{sds.proto => cert/cert.proto} (95%) create mode 100644 api/cluster/circuit_breaker.proto create mode 100644 api/cluster/outlier_detection.proto create mode 100644 api/discovery/sds.proto diff --git a/api/BUILD b/api/BUILD index 7dd2554dd..36d4c6282 100644 --- a/api/BUILD +++ b/api/BUILD @@ -34,7 +34,7 @@ api_proto_library( ":config_source", ":grpc_service", ":lds", - ":sds", + "//api/cert:cert", ":stats", ":trace", ], @@ -50,7 +50,7 @@ api_go_proto_library( ":config_source_go_proto", ":grpc_service_go_proto", ":lds_go_grpc", - ":sds_go_grpc", + "//api/cert:cert_go_proto", ":stats_go_proto", ":trace_go_proto", ], @@ -125,7 +125,7 @@ api_proto_library( ":address", ":base", "//api/discovery:discovery", - ":sds", + "//api/cert:cert", ], ) @@ -136,7 +136,7 @@ api_go_grpc_library( ":address_go_proto", ":base_go_proto", "//api/discovery:discovery_go_grpc", - ":sds_go_grpc", + "//api/cert:cert_go_proto", ], ) @@ -194,27 +194,6 @@ api_go_grpc_library( ], ) -api_proto_library( - name = "sds", - srcs = ["sds.proto"], - has_services = 1, - deps = [ - ":base", - ":config_source", - "//api/discovery:discovery", - ], -) - -api_go_grpc_library( - name = "sds", - proto = ":sds", - deps = [ - ":base_go_proto", - ":config_source_go_proto", - "//api/discovery:discovery_go_grpc", - ], -) - api_proto_library( name = "stats", srcs = ["stats.proto"], @@ -252,7 +231,9 @@ proto_library( ":protocol", ":rds", ":rls", + "//api/cluster:circuit_breaker", "//api/cluster:cluster", + "//api/cluster:outlier_detection", "//api/discovery:eds", "//api/discovery:cds", "//api/filter/accesslog", diff --git a/api/auth/BUILD b/api/auth/BUILD index e7f3df0c8..c3dac3431 100644 --- a/api/auth/BUILD +++ b/api/auth/BUILD @@ -17,7 +17,7 @@ api_proto_library( name = "auth", srcs = ["auth.proto"], deps = [ - "//api:sds", + "//api/cert:cert", ], ) @@ -26,7 +26,7 @@ api_go_proto_library( proto = ":auth", deps = [ "//api:address_go_proto", - "//api:sds_go_grpc", + "//api/cert:cert_go_proto", "@googleapis//:rpc_status_go_proto", ], ) diff --git a/api/auth/auth.proto b/api/auth/auth.proto index 6236e241d..c8fe6bc7c 100644 --- a/api/auth/auth.proto +++ b/api/auth/auth.proto @@ -4,7 +4,7 @@ syntax = "proto3"; package envoy.api.v2.auth; -import "api/sds.proto"; +import "api/cert/cert.proto"; message AuthAction { // Should we do white-list or black-list style access control. @@ -31,7 +31,7 @@ message AuthAction { // Check peer identity using X.509 certificate. message X509Rule { // How to validate peer certificates. - CertificateValidationContext validation_context = 3; + cert.CertificateValidationContext validation_context = 3; } // Element type of AndRule/OrRule, it chooses among different type of rule. diff --git a/api/bootstrap.proto b/api/bootstrap.proto index fcbff4043..938d09040 100644 --- a/api/bootstrap.proto +++ b/api/bootstrap.proto @@ -13,7 +13,7 @@ import "api/config_source.proto"; import "api/cluster/cluster.proto"; import "api/grpc_service.proto"; import "api/lds.proto"; -import "api/sds.proto"; +import "api/cert/cert.proto"; import "api/stats.proto"; import "api/trace.proto"; @@ -42,7 +42,7 @@ message Bootstrap { repeated cluster.Cluster clusters = 2; // [#not-implemented-hide:] - repeated Secret secrets = 3; + repeated cert.Secret secrets = 3; } // Statically specified resources. StaticResources static_resources = 2; diff --git a/api/cert/BUILD b/api/cert/BUILD new file mode 100644 index 000000000..86e021ef5 --- /dev/null +++ b/api/cert/BUILD @@ -0,0 +1,21 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "cert", + srcs = ["cert.proto"], + deps = [ + "//api:base", + "//api:config_source", + ], +) + +api_go_proto_library( + name = "cert", + proto = ":cert", + deps = [ + "//api:base_go_proto", + "//api:config_source_go_proto", + ], +) diff --git a/api/sds.proto b/api/cert/cert.proto similarity index 95% rename from api/sds.proto rename to api/cert/cert.proto index 447b585df..784e6e060 100644 --- a/api/sds.proto +++ b/api/cert/cert.proto @@ -1,30 +1,16 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.cert; import "api/base.proto"; import "api/config_source.proto"; -import "api/discovery/discovery.proto"; -import "google/api/annotations.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; // [#protodoc-title: Common TLS configuration] -service SecretDiscoveryService { - rpc StreamSecrets(stream discovery.DiscoveryRequest) returns (stream discovery.DiscoveryResponse) { - } - - rpc FetchSecrets(discovery.DiscoveryRequest) returns (discovery.DiscoveryResponse) { - option (google.api.http) = { - post: "/v2/discovery:secrets" - body: "*" - }; - } -} - message TlsParameters { enum TlsProtocol { // Envoy will choose the optimal TLS version. diff --git a/api/cluster/BUILD b/api/cluster/BUILD index f3dea63df..384071ab7 100644 --- a/api/cluster/BUILD +++ b/api/cluster/BUILD @@ -1,18 +1,45 @@ -load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library", "api_go_grpc_library") +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") licenses(["notice"]) # Apache 2 +api_proto_library( + name = "circuit_breaker", + srcs = ["circuit_breaker.proto"], + deps = [ + "//api:base", + ], +) + +api_go_proto_library( + name = "circuit_breaker", + proto = ":circuit_breaker", + deps = [ + "//api:base_go_proto", + ], +) + +api_proto_library( + name = "outlier_detection", + srcs = ["outlier_detection.proto"], +) + +api_go_proto_library( + name = "outlier_detection", + proto = ":outlier_detection", +) + api_proto_library( name = "cluster", srcs = ["cluster.proto"], - has_services = 1, deps = [ + ":circuit_breaker", + ":outlier_detection", "//api:address", "//api:base", "//api:config_source", "//api:health_check", "//api:protocol", - "//api:sds", + "//api/cert:cert", ], ) @@ -20,11 +47,13 @@ api_go_proto_library( name = "cluster", proto = ":cluster", deps = [ + ":circuit_breaker_go_proto", + ":outlier_detection_go_proto", "//api:address_go_proto", "//api:base_go_proto", "//api:config_source_go_proto", "//api:health_check_go_proto", "//api:protocol_go_proto", - "//api:sds_go_grpc", + "//api/cert:cert_go_proto", ], ) diff --git a/api/cluster/circuit_breaker.proto b/api/cluster/circuit_breaker.proto new file mode 100644 index 000000000..369bc5d5e --- /dev/null +++ b/api/cluster/circuit_breaker.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package envoy.api.v2.cluster; + +import "api/base.proto"; + +import "google/protobuf/wrappers.proto"; + +// :ref:`Circuit breaking` settings can be +// specified individually for each defined priority. +message CircuitBreakers { + + // A Thresholds defines CircuitBreaker settings for a + // :ref:`RoutingPriority`. + message Thresholds { + // The :ref:`RoutingPriority` + // the specified CircuitBreaker settings apply to. + // [#comment:TODO(htuch): add (validate.rules).enum.defined_only = true once + // https://github.com/lyft/protoc-gen-validate/issues/42 is resolved.] + RoutingPriority priority = 1; + + // The maximum number of connections that Envoy will make to the upstream + // cluster. If not specified, the default is 1024. + google.protobuf.UInt32Value max_connections = 2; + + // The maximum number of pending requests that Envoy will allow to the + // upstream cluster. If not specified, the default is 1024. + google.protobuf.UInt32Value max_pending_requests = 3; + + // The maximum number of parallel requests that Envoy will make to the + // upstream cluster. If not specified, the default is 1024. + google.protobuf.UInt32Value max_requests = 4; + + // The maximum number of parallel retries that Envoy will allow to the + // upstream cluster. If not specified, the default is 3. + google.protobuf.UInt32Value max_retries = 5; + } + + // If multiple :ref:`Thresholds` + // are defined with the same :ref:`RoutingPriority`, + // the first one in the list is used. If no Thresholds is defined for a given + // :ref:`RoutingPriority`, the default values + // are used. + repeated Thresholds thresholds = 1; +} diff --git a/api/cluster/cluster.proto b/api/cluster/cluster.proto index 05b797486..0d6d9f492 100644 --- a/api/cluster/cluster.proto +++ b/api/cluster/cluster.proto @@ -7,7 +7,9 @@ import "api/base.proto"; import "api/config_source.proto"; import "api/health_check.proto"; import "api/protocol.proto"; -import "api/sds.proto"; +import "api/cert/cert.proto"; +import "api/cluster/circuit_breaker.proto"; +import "api/cluster/outlier_detection.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; @@ -145,7 +147,7 @@ message Cluster { // Server certificate verification is not enabled by default. Configure // :ref:`trusted_ca` to enable // verification. - UpstreamTlsContext tls_context = 11; + cert.UpstreamTlsContext tls_context = 11; reserved 12; @@ -207,71 +209,6 @@ message Cluster { // this setting is ignored. repeated Address dns_resolvers = 18; - // See the :ref:`architecture overview ` for - // more information on outlier detection. - message OutlierDetection { - // The number of consecutive 5xx responses before a consecutive 5xx ejection - // occurs. Defaults to 5. - google.protobuf.UInt32Value consecutive_5xx = 1; - - // The time interval between ejection analysis sweeps. This can result in - // both new ejections as well as hosts being returned to service. Defaults - // to 10000ms or 10s. - google.protobuf.Duration interval = 2 [(validate.rules).duration.gt = {}]; - - // The base time that a host is ejected for. The real time is equal to the - // base time multiplied by the number of times the host has been ejected. - // Defaults to 30000ms or 30s. - google.protobuf.Duration base_ejection_time = 3 [(validate.rules).duration.gt = {}]; - - // The maximum % of an upstream cluster that can be ejected due to outlier - // detection. Defaults to 10%. - google.protobuf.UInt32Value max_ejection_percent = 4 [(validate.rules).uint32.lte = 100]; - - // The % chance that a host will be actually ejected when an outlier status - // is detected through consecutive 5xx. This setting can be used to disable - // ejection or to ramp it up slowly. Defaults to 100. - google.protobuf.UInt32Value enforcing_consecutive_5xx = 5 [(validate.rules).uint32.lte = 100]; - - // The % chance that a host will be actually ejected when an outlier status - // is detected through success rate statistics. This setting can be used to - // disable ejection or to ramp it up slowly. Defaults to 100. - google.protobuf.UInt32Value enforcing_success_rate = 6 [(validate.rules).uint32.lte = 100]; - - // The number of hosts in a cluster that must have enough request volume to - // detect success rate outliers. If the number of hosts is less than this - // setting, outlier detection via success rate statistics is not performed - // for any host in the cluster. Defaults to 5. - google.protobuf.UInt32Value success_rate_minimum_hosts = 7; - - // The minimum number of total requests that must be collected in one - // interval (as defined by the interval duration above) to include this host - // in success rate based outlier detection. If the volume is lower than this - // setting, outlier detection via success rate statistics is not performed - // for that host. Defaults to 100. - google.protobuf.UInt32Value success_rate_request_volume = 8; - - // This factor is used to determine the ejection threshold for success rate - // outlier ejection. The ejection threshold is the difference between the - // mean success rate, and the product of this factor and the standard - // deviation of the mean success rate: mean - (stdev * - // success_rate_stdev_factor). This factor is divided by a thousand to get a - // double. That is, if the desired factor is 1.9, the runtime value should - // be 1900. Defaults to 1900. - google.protobuf.UInt32Value success_rate_stdev_factor = 9; - - // The number of consecutive gateway failures (502, 503, 504 status or - // connection errors that are mapped to one of those status codes) before a - // consecutive gateway failure ejection occurs. Defaults to 5. - google.protobuf.UInt32Value consecutive_gateway_failure = 10; - - // The % chance that a host will be actually ejected when an outlier status - // is detected through consecutive gateway failures. This setting can be - // used to disable ejection or to ramp it up slowly. Defaults to 0. - google.protobuf.UInt32Value enforcing_consecutive_gateway_failure = 11 - [(validate.rules).uint32.lte = 100]; - } - // If specified, outlier detection will be enabled for this upstream cluster. // Each of the configuration values can be overridden via // :ref:`runtime values `. @@ -416,41 +353,3 @@ message UpstreamBindConfig { // The address Envoy should bind to when establishing upstream connections. Address source_address = 1; } - -// :ref:`Circuit breaking` settings can be -// specified individually for each defined priority. -message CircuitBreakers { - - // A Thresholds defines CircuitBreaker settings for a - // :ref:`RoutingPriority`. - message Thresholds { - // The :ref:`RoutingPriority` - // the specified CircuitBreaker settings apply to. - // [#comment:TODO(htuch): add (validate.rules).enum.defined_only = true once - // https://github.com/lyft/protoc-gen-validate/issues/42 is resolved.] - RoutingPriority priority = 1; - - // The maximum number of connections that Envoy will make to the upstream - // cluster. If not specified, the default is 1024. - google.protobuf.UInt32Value max_connections = 2; - - // The maximum number of pending requests that Envoy will allow to the - // upstream cluster. If not specified, the default is 1024. - google.protobuf.UInt32Value max_pending_requests = 3; - - // The maximum number of parallel requests that Envoy will make to the - // upstream cluster. If not specified, the default is 1024. - google.protobuf.UInt32Value max_requests = 4; - - // The maximum number of parallel retries that Envoy will allow to the - // upstream cluster. If not specified, the default is 3. - google.protobuf.UInt32Value max_retries = 5; - } - - // If multiple :ref:`Thresholds` - // are defined with the same :ref:`RoutingPriority`, - // the first one in the list is used. If no Thresholds is defined for a given - // :ref:`RoutingPriority`, the default values - // are used. - repeated Thresholds thresholds = 1; -} diff --git a/api/cluster/outlier_detection.proto b/api/cluster/outlier_detection.proto new file mode 100644 index 000000000..d2beab170 --- /dev/null +++ b/api/cluster/outlier_detection.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package envoy.api.v2.cluster; + +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; + +import "validate/validate.proto"; + +// See the :ref:`architecture overview ` for +// more information on outlier detection. +message OutlierDetection { + // The number of consecutive 5xx responses before a consecutive 5xx ejection + // occurs. Defaults to 5. + google.protobuf.UInt32Value consecutive_5xx = 1; + + // The time interval between ejection analysis sweeps. This can result in + // both new ejections as well as hosts being returned to service. Defaults + // to 10000ms or 10s. + google.protobuf.Duration interval = 2 [(validate.rules).duration.gt = {}]; + + // The base time that a host is ejected for. The real time is equal to the + // base time multiplied by the number of times the host has been ejected. + // Defaults to 30000ms or 30s. + google.protobuf.Duration base_ejection_time = 3 [(validate.rules).duration.gt = {}]; + + // The maximum % of an upstream cluster that can be ejected due to outlier + // detection. Defaults to 10%. + google.protobuf.UInt32Value max_ejection_percent = 4 [(validate.rules).uint32.lte = 100]; + + // The % chance that a host will be actually ejected when an outlier status + // is detected through consecutive 5xx. This setting can be used to disable + // ejection or to ramp it up slowly. Defaults to 100. + google.protobuf.UInt32Value enforcing_consecutive_5xx = 5 [(validate.rules).uint32.lte = 100]; + + // The % chance that a host will be actually ejected when an outlier status + // is detected through success rate statistics. This setting can be used to + // disable ejection or to ramp it up slowly. Defaults to 100. + google.protobuf.UInt32Value enforcing_success_rate = 6 [(validate.rules).uint32.lte = 100]; + + // The number of hosts in a cluster that must have enough request volume to + // detect success rate outliers. If the number of hosts is less than this + // setting, outlier detection via success rate statistics is not performed + // for any host in the cluster. Defaults to 5. + google.protobuf.UInt32Value success_rate_minimum_hosts = 7; + + // The minimum number of total requests that must be collected in one + // interval (as defined by the interval duration above) to include this host + // in success rate based outlier detection. If the volume is lower than this + // setting, outlier detection via success rate statistics is not performed + // for that host. Defaults to 100. + google.protobuf.UInt32Value success_rate_request_volume = 8; + + // This factor is used to determine the ejection threshold for success rate + // outlier ejection. The ejection threshold is the difference between the + // mean success rate, and the product of this factor and the standard + // deviation of the mean success rate: mean - (stdev * + // success_rate_stdev_factor). This factor is divided by a thousand to get a + // double. That is, if the desired factor is 1.9, the runtime value should + // be 1900. Defaults to 1900. + google.protobuf.UInt32Value success_rate_stdev_factor = 9; + + // The number of consecutive gateway failures (502, 503, 504 status or + // connection errors that are mapped to one of those status codes) before a + // consecutive gateway failure ejection occurs. Defaults to 5. + google.protobuf.UInt32Value consecutive_gateway_failure = 10; + + // The % chance that a host will be actually ejected when an outlier status + // is detected through consecutive gateway failures. This setting can be + // used to disable ejection or to ramp it up slowly. Defaults to 0. + google.protobuf.UInt32Value enforcing_consecutive_gateway_failure = 11 + [(validate.rules).uint32.lte = 100]; +} + diff --git a/api/discovery/BUILD b/api/discovery/BUILD index 872eefd9b..6765c58d9 100644 --- a/api/discovery/BUILD +++ b/api/discovery/BUILD @@ -55,3 +55,21 @@ api_go_grpc_library( ":discovery_go_grpc", ], ) + +api_proto_library( + name = "sds", + srcs = ["sds.proto"], + has_services = 1, + deps = [ + ":discovery", + ], +) + +api_go_grpc_library( + name = "sds", + proto = ":sds", + deps = [ + ":discovery_go_grpc", + ], +) + diff --git a/api/discovery/sds.proto b/api/discovery/sds.proto new file mode 100644 index 000000000..24b4e39d7 --- /dev/null +++ b/api/discovery/sds.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package envoy.api.v2.discovery; + +import "api/discovery/discovery.proto"; + +import "google/api/annotations.proto"; + +service SecretDiscoveryService { + rpc StreamSecrets(stream DiscoveryRequest) returns (stream DiscoveryResponse) { + } + + rpc FetchSecrets(DiscoveryRequest) returns (DiscoveryResponse) { + option (google.api.http) = { + post: "/v2/discovery:secrets" + body: "*" + }; + } +} + diff --git a/api/lds.proto b/api/lds.proto index bfa1c0146..3754eab55 100644 --- a/api/lds.proto +++ b/api/lds.proto @@ -5,7 +5,7 @@ package envoy.api.v2; import "api/address.proto"; import "api/base.proto"; import "api/discovery/discovery.proto"; -import "api/sds.proto"; +import "api/cert/cert.proto"; import "google/api/annotations.proto"; import "google/protobuf/struct.proto"; @@ -183,7 +183,7 @@ message FilterChain { FilterChainMatch filter_chain_match = 1; // The TLS context for this filter chain. - DownstreamTlsContext tls_context = 2; + cert.DownstreamTlsContext tls_context = 2; // A list of individual network filters that make up the filter chain for // connections established with the listener. Order matters as the filters are diff --git a/test/build/BUILD b/test/build/BUILD index 1ba7bbc5c..0f8331406 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -25,13 +25,14 @@ api_go_test( importpath = "go_build_test", deps = [ "//api:bootstrap_go_proto", + "//api/cert:cert_go_proto", "//api/discovery:cds_go_grpc", "//api/discovery:discovery_go_grpc", "//api/discovery:eds_go_grpc", + "//api/discovery:sds_go_grpc", "//api:hds_go_grpc", "//api:lds_go_grpc", "//api:rds_go_grpc", "//api:rls_go_grpc", - "//api:sds_go_grpc", ], ) From f4a9e8df5b0c7d0fb7c8a400fbabe72b8bdad16b Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 16 Jan 2018 22:30:39 -0800 Subject: [PATCH 04/47] listener and route Signed-off-by: Kuat Yessenov --- api/BUILD | 56 +++---------------- api/bootstrap.proto | 4 +- api/discovery/BUILD | 34 +++++++++++ api/discovery/lds.proto | 24 ++++++++ api/discovery/rds.proto | 25 +++++++++ api/filter/http/BUILD | 2 +- api/filter/http/fault.proto | 4 +- api/filter/network/BUILD | 2 +- .../network/http_connection_manager.proto | 4 +- api/listener/BUILD | 23 ++++++++ api/{lds.proto => listener/listener.proto} | 20 +------ api/route/BUILD | 21 +++++++ api/{rds.proto => route/route.proto} | 23 +------- test/build/BUILD | 8 +-- test/build/build_test.cc | 8 +-- test/validate/BUILD | 6 +- test/validate/pgv_test.cc | 5 +- tools/BUILD | 2 +- tools/generate_listeners.py | 4 +- 19 files changed, 161 insertions(+), 114 deletions(-) create mode 100644 api/discovery/lds.proto create mode 100644 api/discovery/rds.proto create mode 100644 api/listener/BUILD rename api/{lds.proto => listener/listener.proto} (92%) create mode 100644 api/route/BUILD rename api/{rds.proto => route/route.proto} (97%) diff --git a/api/BUILD b/api/BUILD index 36d4c6282..a5ee46411 100644 --- a/api/BUILD +++ b/api/BUILD @@ -33,7 +33,7 @@ api_proto_library( "//api/cluster:cluster", ":config_source", ":grpc_service", - ":lds", + "//api/listener:listener", "//api/cert:cert", ":stats", ":trace", @@ -49,7 +49,7 @@ api_go_proto_library( "//api/cluster:cluster_go_proto", ":config_source_go_proto", ":grpc_service_go_proto", - ":lds_go_grpc", + "//api/listener:listener_go_proto", "//api/cert:cert_go_proto", ":stats_go_proto", ":trace_go_proto", @@ -117,29 +117,6 @@ api_go_grpc_library( ], ) -api_proto_library( - name = "lds", - srcs = ["lds.proto"], - has_services = 1, - deps = [ - ":address", - ":base", - "//api/discovery:discovery", - "//api/cert:cert", - ], -) - -api_go_grpc_library( - name = "lds", - proto = ":lds", - deps = [ - ":address_go_proto", - ":base_go_proto", - "//api/discovery:discovery_go_grpc", - "//api/cert:cert_go_proto", - ], -) - api_proto_library( name = "metrics", srcs = ["metrics_service.proto"], @@ -173,27 +150,6 @@ api_go_grpc_library( proto = ":rls", ) -api_proto_library( - name = "rds", - srcs = ["rds.proto"], - has_services = 1, - deps = [ - "//api/auth:auth", - ":base", - "//api/discovery:discovery", - ], -) - -api_go_grpc_library( - name = "rds", - proto = ":rds", - deps = [ - "//api/auth:auth_go_proto", - ":base_go_proto", - "//api/discovery:discovery_go_grpc", - ], -) - api_proto_library( name = "stats", srcs = ["stats.proto"], @@ -226,16 +182,16 @@ proto_library( name = "api", deps = [ ":bootstrap", - ":lds", ":metrics", ":protocol", - ":rds", ":rls", "//api/cluster:circuit_breaker", "//api/cluster:cluster", "//api/cluster:outlier_detection", - "//api/discovery:eds", "//api/discovery:cds", + "//api/discovery:eds", + "//api/discovery:lds", + "//api/discovery:rds", "//api/filter/accesslog", "//api/filter/http:buffer", "//api/filter/http:ext_authz", @@ -253,5 +209,7 @@ proto_library( "//api/filter/network:rate_limit", "//api/filter/network:redis_proxy", "//api/filter/network:tcp_proxy", + "//api/listener:listener", + "//api/route:route", ], ) diff --git a/api/bootstrap.proto b/api/bootstrap.proto index 938d09040..13b169bbd 100644 --- a/api/bootstrap.proto +++ b/api/bootstrap.proto @@ -12,7 +12,7 @@ import "api/base.proto"; import "api/config_source.proto"; import "api/cluster/cluster.proto"; import "api/grpc_service.proto"; -import "api/lds.proto"; +import "api/listener/listener.proto"; import "api/cert/cert.proto"; import "api/stats.proto"; import "api/trace.proto"; @@ -31,7 +31,7 @@ message Bootstrap { message StaticResources { // Static :ref:`Listeners `. These listeners are // available regardless of LDS configuration. - repeated Listener listeners = 1; + repeated listener.Listener listeners = 1; // If a network based configuration source is specified for :ref:`cds_config // `, it's necessary diff --git a/api/discovery/BUILD b/api/discovery/BUILD index 6765c58d9..74ea704bf 100644 --- a/api/discovery/BUILD +++ b/api/discovery/BUILD @@ -56,6 +56,40 @@ api_go_grpc_library( ], ) +api_proto_library( + name = "lds", + srcs = ["lds.proto"], + has_services = 1, + deps = [ + ":discovery", + ], +) + +api_go_grpc_library( + name = "lds", + proto = ":lds", + deps = [ + ":discovery_go_grpc", + ], +) + +api_proto_library( + name = "rds", + srcs = ["rds.proto"], + has_services = 1, + deps = [ + ":discovery", + ], +) + +api_go_grpc_library( + name = "rds", + proto = ":rds", + deps = [ + ":discovery_go_grpc", + ], +) + api_proto_library( name = "sds", srcs = ["sds.proto"], diff --git a/api/discovery/lds.proto b/api/discovery/lds.proto new file mode 100644 index 000000000..0a5ba09d5 --- /dev/null +++ b/api/discovery/lds.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package envoy.api.v2.discovery; + +import "api/discovery/discovery.proto"; + +import "google/api/annotations.proto"; + +// The Envoy instance initiates an RPC at startup to discover a list of +// listeners. Updates are delivered via streaming from the LDS server and +// consist of a complete update of all listeners. Existing connections will be +// allowed to drain from listeners that are no longer present. +service ListenerDiscoveryService { + rpc StreamListeners(stream DiscoveryRequest) returns (stream DiscoveryResponse) { + } + + rpc FetchListeners(DiscoveryRequest) returns (DiscoveryResponse) { + option (google.api.http) = { + post: "/v2/discovery:listeners" + body: "*" + }; + } +} + diff --git a/api/discovery/rds.proto b/api/discovery/rds.proto new file mode 100644 index 000000000..09eb00144 --- /dev/null +++ b/api/discovery/rds.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package envoy.api.v2.discovery; + +import "api/discovery/discovery.proto"; + +import "google/api/annotations.proto"; + +// The resource_names field in DiscoveryRequest specifies a route configuration. +// This allows an Envoy configuration with multiple HTTP listeners (and +// associated HTTP connection manager filters) to use different route +// configurations. Each listener will bind its HTTP connection manager filter to +// a route table via this identifier. +service RouteDiscoveryService { + rpc StreamRoutes(stream DiscoveryRequest) returns (stream DiscoveryResponse) { + } + + rpc FetchRoutes(DiscoveryRequest) returns (DiscoveryResponse) { + option (google.api.http) = { + post: "/v2/discovery:routes" + body: "*" + }; + } +} + diff --git a/api/filter/http/BUILD b/api/filter/http/BUILD index 5cf22fd02..49cc91284 100644 --- a/api/filter/http/BUILD +++ b/api/filter/http/BUILD @@ -46,8 +46,8 @@ api_proto_library( name = "fault", srcs = ["fault.proto"], deps = [ - "//api:rds", "//api/filter:fault", + "//api/route:route", ], ) diff --git a/api/filter/http/fault.proto b/api/filter/http/fault.proto index d2cbf4181..fbbb79ef2 100644 --- a/api/filter/http/fault.proto +++ b/api/filter/http/fault.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package envoy.api.v2.filter.http; -import "api/rds.proto"; import "api/filter/fault.proto"; +import "api/route/route.proto"; import "validate/validate.proto"; @@ -46,7 +46,7 @@ message HTTPFault { // config. A match will happen if all the headers in the config are present in // the request with the same values (or based on presence if the *value* field // is not in the config). - repeated HeaderMatcher headers = 4; + repeated route.HeaderMatcher headers = 4; // Faults are injected for the specified list of downstream hosts. If this // setting is not set, faults are injected for all downstream nodes. diff --git a/api/filter/network/BUILD b/api/filter/network/BUILD index e87026ce0..d207cf964 100644 --- a/api/filter/network/BUILD +++ b/api/filter/network/BUILD @@ -9,8 +9,8 @@ api_proto_library( "//api:base", "//api:config_source", "//api:protocol", - "//api:rds", "//api/filter/accesslog", + "//api/route:route", ], ) diff --git a/api/filter/network/http_connection_manager.proto b/api/filter/network/http_connection_manager.proto index fc5e487d1..8d0abc1cb 100644 --- a/api/filter/network/http_connection_manager.proto +++ b/api/filter/network/http_connection_manager.proto @@ -6,8 +6,8 @@ option go_package = "network"; import "api/base.proto"; import "api/config_source.proto"; import "api/protocol.proto"; -import "api/rds.proto"; import "api/filter/accesslog/accesslog.proto"; +import "api/route/route.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; @@ -52,7 +52,7 @@ message HttpConnectionManager { Rds rds = 3; // The route table for the connection manager is static and is specified in this property. - RouteConfiguration route_config = 4; + route.RouteConfiguration route_config = 4; } // A list of individual HTTP filters that make up the filter chain for diff --git a/api/listener/BUILD b/api/listener/BUILD new file mode 100644 index 000000000..e62e20b79 --- /dev/null +++ b/api/listener/BUILD @@ -0,0 +1,23 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "listener", + srcs = ["listener.proto"], + deps = [ + "//api:address", + "//api:base", + "//api/cert:cert", + ], +) + +api_go_proto_library( + name = "listener", + proto = ":listener", + deps = [ + "//api:address_go_proto", + "//api:base_go_proto", + "//api/cert:cert_go_proto", + ], +) diff --git a/api/lds.proto b/api/listener/listener.proto similarity index 92% rename from api/lds.proto rename to api/listener/listener.proto index 3754eab55..cc057cabd 100644 --- a/api/lds.proto +++ b/api/listener/listener.proto @@ -1,13 +1,11 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.listener; import "api/address.proto"; import "api/base.proto"; -import "api/discovery/discovery.proto"; import "api/cert/cert.proto"; -import "google/api/annotations.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; @@ -16,22 +14,6 @@ import "validate/validate.proto"; // [#protodoc-title: Listeners and LDS] // Listener :ref:`configuration overview ` -// The Envoy instance initiates an RPC at startup to discover a list of -// listeners. Updates are delivered via streaming from the LDS server and -// consist of a complete update of all listeners. Existing connections will be -// allowed to drain from listeners that are no longer present. -service ListenerDiscoveryService { - rpc StreamListeners(stream discovery.DiscoveryRequest) returns (stream discovery.DiscoveryResponse) { - } - - rpc FetchListeners(discovery.DiscoveryRequest) returns (discovery.DiscoveryResponse) { - option (google.api.http) = { - post: "/v2/discovery:listeners" - body: "*" - }; - } -} - message Listener { // The unique name by which this listener is known. If no name is provided, // Envoy will allocate an internal UUID for the listener. If the listener is to be dynamically diff --git a/api/route/BUILD b/api/route/BUILD new file mode 100644 index 000000000..14ee13d0d --- /dev/null +++ b/api/route/BUILD @@ -0,0 +1,21 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "route", + srcs = ["route.proto"], + deps = [ + "//api:base", + "//api/auth:auth", + ], +) + +api_go_proto_library( + name = "route", + proto = ":route", + deps = [ + "//api:base_go_proto", + "//api/auth:auth_go_proto", + ], +) diff --git a/api/rds.proto b/api/route/route.proto similarity index 97% rename from api/rds.proto rename to api/route/route.proto index 71767ef6a..6d1d845db 100644 --- a/api/rds.proto +++ b/api/route/route.proto @@ -1,12 +1,10 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.route; -import "api/auth/auth.proto"; import "api/base.proto"; -import "api/discovery/discovery.proto"; +import "api/auth/auth.proto"; -import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; @@ -15,23 +13,6 @@ import "gogoproto/gogo.proto"; // [#protodoc-title: HTTP route management and RDS] -// The resource_names field in DiscoveryRequest specifies a route configuration. -// This allows an Envoy configuration with multiple HTTP listeners (and -// associated HTTP connection manager filters) to use different route -// configurations. Each listener will bind its HTTP connection manager filter to -// a route table via this identifier. -service RouteDiscoveryService { - rpc StreamRoutes(stream discovery.DiscoveryRequest) returns (stream discovery.DiscoveryResponse) { - } - - rpc FetchRoutes(discovery.DiscoveryRequest) returns (discovery.DiscoveryResponse) { - option (google.api.http) = { - post: "/v2/discovery:routes" - body: "*" - }; - } -} - // * Routing :ref:`architecture overview ` // * HTTP :ref:`router filter ` message RouteConfiguration { diff --git a/test/build/BUILD b/test/build/BUILD index 0f8331406..489d571a7 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -9,10 +9,10 @@ api_cc_test( "//api/discovery:cds", "//api/discovery:discovery", "//api/discovery:eds", + "//api/discovery:lds", + "//api/discovery:rds", "//api:hds", - "//api:lds", "//api:metrics", - "//api:rds", "//api:rls", "//api/filter/accesslog", ], @@ -30,9 +30,9 @@ api_go_test( "//api/discovery:discovery_go_grpc", "//api/discovery:eds_go_grpc", "//api/discovery:sds_go_grpc", + "//api/discovery:lds_go_grpc", + "//api/discovery:rds_go_grpc", "//api:hds_go_grpc", - "//api:lds_go_grpc", - "//api:rds_go_grpc", "//api:rls_go_grpc", ], ) diff --git a/test/build/build_test.cc b/test/build/build_test.cc index 7502fdbf0..8b1618cf1 100644 --- a/test/build/build_test.cc +++ b/test/build/build_test.cc @@ -12,13 +12,13 @@ int main(int argc, char* argv[]) { "envoy.api.v2.discovery.ClusterDiscoveryService.StreamClusters", "envoy.api.v2.discovery.EndpointDiscoveryService.FetchEndpoints", "envoy.api.v2.discovery.EndpointDiscoveryService.StreamEndpoints", + "envoy.api.v2.discovery.ListenerDiscoveryService.FetchListeners", + "envoy.api.v2.discovery.ListenerDiscoveryService.StreamListeners", + "envoy.api.v2.discovery.RouteDiscoveryService.FetchRoutes", + "envoy.api.v2.discovery.RouteDiscoveryService.StreamRoutes", "envoy.api.v2.HealthDiscoveryService.FetchHealthCheck", "envoy.api.v2.HealthDiscoveryService.StreamHealthCheck", - "envoy.api.v2.ListenerDiscoveryService.FetchListeners", - "envoy.api.v2.ListenerDiscoveryService.StreamListeners", "envoy.api.v2.MetricsService.StreamMetrics", - "envoy.api.v2.RouteDiscoveryService.FetchRoutes", - "envoy.api.v2.RouteDiscoveryService.StreamRoutes", "envoy.api.v2.RateLimitService.ShouldRateLimit", }; diff --git a/test/validate/BUILD b/test/validate/BUILD index da83b212b..5a87fba51 100644 --- a/test/validate/BUILD +++ b/test/validate/BUILD @@ -7,11 +7,11 @@ api_cc_test( srcs = ["pgv_test.cc"], proto_deps = [ "//api:bootstrap", + "//api:protocol", "//api/discovery:cds", "//api/discovery:eds", - "//api:lds", - "//api:protocol", - "//api:rds", + "//api/discovery:lds", + "//api/discovery:rds", "//api/filter/accesslog", "//api/filter/http:buffer", "//api/filter/http:fault", diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index c7439d7c7..bb49f95ec 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -7,9 +7,6 @@ #include "api/protocol.pb.validate.h" #include "api/cluster/cluster.pb.validate.h" #include "api/discovery/eds.pb.validate.h" -#include "api/lds.pb.validate.h" -#include "api/rds.pb.validate.h" -#include "api/rds.pb.validate.h" #include "api/filter/accesslog/accesslog.pb.validate.h" #include "api/filter/http/buffer.pb.validate.h" #include "api/filter/http/fault.pb.validate.h" @@ -22,6 +19,8 @@ #include "api/filter/network/mongo_proxy.pb.validate.h" #include "api/filter/network/redis_proxy.pb.validate.h" #include "api/filter/network/tcp_proxy.pb.validate.h" +#include "api/listener/listener.pb.validate.h" +#include "api/route/route.pb.validate.h" #include "google/protobuf/text_format.h" diff --git a/tools/BUILD b/tools/BUILD index 4f5c318fa..c17343dcc 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -6,7 +6,7 @@ py_binary( licenses = ["notice"], # Apache 2 visibility = ["//visibility:public"], deps = [ - "//api:lds_py", + "//api/listener:listener_py", "//api/filter/network:http_connection_manager_py", ], ) diff --git a/tools/generate_listeners.py b/tools/generate_listeners.py index 6e2393552..454c70661 100644 --- a/tools/generate_listeners.py +++ b/tools/generate_listeners.py @@ -16,7 +16,7 @@ from google.protobuf import struct_pb2 from google.protobuf import text_format -from api import lds_pb2 +from api.listener import listener_pb2 from api.filter.network import http_connection_manager_pb2 @@ -43,7 +43,7 @@ def ParseProto(path, filter_name): def GenerateListeners(listeners_pb_path, output_pb_path, output_json_path, fragments): - listener = lds_pb2.Listener() + listener = listener_pb2.Listener() with open(listeners_pb_path, 'r') as f: text_format.Merge(f.read(), listener) From 75703d151845b058d12af5b18c7665943dd4c453 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 16 Jan 2018 22:39:50 -0800 Subject: [PATCH 05/47] move bootstrap Signed-off-by: Kuat Yessenov --- api/BUILD | 38 +++-------------------------- api/bootstrap/BUILD | 37 ++++++++++++++++++++++++++++ api/{ => bootstrap}/bootstrap.proto | 0 test/build/BUILD | 2 +- test/validate/BUILD | 2 +- test/validate/pgv_test.cc | 2 +- 6 files changed, 43 insertions(+), 38 deletions(-) create mode 100644 api/bootstrap/BUILD rename api/{ => bootstrap}/bootstrap.proto (100%) diff --git a/api/BUILD b/api/BUILD index a5ee46411..76fe59af2 100644 --- a/api/BUILD +++ b/api/BUILD @@ -24,38 +24,6 @@ api_go_proto_library( deps = [":address_go_proto"], ) -api_proto_library( - name = "bootstrap", - srcs = ["bootstrap.proto"], - deps = [ - ":address", - ":base", - "//api/cluster:cluster", - ":config_source", - ":grpc_service", - "//api/listener:listener", - "//api/cert:cert", - ":stats", - ":trace", - ], -) - -api_go_proto_library( - name = "bootstrap", - proto = ":bootstrap", - deps = [ - ":address_go_proto", - ":base_go_proto", - "//api/cluster:cluster_go_proto", - ":config_source_go_proto", - ":grpc_service_go_proto", - "//api/listener:listener_go_proto", - "//api/cert:cert_go_proto", - ":stats_go_proto", - ":trace_go_proto", - ], -) - api_proto_library( name = "health_check", srcs = ["health_check.proto"], @@ -181,10 +149,10 @@ api_go_proto_library( proto_library( name = "api", deps = [ - ":bootstrap", ":metrics", ":protocol", ":rls", + "//api/bootstrap", "//api/cluster:circuit_breaker", "//api/cluster:cluster", "//api/cluster:outlier_detection", @@ -209,7 +177,7 @@ proto_library( "//api/filter/network:rate_limit", "//api/filter/network:redis_proxy", "//api/filter/network:tcp_proxy", - "//api/listener:listener", - "//api/route:route", + "//api/listener", + "//api/route", ], ) diff --git a/api/bootstrap/BUILD b/api/bootstrap/BUILD new file mode 100644 index 000000000..7963c594f --- /dev/null +++ b/api/bootstrap/BUILD @@ -0,0 +1,37 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "bootstrap", + srcs = ["bootstrap.proto"], + deps = [ + "//api:address", + "//api:base", + "//api:config_source", + "//api:grpc_service", + "//api:stats", + "//api:trace", + "//api/cluster:cluster", + "//api/listener:listener", + "//api/cert:cert", + ], +) + +api_go_proto_library( + name = "bootstrap", + proto = ":bootstrap", + deps = [ + "//api:address_go_proto", + "//api:base_go_proto", + "//api:config_source_go_proto", + "//api:grpc_service_go_proto", + "//api:stats_go_proto", + "//api:trace_go_proto", + "//api/cluster:cluster_go_proto", + "//api/listener:listener_go_proto", + "//api/cert:cert_go_proto", + ], +) + + diff --git a/api/bootstrap.proto b/api/bootstrap/bootstrap.proto similarity index 100% rename from api/bootstrap.proto rename to api/bootstrap/bootstrap.proto diff --git a/test/build/BUILD b/test/build/BUILD index 489d571a7..53852d0a1 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -24,7 +24,7 @@ api_go_test( srcs = ["go_build_test.go"], importpath = "go_build_test", deps = [ - "//api:bootstrap_go_proto", + "//api/bootstrap:bootstrap_go_proto", "//api/cert:cert_go_proto", "//api/discovery:cds_go_grpc", "//api/discovery:discovery_go_grpc", diff --git a/test/validate/BUILD b/test/validate/BUILD index 5a87fba51..7c91efaec 100644 --- a/test/validate/BUILD +++ b/test/validate/BUILD @@ -6,8 +6,8 @@ api_cc_test( name = "pgv_test", srcs = ["pgv_test.cc"], proto_deps = [ - "//api:bootstrap", "//api:protocol", + "//api/bootstrap", "//api/discovery:cds", "//api/discovery:eds", "//api/discovery:lds", diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index bb49f95ec..ed6586f69 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -3,8 +3,8 @@ // We don't use all the headers in the test below, but including them anyway as // a cheap way to get some C++ compiler sanity checking. -#include "api/bootstrap.pb.validate.h" #include "api/protocol.pb.validate.h" +#include "api/bootstrap/bootstrap.pb.validate.h" #include "api/cluster/cluster.pb.validate.h" #include "api/discovery/eds.pb.validate.h" #include "api/filter/accesslog/accesslog.pb.validate.h" From 0e9e75a47e4512ff39b41f475da3120fa5a32cec Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 16 Jan 2018 23:01:22 -0800 Subject: [PATCH 06/47] split ads Signed-off-by: Kuat Yessenov --- api/BUILD | 5 +- api/discovery/BUILD | 62 ++++++++++++++----- api/discovery/ads.proto | 20 ++++++ api/discovery/cds.proto | 2 +- .../{discovery.proto => common.proto} | 12 ---- api/discovery/eds.proto | 2 +- api/discovery/lds.proto | 2 +- api/discovery/rds.proto | 2 +- api/discovery/sds.proto | 2 +- bazel/api_build_system.bzl | 1 + test/build/BUILD | 14 ++--- test/build/go_build_test.go | 22 +++---- 12 files changed, 90 insertions(+), 56 deletions(-) create mode 100644 api/discovery/ads.proto rename api/discovery/{discovery.proto => common.proto} (85%) diff --git a/api/BUILD b/api/BUILD index 76fe59af2..0f6b228b1 100644 --- a/api/BUILD +++ b/api/BUILD @@ -156,10 +156,7 @@ proto_library( "//api/cluster:circuit_breaker", "//api/cluster:cluster", "//api/cluster:outlier_detection", - "//api/discovery:cds", - "//api/discovery:eds", - "//api/discovery:lds", - "//api/discovery:rds", + "//api/discovery", "//api/filter/accesslog", "//api/filter/http:buffer", "//api/filter/http:ext_authz", diff --git a/api/discovery/BUILD b/api/discovery/BUILD index 74ea704bf..659ee8869 100644 --- a/api/discovery/BUILD +++ b/api/discovery/BUILD @@ -2,25 +2,54 @@ load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library" licenses(["notice"]) # Apache 2 -api_proto_library( +proto_library( name = "discovery", - srcs = ["discovery.proto"], - has_services = 1, + deps = [ + ":ads", + ":cds", + ":common", + ":eds", + ":lds", + ":rds", + ], + visibility = ["//api:__pkg__"], +) + +api_proto_library( + name = "common", + srcs = ["common.proto"], deps = ["//api:base"], ) -api_go_grpc_library( - name = "discovery", - proto = ":discovery", +api_go_proto_library( + name = "common", + proto = ":common", deps = ["//api:base_go_proto"], ) +api_proto_library( + name = "ads", + srcs = ["ads.proto"], + has_services = 1, + deps = [ + ":common", + ], +) + +api_go_grpc_library( + name = "ads", + proto = ":ads", + deps = [ + ":common_go_proto", + ], +) + api_proto_library( name = "eds", srcs = ["eds.proto"], has_services = 1, deps = [ - ":discovery", + ":common", "//api:address", "//api:base", "//api:health_check", @@ -31,20 +60,19 @@ api_go_grpc_library( name = "eds", proto = ":eds", deps = [ - ":discovery_go_grpc", + ":common_go_proto", "//api:address_go_proto", "//api:base_go_proto", "//api:health_check_go_proto", ], ) - api_proto_library( name = "cds", srcs = ["cds.proto"], has_services = 1, deps = [ - ":discovery", + ":common", ], ) @@ -52,7 +80,7 @@ api_go_grpc_library( name = "cds", proto = ":cds", deps = [ - ":discovery_go_grpc", + ":common_go_proto", ], ) @@ -61,7 +89,7 @@ api_proto_library( srcs = ["lds.proto"], has_services = 1, deps = [ - ":discovery", + ":common", ], ) @@ -69,7 +97,7 @@ api_go_grpc_library( name = "lds", proto = ":lds", deps = [ - ":discovery_go_grpc", + ":common_go_proto", ], ) @@ -78,7 +106,7 @@ api_proto_library( srcs = ["rds.proto"], has_services = 1, deps = [ - ":discovery", + ":common", ], ) @@ -86,7 +114,7 @@ api_go_grpc_library( name = "rds", proto = ":rds", deps = [ - ":discovery_go_grpc", + ":common_go_proto", ], ) @@ -95,7 +123,7 @@ api_proto_library( srcs = ["sds.proto"], has_services = 1, deps = [ - ":discovery", + ":common", ], ) @@ -103,7 +131,7 @@ api_go_grpc_library( name = "sds", proto = ":sds", deps = [ - ":discovery_go_grpc", + ":common_go_proto", ], ) diff --git a/api/discovery/ads.proto b/api/discovery/ads.proto new file mode 100644 index 000000000..24a4b18bb --- /dev/null +++ b/api/discovery/ads.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package envoy.api.v2.discovery; + +import "api/discovery/common.proto"; + +import "google/protobuf/any.proto"; + +// See https://github.com/lyft/envoy-api#apis for a description of the role of +// ADS and how it is intended to be used by a management server. ADS requests +// have the same structure as their singleton xDS counterparts, but can +// multiplex many resource types on a single stream. The type_url in the +// DiscoveryRequest/DiscoveryResponse provides sufficient information to recover +// the multiplexed singleton APIs at the Envoy instance and management server. +service AggregatedDiscoveryService { + // This is a gRPC-only API. + rpc StreamAggregatedResources(stream DiscoveryRequest) returns (stream DiscoveryResponse) { + } +} + diff --git a/api/discovery/cds.proto b/api/discovery/cds.proto index 0020a2e61..8883f820f 100644 --- a/api/discovery/cds.proto +++ b/api/discovery/cds.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/discovery/discovery.proto"; +import "api/discovery/common.proto"; import "google/api/annotations.proto"; diff --git a/api/discovery/discovery.proto b/api/discovery/common.proto similarity index 85% rename from api/discovery/discovery.proto rename to api/discovery/common.proto index af7f766ac..b3b2e57f0 100644 --- a/api/discovery/discovery.proto +++ b/api/discovery/common.proto @@ -8,18 +8,6 @@ import "google/protobuf/any.proto"; // [#protodoc-title: Common discovery API components] -// See https://github.com/lyft/envoy-api#apis for a description of the role of -// ADS and how it is intended to be used by a management server. ADS requests -// have the same structure as their singleton xDS counterparts, but can -// multiplex many resource types on a single stream. The type_url in the -// DiscoveryRequest/DiscoveryResponse provides sufficient information to recover -// the multiplexed singleton APIs at the Envoy instance and management server. -service AggregatedDiscoveryService { - // This is a gRPC-only API. - rpc StreamAggregatedResources(stream DiscoveryRequest) returns (stream DiscoveryResponse) { - } -} - // A DiscoveryRequest requests a set of versioned resources of the same type for // a given Envoy node on some API. message DiscoveryRequest { diff --git a/api/discovery/eds.proto b/api/discovery/eds.proto index f81a8942a..684d0bbe6 100644 --- a/api/discovery/eds.proto +++ b/api/discovery/eds.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; import "api/base.proto"; -import "api/discovery/discovery.proto"; +import "api/discovery/common.proto"; import "api/health_check.proto"; import "google/api/annotations.proto"; diff --git a/api/discovery/lds.proto b/api/discovery/lds.proto index 0a5ba09d5..7fe55f1bc 100644 --- a/api/discovery/lds.proto +++ b/api/discovery/lds.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/discovery/discovery.proto"; +import "api/discovery/common.proto"; import "google/api/annotations.proto"; diff --git a/api/discovery/rds.proto b/api/discovery/rds.proto index 09eb00144..d9dadd311 100644 --- a/api/discovery/rds.proto +++ b/api/discovery/rds.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/discovery/discovery.proto"; +import "api/discovery/common.proto"; import "google/api/annotations.proto"; diff --git a/api/discovery/sds.proto b/api/discovery/sds.proto index 24b4e39d7..93422a057 100644 --- a/api/discovery/sds.proto +++ b/api/discovery/sds.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/discovery/discovery.proto"; +import "api/discovery/common.proto"; import "google/api/annotations.proto"; diff --git a/bazel/api_build_system.bzl b/bazel/api_build_system.bzl index 89a6ecb6d..a8c4bca82 100644 --- a/bazel/api_build_system.bzl +++ b/bazel/api_build_system.bzl @@ -51,6 +51,7 @@ def api_go_proto_library(name, proto, deps = []): "@com_github_golang_protobuf//ptypes/struct:go_default_library", "@com_github_golang_protobuf//ptypes/timestamp:go_default_library", "@com_github_golang_protobuf//ptypes/wrappers:go_default_library", + "@com_github_golang_protobuf//ptypes/any:go_default_library", "@com_lyft_protoc_gen_validate//validate:go_default_library", ] ) diff --git a/test/build/BUILD b/test/build/BUILD index 53852d0a1..888d178bd 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -6,14 +6,14 @@ api_cc_test( name = "build_test", srcs = ["build_test.cc"], proto_deps = [ + "//api:hds", + "//api:metrics", + "//api:rls", + "//api/discovery:ads", "//api/discovery:cds", - "//api/discovery:discovery", "//api/discovery:eds", "//api/discovery:lds", "//api/discovery:rds", - "//api:hds", - "//api:metrics", - "//api:rls", "//api/filter/accesslog", ], ) @@ -24,15 +24,15 @@ api_go_test( srcs = ["go_build_test.go"], importpath = "go_build_test", deps = [ + "//api:hds_go_grpc", + "//api:rls_go_grpc", "//api/bootstrap:bootstrap_go_proto", "//api/cert:cert_go_proto", + "//api/discovery:ads_go_grpc", "//api/discovery:cds_go_grpc", - "//api/discovery:discovery_go_grpc", "//api/discovery:eds_go_grpc", "//api/discovery:sds_go_grpc", "//api/discovery:lds_go_grpc", "//api/discovery:rds_go_grpc", - "//api:hds_go_grpc", - "//api:rls_go_grpc", ], ) diff --git a/test/build/go_build_test.go b/test/build/go_build_test.go index bd0daa7bd..0b4b5ad3d 100644 --- a/test/build/go_build_test.go +++ b/test/build/go_build_test.go @@ -1,18 +1,18 @@ package go_build_test import ( - "testing" - _ "github.com/envoyproxy/data-plane-api/api/bootstrap" - _ "github.com/envoyproxy/data-plane-api/api/discovery" - _ "github.com/envoyproxy/data-plane-api/api/cds" - _ "github.com/envoyproxy/data-plane-api/api/eds" - _ "github.com/envoyproxy/data-plane-api/api/hds" - _ "github.com/envoyproxy/data-plane-api/api/lds" - _ "github.com/envoyproxy/data-plane-api/api/rds" - _ "github.com/envoyproxy/data-plane-api/api/rls" - _ "github.com/envoyproxy/data-plane-api/api/sds" + "testing" + + _ "github.com/envoyproxy/data-plane-api/api/bootstrap" + _ "github.com/envoyproxy/data-plane-api/api/cds" + _ "github.com/envoyproxy/data-plane-api/api/eds" + _ "github.com/envoyproxy/data-plane-api/api/hds" + _ "github.com/envoyproxy/data-plane-api/api/lds" + _ "github.com/envoyproxy/data-plane-api/api/rds" + _ "github.com/envoyproxy/data-plane-api/api/rls" + _ "github.com/envoyproxy/data-plane-api/api/sds" ) func TestNoop(t *testing.T) { - // Noop test that verifies the successful importation of Envoy V2 API protos + // Noop test that verifies the successful importation of Envoy V2 API protos } From 51892eeee353245c9d52183b24d2742f17a498e5 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 16 Jan 2018 23:23:56 -0800 Subject: [PATCH 07/47] proto packages Signed-off-by: Kuat Yessenov --- api/BUILD | 22 +++------------------- api/bootstrap/BUILD | 4 ++-- api/cluster/BUILD | 16 +++++++++++++--- api/discovery/BUILD | 25 ++++++++++++------------- api/filter/http/BUILD | 16 ++++++++++++++++ api/filter/network/BUILD | 14 ++++++++++++++ 6 files changed, 60 insertions(+), 37 deletions(-) diff --git a/api/BUILD b/api/BUILD index 0f6b228b1..6b54fc619 100644 --- a/api/BUILD +++ b/api/BUILD @@ -153,27 +153,11 @@ proto_library( ":protocol", ":rls", "//api/bootstrap", - "//api/cluster:circuit_breaker", - "//api/cluster:cluster", - "//api/cluster:outlier_detection", + "//api/cluster", "//api/discovery", "//api/filter/accesslog", - "//api/filter/http:buffer", - "//api/filter/http:ext_authz", - "//api/filter/http:fault", - "//api/filter/http:health_check", - "//api/filter/http:lua", - "//api/filter/http:rate_limit", - "//api/filter/http:router", - "//api/filter/http:squash", - "//api/filter/http:transcoder", - "//api/filter/network:client_ssl_auth", - "//api/filter/network:ext_authz", - "//api/filter/network:http_connection_manager", - "//api/filter/network:mongo_proxy", - "//api/filter/network:rate_limit", - "//api/filter/network:redis_proxy", - "//api/filter/network:tcp_proxy", + "//api/filter/http", + "//api/filter/network", "//api/listener", "//api/route", ], diff --git a/api/bootstrap/BUILD b/api/bootstrap/BUILD index 7963c594f..af05a81a2 100644 --- a/api/bootstrap/BUILD +++ b/api/bootstrap/BUILD @@ -12,7 +12,7 @@ api_proto_library( "//api:grpc_service", "//api:stats", "//api:trace", - "//api/cluster:cluster", + "//api/cluster:cluster_def", "//api/listener:listener", "//api/cert:cert", ], @@ -28,7 +28,7 @@ api_go_proto_library( "//api:grpc_service_go_proto", "//api:stats_go_proto", "//api:trace_go_proto", - "//api/cluster:cluster_go_proto", + "//api/cluster:cluster_def_go_proto", "//api/listener:listener_go_proto", "//api/cert:cert_go_proto", ], diff --git a/api/cluster/BUILD b/api/cluster/BUILD index 384071ab7..e142c3005 100644 --- a/api/cluster/BUILD +++ b/api/cluster/BUILD @@ -29,7 +29,7 @@ api_go_proto_library( ) api_proto_library( - name = "cluster", + name = "cluster_def", srcs = ["cluster.proto"], deps = [ ":circuit_breaker", @@ -44,8 +44,8 @@ api_proto_library( ) api_go_proto_library( - name = "cluster", - proto = ":cluster", + name = "cluster_def", + proto = ":cluster_def", deps = [ ":circuit_breaker_go_proto", ":outlier_detection_go_proto", @@ -57,3 +57,13 @@ api_go_proto_library( "//api/cert:cert_go_proto", ], ) + +proto_library( + name = "cluster", + deps = [ + ":circuit_breaker", + ":cluster_def", + ":outlier_detection", + ], + visibility = ["//api:__pkg__"], +) diff --git a/api/discovery/BUILD b/api/discovery/BUILD index 659ee8869..818197d7e 100644 --- a/api/discovery/BUILD +++ b/api/discovery/BUILD @@ -2,19 +2,6 @@ load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library" licenses(["notice"]) # Apache 2 -proto_library( - name = "discovery", - deps = [ - ":ads", - ":cds", - ":common", - ":eds", - ":lds", - ":rds", - ], - visibility = ["//api:__pkg__"], -) - api_proto_library( name = "common", srcs = ["common.proto"], @@ -135,3 +122,15 @@ api_go_grpc_library( ], ) +proto_library( + name = "discovery", + deps = [ + ":ads", + ":cds", + ":common", + ":eds", + ":lds", + ":rds", + ], + visibility = ["//api:__pkg__"], +) diff --git a/api/filter/http/BUILD b/api/filter/http/BUILD index 49cc91284..f3d695d8f 100644 --- a/api/filter/http/BUILD +++ b/api/filter/http/BUILD @@ -66,3 +66,19 @@ api_proto_library( srcs = ["ext_authz.proto"], deps = ["//api:grpc_service"], ) + +proto_library( + name = "http", + deps = [ + ":buffer", + ":ext_authz", + ":fault", + ":health_check", + ":lua", + ":rate_limit", + ":router", + ":squash", + ":transcoder", + ], + visibility = ["//api:__pkg__"], +) diff --git a/api/filter/network/BUILD b/api/filter/network/BUILD index d207cf964..851194e0f 100644 --- a/api/filter/network/BUILD +++ b/api/filter/network/BUILD @@ -51,3 +51,17 @@ api_proto_library( srcs = ["ext_authz.proto"], deps = ["//api:grpc_service"], ) + +proto_library( + name = "network", + deps = [ + ":client_ssl_auth", + ":ext_authz", + ":http_connection_manager", + ":mongo_proxy", + ":rate_limit", + ":redis_proxy", + ":tcp_proxy", + ], + visibility = ["//api:__pkg__"], +) From a1b9ea9487cc1daec1b3772787abfa312accbb67 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 16 Jan 2018 23:38:20 -0800 Subject: [PATCH 08/47] format Signed-off-by: Kuat Yessenov --- api/auth/BUILD | 2 +- api/bootstrap/BUILD | 8 +++----- api/cluster/BUILD | 4 ++-- api/cluster/outlier_detection.proto | 1 - api/discovery/BUILD | 2 +- api/discovery/ads.proto | 1 - api/discovery/cds.proto | 1 - api/discovery/lds.proto | 1 - api/discovery/rds.proto | 1 - api/discovery/sds.proto | 1 - api/filter/http/BUILD | 4 ++-- api/filter/network/BUILD | 4 ++-- api/listener/BUILD | 2 +- api/route/BUILD | 2 +- test/build/BUILD | 2 +- tools/BUILD | 2 +- 16 files changed, 15 insertions(+), 23 deletions(-) diff --git a/api/auth/BUILD b/api/auth/BUILD index c3dac3431..a3d15c479 100644 --- a/api/auth/BUILD +++ b/api/auth/BUILD @@ -17,7 +17,7 @@ api_proto_library( name = "auth", srcs = ["auth.proto"], deps = [ - "//api/cert:cert", + "//api/cert", ], ) diff --git a/api/bootstrap/BUILD b/api/bootstrap/BUILD index af05a81a2..049cb6480 100644 --- a/api/bootstrap/BUILD +++ b/api/bootstrap/BUILD @@ -12,9 +12,9 @@ api_proto_library( "//api:grpc_service", "//api:stats", "//api:trace", + "//api/cert", "//api/cluster:cluster_def", - "//api/listener:listener", - "//api/cert:cert", + "//api/listener", ], ) @@ -28,10 +28,8 @@ api_go_proto_library( "//api:grpc_service_go_proto", "//api:stats_go_proto", "//api:trace_go_proto", + "//api/cert:cert_go_proto", "//api/cluster:cluster_def_go_proto", "//api/listener:listener_go_proto", - "//api/cert:cert_go_proto", ], ) - - diff --git a/api/cluster/BUILD b/api/cluster/BUILD index e142c3005..94e8292c8 100644 --- a/api/cluster/BUILD +++ b/api/cluster/BUILD @@ -39,7 +39,7 @@ api_proto_library( "//api:config_source", "//api:health_check", "//api:protocol", - "//api/cert:cert", + "//api/cert", ], ) @@ -60,10 +60,10 @@ api_go_proto_library( proto_library( name = "cluster", + visibility = ["//api:__pkg__"], deps = [ ":circuit_breaker", ":cluster_def", ":outlier_detection", ], - visibility = ["//api:__pkg__"], ) diff --git a/api/cluster/outlier_detection.proto b/api/cluster/outlier_detection.proto index d2beab170..ab85ae199 100644 --- a/api/cluster/outlier_detection.proto +++ b/api/cluster/outlier_detection.proto @@ -71,4 +71,3 @@ message OutlierDetection { google.protobuf.UInt32Value enforcing_consecutive_gateway_failure = 11 [(validate.rules).uint32.lte = 100]; } - diff --git a/api/discovery/BUILD b/api/discovery/BUILD index 818197d7e..b4026e0b9 100644 --- a/api/discovery/BUILD +++ b/api/discovery/BUILD @@ -124,6 +124,7 @@ api_go_grpc_library( proto_library( name = "discovery", + visibility = ["//api:__pkg__"], deps = [ ":ads", ":cds", @@ -132,5 +133,4 @@ proto_library( ":lds", ":rds", ], - visibility = ["//api:__pkg__"], ) diff --git a/api/discovery/ads.proto b/api/discovery/ads.proto index 24a4b18bb..02b29b694 100644 --- a/api/discovery/ads.proto +++ b/api/discovery/ads.proto @@ -17,4 +17,3 @@ service AggregatedDiscoveryService { rpc StreamAggregatedResources(stream DiscoveryRequest) returns (stream DiscoveryResponse) { } } - diff --git a/api/discovery/cds.proto b/api/discovery/cds.proto index 8883f820f..0041bd0f0 100644 --- a/api/discovery/cds.proto +++ b/api/discovery/cds.proto @@ -18,4 +18,3 @@ service ClusterDiscoveryService { }; } } - diff --git a/api/discovery/lds.proto b/api/discovery/lds.proto index 7fe55f1bc..83ca791a6 100644 --- a/api/discovery/lds.proto +++ b/api/discovery/lds.proto @@ -21,4 +21,3 @@ service ListenerDiscoveryService { }; } } - diff --git a/api/discovery/rds.proto b/api/discovery/rds.proto index d9dadd311..d8c2689d9 100644 --- a/api/discovery/rds.proto +++ b/api/discovery/rds.proto @@ -22,4 +22,3 @@ service RouteDiscoveryService { }; } } - diff --git a/api/discovery/sds.proto b/api/discovery/sds.proto index 93422a057..ac1b687a1 100644 --- a/api/discovery/sds.proto +++ b/api/discovery/sds.proto @@ -17,4 +17,3 @@ service SecretDiscoveryService { }; } } - diff --git a/api/filter/http/BUILD b/api/filter/http/BUILD index f3d695d8f..b2238e3b9 100644 --- a/api/filter/http/BUILD +++ b/api/filter/http/BUILD @@ -47,7 +47,7 @@ api_proto_library( srcs = ["fault.proto"], deps = [ "//api/filter:fault", - "//api/route:route", + "//api/route", ], ) @@ -69,6 +69,7 @@ api_proto_library( proto_library( name = "http", + visibility = ["//api:__pkg__"], deps = [ ":buffer", ":ext_authz", @@ -80,5 +81,4 @@ proto_library( ":squash", ":transcoder", ], - visibility = ["//api:__pkg__"], ) diff --git a/api/filter/network/BUILD b/api/filter/network/BUILD index 851194e0f..e8d563ef0 100644 --- a/api/filter/network/BUILD +++ b/api/filter/network/BUILD @@ -10,7 +10,7 @@ api_proto_library( "//api:config_source", "//api:protocol", "//api/filter/accesslog", - "//api/route:route", + "//api/route", ], ) @@ -54,6 +54,7 @@ api_proto_library( proto_library( name = "network", + visibility = ["//api:__pkg__"], deps = [ ":client_ssl_auth", ":ext_authz", @@ -63,5 +64,4 @@ proto_library( ":redis_proxy", ":tcp_proxy", ], - visibility = ["//api:__pkg__"], ) diff --git a/api/listener/BUILD b/api/listener/BUILD index e62e20b79..dc496fabf 100644 --- a/api/listener/BUILD +++ b/api/listener/BUILD @@ -8,7 +8,7 @@ api_proto_library( deps = [ "//api:address", "//api:base", - "//api/cert:cert", + "//api/cert", ], ) diff --git a/api/route/BUILD b/api/route/BUILD index 14ee13d0d..309c36b7c 100644 --- a/api/route/BUILD +++ b/api/route/BUILD @@ -7,7 +7,7 @@ api_proto_library( srcs = ["route.proto"], deps = [ "//api:base", - "//api/auth:auth", + "//api/auth", ], ) diff --git a/test/build/BUILD b/test/build/BUILD index 888d178bd..e5d203ae4 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -31,8 +31,8 @@ api_go_test( "//api/discovery:ads_go_grpc", "//api/discovery:cds_go_grpc", "//api/discovery:eds_go_grpc", - "//api/discovery:sds_go_grpc", "//api/discovery:lds_go_grpc", "//api/discovery:rds_go_grpc", + "//api/discovery:sds_go_grpc", ], ) diff --git a/tools/BUILD b/tools/BUILD index c17343dcc..731ed370d 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -6,8 +6,8 @@ py_binary( licenses = ["notice"], # Apache 2 visibility = ["//visibility:public"], deps = [ - "//api/listener:listener_py", "//api/filter/network:http_connection_manager_py", + "//api/listener:listener_py", ], ) From 60269895905aad41ab9c045bbda27e6a2508d09a Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 16 Jan 2018 23:53:38 -0800 Subject: [PATCH 09/47] add go_package annotations Signed-off-by: Kuat Yessenov --- api/bootstrap/bootstrap.proto | 3 ++- api/cert/cert.proto | 1 + api/cluster/cluster.proto | 1 + api/discovery/common.proto | 1 + api/listener/listener.proto | 1 + api/route/route.proto | 1 + test/validate/pgv_test.cc | 6 +++--- 7 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api/bootstrap/bootstrap.proto b/api/bootstrap/bootstrap.proto index 13b169bbd..f31248775 100644 --- a/api/bootstrap/bootstrap.proto +++ b/api/bootstrap/bootstrap.proto @@ -5,7 +5,8 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.bootstrap; +option go_package = "bootstrap"; import "api/address.proto"; import "api/base.proto"; diff --git a/api/cert/cert.proto b/api/cert/cert.proto index 784e6e060..a9280f2e5 100644 --- a/api/cert/cert.proto +++ b/api/cert/cert.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package envoy.api.v2.cert; +option go_package = "cert"; import "api/base.proto"; import "api/config_source.proto"; diff --git a/api/cluster/cluster.proto b/api/cluster/cluster.proto index 0d6d9f492..8978234b5 100644 --- a/api/cluster/cluster.proto +++ b/api/cluster/cluster.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package envoy.api.v2.cluster; +option go_package = "cluster"; import "api/address.proto"; import "api/base.proto"; diff --git a/api/discovery/common.proto b/api/discovery/common.proto index b3b2e57f0..4a714ce9d 100644 --- a/api/discovery/common.proto +++ b/api/discovery/common.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; +option go_package = "discovery"; import "api/base.proto"; diff --git a/api/listener/listener.proto b/api/listener/listener.proto index cc057cabd..0bf198f57 100644 --- a/api/listener/listener.proto +++ b/api/listener/listener.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package envoy.api.v2.listener; +option go_package = "listener"; import "api/address.proto"; import "api/base.proto"; diff --git a/api/route/route.proto b/api/route/route.proto index 6d1d845db..5d457e93e 100644 --- a/api/route/route.proto +++ b/api/route/route.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package envoy.api.v2.route; +option go_package = "route"; import "api/base.proto"; import "api/auth/auth.proto"; diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index ed6586f69..a7df8edd5 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -46,7 +46,7 @@ template struct TestCase { // Basic protoc-gen-validate C++ validation header inclusion and Validate calls // from data-plane-api. int main(int argc, char* argv[]) { - envoy::api::v2::Bootstrap invalid_bootstrap; + envoy::api::v2::bootstrap::Bootstrap invalid_bootstrap; // This is a baseline test of the validation features we care about. It's // probably not worth adding in every filter and field that we want to valid // in the API upfront, but as regressions occur, this is the place to add the @@ -59,12 +59,12 @@ int main(int argc, char* argv[]) { address {} } )EOF"; - envoy::api::v2::Bootstrap valid_bootstrap; + envoy::api::v2::bootstrap::Bootstrap valid_bootstrap; if (!google::protobuf::TextFormat::ParseFromString(valid_bootstrap_text, &valid_bootstrap)) { std::cerr << "Unable to parse text proto: " << valid_bootstrap_text << std::endl; exit(EXIT_FAILURE); } - TestCase{invalid_bootstrap, valid_bootstrap}.run(); + TestCase{invalid_bootstrap, valid_bootstrap}.run(); exit(EXIT_SUCCESS); } From 7ab2a902efe5c9880f46e3d206dd75bb5669e8cb Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 17 Jan 2018 11:49:14 -0800 Subject: [PATCH 10/47] move package to envoy/api/v2 Signed-off-by: Kuat Yessenov --- api/bootstrap/BUILD | 35 ----------------- {api => envoy/api/v2}/BUILD | 18 ++++----- {api => envoy/api/v2}/address.proto | 0 {api => envoy/api/v2}/auth/BUILD | 8 ++-- {api => envoy/api/v2}/auth/auth.proto | 2 +- .../api/v2}/auth/external_auth.proto | 2 +- {api => envoy/api/v2}/base.proto | 2 +- envoy/api/v2/bootstrap/BUILD | 35 +++++++++++++++++ .../api/v2}/bootstrap/bootstrap.proto | 18 ++++----- {api => envoy/api/v2}/cert/BUILD | 8 ++-- {api => envoy/api/v2}/cert/cert.proto | 4 +- {api => envoy/api/v2}/cluster/BUILD | 30 +++++++-------- .../api/v2}/cluster/circuit_breaker.proto | 2 +- {api => envoy/api/v2}/cluster/cluster.proto | 16 ++++---- .../api/v2}/cluster/outlier_detection.proto | 0 {api => envoy/api/v2}/config_source.proto | 2 +- {api => envoy/api/v2}/discovery/BUILD | 18 ++++----- {api => envoy/api/v2}/discovery/ads.proto | 2 +- {api => envoy/api/v2}/discovery/cds.proto | 2 +- {api => envoy/api/v2}/discovery/common.proto | 2 +- {api => envoy/api/v2}/discovery/eds.proto | 6 +-- {api => envoy/api/v2}/discovery/lds.proto | 2 +- {api => envoy/api/v2}/discovery/rds.proto | 2 +- {api => envoy/api/v2}/discovery/sds.proto | 2 +- {api => envoy/api/v2}/filter/BUILD | 0 {api => envoy/api/v2}/filter/README.md | 0 {api => envoy/api/v2}/filter/accesslog/BUILD | 6 +-- .../api/v2}/filter/accesslog/accesslog.proto | 6 +-- {api => envoy/api/v2}/filter/fault.proto | 0 {api => envoy/api/v2}/filter/http/BUILD | 14 +++---- .../api/v2}/filter/http/buffer.proto | 0 .../api/v2}/filter/http/ext_authz.proto | 2 +- {api => envoy/api/v2}/filter/http/fault.proto | 4 +- {api => envoy/api/v2}/filter/http/gzip.proto | 0 .../api/v2}/filter/http/health_check.proto | 2 +- .../api/v2}/filter/http/ip_tagging.proto | 2 +- {api => envoy/api/v2}/filter/http/lua.proto | 0 .../api/v2}/filter/http/rate_limit.proto | 0 .../api/v2}/filter/http/router.proto | 2 +- .../api/v2}/filter/http/squash.proto | 0 .../api/v2}/filter/http/transcoder.proto | 0 {api => envoy/api/v2}/filter/network/BUILD | 24 ++++++------ .../v2}/filter/network/client_ssl_auth.proto | 2 +- .../api/v2}/filter/network/ext_authz.proto | 2 +- .../network/http_connection_manager.proto | 10 ++--- .../api/v2}/filter/network/mongo_proxy.proto | 2 +- .../api/v2}/filter/network/rate_limit.proto | 2 +- .../api/v2}/filter/network/redis_proxy.proto | 0 .../api/v2}/filter/network/tcp_proxy.proto | 4 +- {api => envoy/api/v2}/grpc_service.proto | 2 +- {api => envoy/api/v2}/hds.proto | 4 +- {api => envoy/api/v2}/health_check.proto | 0 {api => envoy/api/v2}/listener/BUILD | 12 +++--- {api => envoy/api/v2}/listener/listener.proto | 6 +-- {api => envoy/api/v2}/metrics_service.proto | 4 +- {api => envoy/api/v2}/protocol.proto | 0 {api => envoy/api/v2}/rls.proto | 0 {api => envoy/api/v2}/route/BUILD | 8 ++-- {api => envoy/api/v2}/route/route.proto | 4 +- {api => envoy/api/v2}/stats.proto | 2 +- {api => envoy/api/v2}/trace.proto | 0 test/build/BUILD | 38 +++++++++---------- test/validate/BUILD | 36 +++++++++--------- test/validate/pgv_test.cc | 36 +++++++++--------- tools/BUILD | 4 +- tools/generate_listeners.py | 4 +- 66 files changed, 231 insertions(+), 231 deletions(-) delete mode 100644 api/bootstrap/BUILD rename {api => envoy/api/v2}/BUILD (86%) rename {api => envoy/api/v2}/address.proto (100%) rename {api => envoy/api/v2}/auth/BUILD (75%) rename {api => envoy/api/v2}/auth/auth.proto (96%) rename {api => envoy/api/v2}/auth/external_auth.proto (99%) rename {api => envoy/api/v2}/base.proto (99%) create mode 100644 envoy/api/v2/bootstrap/BUILD rename {api => envoy/api/v2}/bootstrap/bootstrap.proto (96%) rename {api => envoy/api/v2}/cert/BUILD (64%) rename {api => envoy/api/v2}/cert/cert.proto (99%) rename {api => envoy/api/v2}/cluster/BUILD (62%) rename {api => envoy/api/v2}/cluster/circuit_breaker.proto (98%) rename {api => envoy/api/v2}/cluster/cluster.proto (97%) rename {api => envoy/api/v2}/cluster/outlier_detection.proto (100%) rename {api => envoy/api/v2}/config_source.proto (98%) rename {api => envoy/api/v2}/discovery/BUILD (83%) rename {api => envoy/api/v2}/discovery/ads.proto (93%) rename {api => envoy/api/v2}/discovery/cds.proto (90%) rename {api => envoy/api/v2}/discovery/common.proto (99%) rename {api => envoy/api/v2}/discovery/eds.proto (98%) rename {api => envoy/api/v2}/discovery/lds.proto (93%) rename {api => envoy/api/v2}/discovery/rds.proto (93%) rename {api => envoy/api/v2}/discovery/sds.proto (89%) rename {api => envoy/api/v2}/filter/BUILD (100%) rename {api => envoy/api/v2}/filter/README.md (100%) rename {api => envoy/api/v2}/filter/accesslog/BUILD (63%) rename {api => envoy/api/v2}/filter/accesslog/accesslog.proto (99%) rename {api => envoy/api/v2}/filter/fault.proto (100%) rename {api => envoy/api/v2}/filter/http/BUILD (81%) rename {api => envoy/api/v2}/filter/http/buffer.proto (100%) rename {api => envoy/api/v2}/filter/http/ext_authz.proto (95%) rename {api => envoy/api/v2}/filter/http/fault.proto (96%) rename {api => envoy/api/v2}/filter/http/gzip.proto (100%) rename {api => envoy/api/v2}/filter/http/health_check.proto (97%) rename {api => envoy/api/v2}/filter/http/ip_tagging.proto (96%) rename {api => envoy/api/v2}/filter/http/lua.proto (100%) rename {api => envoy/api/v2}/filter/http/rate_limit.proto (100%) rename {api => envoy/api/v2}/filter/http/router.proto (94%) rename {api => envoy/api/v2}/filter/http/squash.proto (100%) rename {api => envoy/api/v2}/filter/http/transcoder.proto (100%) rename {api => envoy/api/v2}/filter/network/BUILD (67%) rename {api => envoy/api/v2}/filter/network/client_ssl_auth.proto (97%) rename {api => envoy/api/v2}/filter/network/ext_authz.proto (95%) rename {api => envoy/api/v2}/filter/network/http_connection_manager.proto (97%) rename {api => envoy/api/v2}/filter/network/mongo_proxy.proto (95%) rename {api => envoy/api/v2}/filter/network/rate_limit.proto (96%) rename {api => envoy/api/v2}/filter/network/redis_proxy.proto (100%) rename {api => envoy/api/v2}/filter/network/tcp_proxy.proto (98%) rename {api => envoy/api/v2}/grpc_service.proto (98%) rename {api => envoy/api/v2}/hds.proto (98%) rename {api => envoy/api/v2}/health_check.proto (100%) rename {api => envoy/api/v2}/listener/BUILD (57%) rename {api => envoy/api/v2}/listener/listener.proto (98%) rename {api => envoy/api/v2}/metrics_service.proto (95%) rename {api => envoy/api/v2}/protocol.proto (100%) rename {api => envoy/api/v2}/rls.proto (100%) rename {api => envoy/api/v2}/route/BUILD (66%) rename {api => envoy/api/v2}/route/route.proto (99%) rename {api => envoy/api/v2}/stats.proto (99%) rename {api => envoy/api/v2}/trace.proto (100%) diff --git a/api/bootstrap/BUILD b/api/bootstrap/BUILD deleted file mode 100644 index 049cb6480..000000000 --- a/api/bootstrap/BUILD +++ /dev/null @@ -1,35 +0,0 @@ -load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") - -licenses(["notice"]) # Apache 2 - -api_proto_library( - name = "bootstrap", - srcs = ["bootstrap.proto"], - deps = [ - "//api:address", - "//api:base", - "//api:config_source", - "//api:grpc_service", - "//api:stats", - "//api:trace", - "//api/cert", - "//api/cluster:cluster_def", - "//api/listener", - ], -) - -api_go_proto_library( - name = "bootstrap", - proto = ":bootstrap", - deps = [ - "//api:address_go_proto", - "//api:base_go_proto", - "//api:config_source_go_proto", - "//api:grpc_service_go_proto", - "//api:stats_go_proto", - "//api:trace_go_proto", - "//api/cert:cert_go_proto", - "//api/cluster:cluster_def_go_proto", - "//api/listener:listener_go_proto", - ], -) diff --git a/api/BUILD b/envoy/api/v2/BUILD similarity index 86% rename from api/BUILD rename to envoy/api/v2/BUILD index 6b54fc619..77f8ca81c 100644 --- a/api/BUILD +++ b/envoy/api/v2/BUILD @@ -145,20 +145,20 @@ api_go_proto_library( ) # TODO(htuch): Grow this to cover everything we want to generate docs for, so we can just invoke -# bazel build //api --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst +# bazel build //envoy/api/v2 --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst proto_library( name = "api", deps = [ ":metrics", ":protocol", ":rls", - "//api/bootstrap", - "//api/cluster", - "//api/discovery", - "//api/filter/accesslog", - "//api/filter/http", - "//api/filter/network", - "//api/listener", - "//api/route", + "//envoy/api/v2/bootstrap", + "//envoy/api/v2/cluster", + "//envoy/api/v2/discovery", + "//envoy/api/v2/filter/accesslog", + "//envoy/api/v2/filter/http", + "//envoy/api/v2/filter/network", + "//envoy/api/v2/listener", + "//envoy/api/v2/route", ], ) diff --git a/api/address.proto b/envoy/api/v2/address.proto similarity index 100% rename from api/address.proto rename to envoy/api/v2/address.proto diff --git a/api/auth/BUILD b/envoy/api/v2/auth/BUILD similarity index 75% rename from api/auth/BUILD rename to envoy/api/v2/auth/BUILD index a3d15c479..cafc647fe 100644 --- a/api/auth/BUILD +++ b/envoy/api/v2/auth/BUILD @@ -9,7 +9,7 @@ api_proto_library( ], has_services = 1, deps = [ - "//api:address", + "//envoy/api/v2:address", ], ) @@ -17,7 +17,7 @@ api_proto_library( name = "auth", srcs = ["auth.proto"], deps = [ - "//api/cert", + "//envoy/api/v2/cert", ], ) @@ -25,8 +25,8 @@ api_go_proto_library( name = "auth", proto = ":auth", deps = [ - "//api:address_go_proto", - "//api/cert:cert_go_proto", + "//envoy/api/v2:address_go_proto", + "//envoy/api/v2/cert:cert_go_proto", "@googleapis//:rpc_status_go_proto", ], ) diff --git a/api/auth/auth.proto b/envoy/api/v2/auth/auth.proto similarity index 96% rename from api/auth/auth.proto rename to envoy/api/v2/auth/auth.proto index c8fe6bc7c..d946e6411 100644 --- a/api/auth/auth.proto +++ b/envoy/api/v2/auth/auth.proto @@ -4,7 +4,7 @@ syntax = "proto3"; package envoy.api.v2.auth; -import "api/cert/cert.proto"; +import "envoy/api/v2/cert/cert.proto"; message AuthAction { // Should we do white-list or black-list style access control. diff --git a/api/auth/external_auth.proto b/envoy/api/v2/auth/external_auth.proto similarity index 99% rename from api/auth/external_auth.proto rename to envoy/api/v2/auth/external_auth.proto index 967fb849c..27eaf9c74 100644 --- a/api/auth/external_auth.proto +++ b/envoy/api/v2/auth/external_auth.proto @@ -6,7 +6,7 @@ package envoy.api.v2.auth; option go_package = "auth"; -import "api/address.proto"; +import "envoy/api/v2/address.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; diff --git a/api/base.proto b/envoy/api/v2/base.proto similarity index 99% rename from api/base.proto rename to envoy/api/v2/base.proto index 72c66337e..a719798f0 100644 --- a/api/base.proto +++ b/envoy/api/v2/base.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package envoy.api.v2; option go_package = "api"; -import "api/address.proto"; +import "envoy/api/v2/address.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; diff --git a/envoy/api/v2/bootstrap/BUILD b/envoy/api/v2/bootstrap/BUILD new file mode 100644 index 000000000..8f94352ed --- /dev/null +++ b/envoy/api/v2/bootstrap/BUILD @@ -0,0 +1,35 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "bootstrap", + srcs = ["bootstrap.proto"], + deps = [ + "//envoy/api/v2:address", + "//envoy/api/v2:base", + "//envoy/api/v2:config_source", + "//envoy/api/v2:grpc_service", + "//envoy/api/v2:stats", + "//envoy/api/v2:trace", + "//envoy/api/v2/cert", + "//envoy/api/v2/cluster:cluster_def", + "//envoy/api/v2/listener", + ], +) + +api_go_proto_library( + name = "bootstrap", + proto = ":bootstrap", + deps = [ + "//envoy/api/v2:address_go_proto", + "//envoy/api/v2:base_go_proto", + "//envoy/api/v2:config_source_go_proto", + "//envoy/api/v2:grpc_service_go_proto", + "//envoy/api/v2:stats_go_proto", + "//envoy/api/v2:trace_go_proto", + "//envoy/api/v2/cert:cert_go_proto", + "//envoy/api/v2/cluster:cluster_def_go_proto", + "//envoy/api/v2/listener:listener_go_proto", + ], +) diff --git a/api/bootstrap/bootstrap.proto b/envoy/api/v2/bootstrap/bootstrap.proto similarity index 96% rename from api/bootstrap/bootstrap.proto rename to envoy/api/v2/bootstrap/bootstrap.proto index f31248775..d90153306 100644 --- a/api/bootstrap/bootstrap.proto +++ b/envoy/api/v2/bootstrap/bootstrap.proto @@ -8,15 +8,15 @@ syntax = "proto3"; package envoy.api.v2.bootstrap; option go_package = "bootstrap"; -import "api/address.proto"; -import "api/base.proto"; -import "api/config_source.proto"; -import "api/cluster/cluster.proto"; -import "api/grpc_service.proto"; -import "api/listener/listener.proto"; -import "api/cert/cert.proto"; -import "api/stats.proto"; -import "api/trace.proto"; +import "envoy/api/v2/address.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/config_source.proto"; +import "envoy/api/v2/cluster/cluster.proto"; +import "envoy/api/v2/grpc_service.proto"; +import "envoy/api/v2/listener/listener.proto"; +import "envoy/api/v2/cert/cert.proto"; +import "envoy/api/v2/stats.proto"; +import "envoy/api/v2/trace.proto"; import "google/protobuf/duration.proto"; diff --git a/api/cert/BUILD b/envoy/api/v2/cert/BUILD similarity index 64% rename from api/cert/BUILD rename to envoy/api/v2/cert/BUILD index 86e021ef5..eabb72808 100644 --- a/api/cert/BUILD +++ b/envoy/api/v2/cert/BUILD @@ -6,8 +6,8 @@ api_proto_library( name = "cert", srcs = ["cert.proto"], deps = [ - "//api:base", - "//api:config_source", + "//envoy/api/v2:base", + "//envoy/api/v2:config_source", ], ) @@ -15,7 +15,7 @@ api_go_proto_library( name = "cert", proto = ":cert", deps = [ - "//api:base_go_proto", - "//api:config_source_go_proto", + "//envoy/api/v2:base_go_proto", + "//envoy/api/v2:config_source_go_proto", ], ) diff --git a/api/cert/cert.proto b/envoy/api/v2/cert/cert.proto similarity index 99% rename from api/cert/cert.proto rename to envoy/api/v2/cert/cert.proto index a9280f2e5..3a5524510 100644 --- a/api/cert/cert.proto +++ b/envoy/api/v2/cert/cert.proto @@ -3,8 +3,8 @@ syntax = "proto3"; package envoy.api.v2.cert; option go_package = "cert"; -import "api/base.proto"; -import "api/config_source.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/config_source.proto"; import "google/protobuf/wrappers.proto"; diff --git a/api/cluster/BUILD b/envoy/api/v2/cluster/BUILD similarity index 62% rename from api/cluster/BUILD rename to envoy/api/v2/cluster/BUILD index 94e8292c8..7ed304f65 100644 --- a/api/cluster/BUILD +++ b/envoy/api/v2/cluster/BUILD @@ -6,7 +6,7 @@ api_proto_library( name = "circuit_breaker", srcs = ["circuit_breaker.proto"], deps = [ - "//api:base", + "//envoy/api/v2:base", ], ) @@ -14,7 +14,7 @@ api_go_proto_library( name = "circuit_breaker", proto = ":circuit_breaker", deps = [ - "//api:base_go_proto", + "//envoy/api/v2:base_go_proto", ], ) @@ -34,12 +34,12 @@ api_proto_library( deps = [ ":circuit_breaker", ":outlier_detection", - "//api:address", - "//api:base", - "//api:config_source", - "//api:health_check", - "//api:protocol", - "//api/cert", + "//envoy/api/v2:address", + "//envoy/api/v2:base", + "//envoy/api/v2:config_source", + "//envoy/api/v2:health_check", + "//envoy/api/v2:protocol", + "//envoy/api/v2/cert", ], ) @@ -49,18 +49,18 @@ api_go_proto_library( deps = [ ":circuit_breaker_go_proto", ":outlier_detection_go_proto", - "//api:address_go_proto", - "//api:base_go_proto", - "//api:config_source_go_proto", - "//api:health_check_go_proto", - "//api:protocol_go_proto", - "//api/cert:cert_go_proto", + "//envoy/api/v2:address_go_proto", + "//envoy/api/v2:base_go_proto", + "//envoy/api/v2:config_source_go_proto", + "//envoy/api/v2:health_check_go_proto", + "//envoy/api/v2:protocol_go_proto", + "//envoy/api/v2/cert:cert_go_proto", ], ) proto_library( name = "cluster", - visibility = ["//api:__pkg__"], + visibility = ["//envoy/api/v2:__pkg__"], deps = [ ":circuit_breaker", ":cluster_def", diff --git a/api/cluster/circuit_breaker.proto b/envoy/api/v2/cluster/circuit_breaker.proto similarity index 98% rename from api/cluster/circuit_breaker.proto rename to envoy/api/v2/cluster/circuit_breaker.proto index 369bc5d5e..376f8a605 100644 --- a/api/cluster/circuit_breaker.proto +++ b/envoy/api/v2/cluster/circuit_breaker.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.cluster; -import "api/base.proto"; +import "envoy/api/v2/base.proto"; import "google/protobuf/wrappers.proto"; diff --git a/api/cluster/cluster.proto b/envoy/api/v2/cluster/cluster.proto similarity index 97% rename from api/cluster/cluster.proto rename to envoy/api/v2/cluster/cluster.proto index 8978234b5..b14b8a8ad 100644 --- a/api/cluster/cluster.proto +++ b/envoy/api/v2/cluster/cluster.proto @@ -3,14 +3,14 @@ syntax = "proto3"; package envoy.api.v2.cluster; option go_package = "cluster"; -import "api/address.proto"; -import "api/base.proto"; -import "api/config_source.proto"; -import "api/health_check.proto"; -import "api/protocol.proto"; -import "api/cert/cert.proto"; -import "api/cluster/circuit_breaker.proto"; -import "api/cluster/outlier_detection.proto"; +import "envoy/api/v2/address.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/config_source.proto"; +import "envoy/api/v2/health_check.proto"; +import "envoy/api/v2/protocol.proto"; +import "envoy/api/v2/cert/cert.proto"; +import "envoy/api/v2/cluster/circuit_breaker.proto"; +import "envoy/api/v2/cluster/outlier_detection.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; diff --git a/api/cluster/outlier_detection.proto b/envoy/api/v2/cluster/outlier_detection.proto similarity index 100% rename from api/cluster/outlier_detection.proto rename to envoy/api/v2/cluster/outlier_detection.proto diff --git a/api/config_source.proto b/envoy/api/v2/config_source.proto similarity index 98% rename from api/config_source.proto rename to envoy/api/v2/config_source.proto index d8d6b4057..6c8e5e60d 100644 --- a/api/config_source.proto +++ b/envoy/api/v2/config_source.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2; -import "api/grpc_service.proto"; +import "envoy/api/v2/grpc_service.proto"; import "google/protobuf/duration.proto"; diff --git a/api/discovery/BUILD b/envoy/api/v2/discovery/BUILD similarity index 83% rename from api/discovery/BUILD rename to envoy/api/v2/discovery/BUILD index b4026e0b9..70e81bb73 100644 --- a/api/discovery/BUILD +++ b/envoy/api/v2/discovery/BUILD @@ -5,13 +5,13 @@ licenses(["notice"]) # Apache 2 api_proto_library( name = "common", srcs = ["common.proto"], - deps = ["//api:base"], + deps = ["//envoy/api/v2:base"], ) api_go_proto_library( name = "common", proto = ":common", - deps = ["//api:base_go_proto"], + deps = ["//envoy/api/v2:base_go_proto"], ) api_proto_library( @@ -37,9 +37,9 @@ api_proto_library( has_services = 1, deps = [ ":common", - "//api:address", - "//api:base", - "//api:health_check", + "//envoy/api/v2:address", + "//envoy/api/v2:base", + "//envoy/api/v2:health_check", ], ) @@ -48,9 +48,9 @@ api_go_grpc_library( proto = ":eds", deps = [ ":common_go_proto", - "//api:address_go_proto", - "//api:base_go_proto", - "//api:health_check_go_proto", + "//envoy/api/v2:address_go_proto", + "//envoy/api/v2:base_go_proto", + "//envoy/api/v2:health_check_go_proto", ], ) @@ -124,7 +124,7 @@ api_go_grpc_library( proto_library( name = "discovery", - visibility = ["//api:__pkg__"], + visibility = ["//envoy/api/v2:__pkg__"], deps = [ ":ads", ":cds", diff --git a/api/discovery/ads.proto b/envoy/api/v2/discovery/ads.proto similarity index 93% rename from api/discovery/ads.proto rename to envoy/api/v2/discovery/ads.proto index 02b29b694..5d76ceef8 100644 --- a/api/discovery/ads.proto +++ b/envoy/api/v2/discovery/ads.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/discovery/common.proto"; +import "envoy/api/v2/discovery/common.proto"; import "google/protobuf/any.proto"; diff --git a/api/discovery/cds.proto b/envoy/api/v2/discovery/cds.proto similarity index 90% rename from api/discovery/cds.proto rename to envoy/api/v2/discovery/cds.proto index 0041bd0f0..320573634 100644 --- a/api/discovery/cds.proto +++ b/envoy/api/v2/discovery/cds.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/discovery/common.proto"; +import "envoy/api/v2/discovery/common.proto"; import "google/api/annotations.proto"; diff --git a/api/discovery/common.proto b/envoy/api/v2/discovery/common.proto similarity index 99% rename from api/discovery/common.proto rename to envoy/api/v2/discovery/common.proto index 4a714ce9d..48b8c66a8 100644 --- a/api/discovery/common.proto +++ b/envoy/api/v2/discovery/common.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; option go_package = "discovery"; -import "api/base.proto"; +import "envoy/api/v2/base.proto"; import "google/protobuf/any.proto"; diff --git a/api/discovery/eds.proto b/envoy/api/v2/discovery/eds.proto similarity index 98% rename from api/discovery/eds.proto rename to envoy/api/v2/discovery/eds.proto index 684d0bbe6..310414466 100644 --- a/api/discovery/eds.proto +++ b/envoy/api/v2/discovery/eds.proto @@ -2,9 +2,9 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/base.proto"; -import "api/discovery/common.proto"; -import "api/health_check.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/discovery/common.proto"; +import "envoy/api/v2/health_check.proto"; import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; diff --git a/api/discovery/lds.proto b/envoy/api/v2/discovery/lds.proto similarity index 93% rename from api/discovery/lds.proto rename to envoy/api/v2/discovery/lds.proto index 83ca791a6..19cbb8899 100644 --- a/api/discovery/lds.proto +++ b/envoy/api/v2/discovery/lds.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/discovery/common.proto"; +import "envoy/api/v2/discovery/common.proto"; import "google/api/annotations.proto"; diff --git a/api/discovery/rds.proto b/envoy/api/v2/discovery/rds.proto similarity index 93% rename from api/discovery/rds.proto rename to envoy/api/v2/discovery/rds.proto index d8c2689d9..aa3340fd2 100644 --- a/api/discovery/rds.proto +++ b/envoy/api/v2/discovery/rds.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/discovery/common.proto"; +import "envoy/api/v2/discovery/common.proto"; import "google/api/annotations.proto"; diff --git a/api/discovery/sds.proto b/envoy/api/v2/discovery/sds.proto similarity index 89% rename from api/discovery/sds.proto rename to envoy/api/v2/discovery/sds.proto index ac1b687a1..73763b065 100644 --- a/api/discovery/sds.proto +++ b/envoy/api/v2/discovery/sds.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.discovery; -import "api/discovery/common.proto"; +import "envoy/api/v2/discovery/common.proto"; import "google/api/annotations.proto"; diff --git a/api/filter/BUILD b/envoy/api/v2/filter/BUILD similarity index 100% rename from api/filter/BUILD rename to envoy/api/v2/filter/BUILD diff --git a/api/filter/README.md b/envoy/api/v2/filter/README.md similarity index 100% rename from api/filter/README.md rename to envoy/api/v2/filter/README.md diff --git a/api/filter/accesslog/BUILD b/envoy/api/v2/filter/accesslog/BUILD similarity index 63% rename from api/filter/accesslog/BUILD rename to envoy/api/v2/filter/accesslog/BUILD index e15f36a1c..8adfb5c19 100644 --- a/api/filter/accesslog/BUILD +++ b/envoy/api/v2/filter/accesslog/BUILD @@ -5,8 +5,8 @@ api_proto_library( srcs = ["accesslog.proto"], has_services = 1, deps = [ - "//api:address", - "//api:base", - "//api:grpc_service", + "//envoy/api/v2:address", + "//envoy/api/v2:base", + "//envoy/api/v2:grpc_service", ], ) diff --git a/api/filter/accesslog/accesslog.proto b/envoy/api/v2/filter/accesslog/accesslog.proto similarity index 99% rename from api/filter/accesslog/accesslog.proto rename to envoy/api/v2/filter/accesslog/accesslog.proto index f21b25b15..265a44868 100644 --- a/api/filter/accesslog/accesslog.proto +++ b/envoy/api/v2/filter/accesslog/accesslog.proto @@ -3,9 +3,9 @@ syntax = "proto3"; package envoy.api.v2.filter.accesslog; option go_package = "accesslog"; -import "api/address.proto"; -import "api/base.proto"; -import "api/grpc_service.proto"; +import "envoy/api/v2/address.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/grpc_service.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; diff --git a/api/filter/fault.proto b/envoy/api/v2/filter/fault.proto similarity index 100% rename from api/filter/fault.proto rename to envoy/api/v2/filter/fault.proto diff --git a/api/filter/http/BUILD b/envoy/api/v2/filter/http/BUILD similarity index 81% rename from api/filter/http/BUILD rename to envoy/api/v2/filter/http/BUILD index b2238e3b9..1de84c047 100644 --- a/api/filter/http/BUILD +++ b/envoy/api/v2/filter/http/BUILD @@ -5,7 +5,7 @@ licenses(["notice"]) # Apache 2 api_proto_library( name = "router", srcs = ["router.proto"], - deps = ["//api/filter/accesslog"], + deps = ["//envoy/api/v2/filter/accesslog"], ) api_proto_library( @@ -31,14 +31,14 @@ api_proto_library( api_proto_library( name = "ip_tagging", srcs = ["ip_tagging.proto"], - deps = ["//api:address"], + deps = ["//envoy/api/v2:address"], ) api_proto_library( name = "health_check", srcs = ["health_check.proto"], deps = [ - "//api:base", + "//envoy/api/v2:base", ], ) @@ -46,8 +46,8 @@ api_proto_library( name = "fault", srcs = ["fault.proto"], deps = [ - "//api/filter:fault", - "//api/route", + "//envoy/api/v2/filter:fault", + "//envoy/api/v2/route", ], ) @@ -64,12 +64,12 @@ api_proto_library( api_proto_library( name = "ext_authz", srcs = ["ext_authz.proto"], - deps = ["//api:grpc_service"], + deps = ["//envoy/api/v2:grpc_service"], ) proto_library( name = "http", - visibility = ["//api:__pkg__"], + visibility = ["//envoy/api/v2:__pkg__"], deps = [ ":buffer", ":ext_authz", diff --git a/api/filter/http/buffer.proto b/envoy/api/v2/filter/http/buffer.proto similarity index 100% rename from api/filter/http/buffer.proto rename to envoy/api/v2/filter/http/buffer.proto diff --git a/api/filter/http/ext_authz.proto b/envoy/api/v2/filter/http/ext_authz.proto similarity index 95% rename from api/filter/http/ext_authz.proto rename to envoy/api/v2/filter/http/ext_authz.proto index 807127db6..e741a25b2 100644 --- a/api/filter/http/ext_authz.proto +++ b/envoy/api/v2/filter/http/ext_authz.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.filter.http; -import "api/grpc_service.proto"; +import "envoy/api/v2/grpc_service.proto"; import "validate/validate.proto"; diff --git a/api/filter/http/fault.proto b/envoy/api/v2/filter/http/fault.proto similarity index 96% rename from api/filter/http/fault.proto rename to envoy/api/v2/filter/http/fault.proto index fbbb79ef2..ca08be14a 100644 --- a/api/filter/http/fault.proto +++ b/envoy/api/v2/filter/http/fault.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package envoy.api.v2.filter.http; -import "api/filter/fault.proto"; -import "api/route/route.proto"; +import "envoy/api/v2/filter/fault.proto"; +import "envoy/api/v2/route/route.proto"; import "validate/validate.proto"; diff --git a/api/filter/http/gzip.proto b/envoy/api/v2/filter/http/gzip.proto similarity index 100% rename from api/filter/http/gzip.proto rename to envoy/api/v2/filter/http/gzip.proto diff --git a/api/filter/http/health_check.proto b/envoy/api/v2/filter/http/health_check.proto similarity index 97% rename from api/filter/http/health_check.proto rename to envoy/api/v2/filter/http/health_check.proto index fa8530cb8..4f3faed8c 100644 --- a/api/filter/http/health_check.proto +++ b/envoy/api/v2/filter/http/health_check.proto @@ -5,7 +5,7 @@ package envoy.api.v2.filter.http; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "api/base.proto"; +import "envoy/api/v2/base.proto"; import "validate/validate.proto"; // [#protodoc-title: Health check] diff --git a/api/filter/http/ip_tagging.proto b/envoy/api/v2/filter/http/ip_tagging.proto similarity index 96% rename from api/filter/http/ip_tagging.proto rename to envoy/api/v2/filter/http/ip_tagging.proto index dcfd6cd98..d7a1f5d0a 100644 --- a/api/filter/http/ip_tagging.proto +++ b/envoy/api/v2/filter/http/ip_tagging.proto @@ -4,7 +4,7 @@ syntax = "proto3"; package envoy.api.v2.filter.http; -import "api/address.proto"; +import "envoy/api/v2/address.proto"; // This is an HTTP filter which enables Envoy to tag requests with extra // information such as location, cloud source, and any extra data. This is diff --git a/api/filter/http/lua.proto b/envoy/api/v2/filter/http/lua.proto similarity index 100% rename from api/filter/http/lua.proto rename to envoy/api/v2/filter/http/lua.proto diff --git a/api/filter/http/rate_limit.proto b/envoy/api/v2/filter/http/rate_limit.proto similarity index 100% rename from api/filter/http/rate_limit.proto rename to envoy/api/v2/filter/http/rate_limit.proto diff --git a/api/filter/http/router.proto b/envoy/api/v2/filter/http/router.proto similarity index 94% rename from api/filter/http/router.proto rename to envoy/api/v2/filter/http/router.proto index 5451eed99..7ab387099 100644 --- a/api/filter/http/router.proto +++ b/envoy/api/v2/filter/http/router.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.filter.http; -import "api/filter/accesslog/accesslog.proto"; +import "envoy/api/v2/filter/accesslog/accesslog.proto"; import "google/protobuf/wrappers.proto"; diff --git a/api/filter/http/squash.proto b/envoy/api/v2/filter/http/squash.proto similarity index 100% rename from api/filter/http/squash.proto rename to envoy/api/v2/filter/http/squash.proto diff --git a/api/filter/http/transcoder.proto b/envoy/api/v2/filter/http/transcoder.proto similarity index 100% rename from api/filter/http/transcoder.proto rename to envoy/api/v2/filter/http/transcoder.proto diff --git a/api/filter/network/BUILD b/envoy/api/v2/filter/network/BUILD similarity index 67% rename from api/filter/network/BUILD rename to envoy/api/v2/filter/network/BUILD index e8d563ef0..3d22141e1 100644 --- a/api/filter/network/BUILD +++ b/envoy/api/v2/filter/network/BUILD @@ -6,26 +6,26 @@ api_proto_library( name = "http_connection_manager", srcs = ["http_connection_manager.proto"], deps = [ - "//api:base", - "//api:config_source", - "//api:protocol", - "//api/filter/accesslog", - "//api/route", + "//envoy/api/v2:base", + "//envoy/api/v2:config_source", + "//envoy/api/v2:protocol", + "//envoy/api/v2/filter/accesslog", + "//envoy/api/v2/route", ], ) api_proto_library( name = "mongo_proxy", srcs = ["mongo_proxy.proto"], - deps = ["//api/filter:fault"], + deps = ["//envoy/api/v2/filter:fault"], ) api_proto_library( name = "tcp_proxy", srcs = ["tcp_proxy.proto"], deps = [ - "//api:address", - "//api/filter/accesslog", + "//envoy/api/v2:address", + "//envoy/api/v2/filter/accesslog", ], ) @@ -37,24 +37,24 @@ api_proto_library( api_proto_library( name = "client_ssl_auth", srcs = ["client_ssl_auth.proto"], - deps = ["//api:address"], + deps = ["//envoy/api/v2:address"], ) api_proto_library( name = "rate_limit", srcs = ["rate_limit.proto"], - deps = ["//api:rls"], + deps = ["//envoy/api/v2:rls"], ) api_proto_library( name = "ext_authz", srcs = ["ext_authz.proto"], - deps = ["//api:grpc_service"], + deps = ["//envoy/api/v2:grpc_service"], ) proto_library( name = "network", - visibility = ["//api:__pkg__"], + visibility = ["//envoy/api/v2:__pkg__"], deps = [ ":client_ssl_auth", ":ext_authz", diff --git a/api/filter/network/client_ssl_auth.proto b/envoy/api/v2/filter/network/client_ssl_auth.proto similarity index 97% rename from api/filter/network/client_ssl_auth.proto rename to envoy/api/v2/filter/network/client_ssl_auth.proto index 0270a9201..e115b4f60 100644 --- a/api/filter/network/client_ssl_auth.proto +++ b/envoy/api/v2/filter/network/client_ssl_auth.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.filter.network; -import "api/address.proto"; +import "envoy/api/v2/address.proto"; import "google/protobuf/duration.proto"; import "validate/validate.proto"; diff --git a/api/filter/network/ext_authz.proto b/envoy/api/v2/filter/network/ext_authz.proto similarity index 95% rename from api/filter/network/ext_authz.proto rename to envoy/api/v2/filter/network/ext_authz.proto index a256caaa7..5cfdf410a 100644 --- a/api/filter/network/ext_authz.proto +++ b/envoy/api/v2/filter/network/ext_authz.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.filter.network; -import "api/grpc_service.proto"; +import "envoy/api/v2/grpc_service.proto"; import "validate/validate.proto"; diff --git a/api/filter/network/http_connection_manager.proto b/envoy/api/v2/filter/network/http_connection_manager.proto similarity index 97% rename from api/filter/network/http_connection_manager.proto rename to envoy/api/v2/filter/network/http_connection_manager.proto index 8d0abc1cb..865352a31 100644 --- a/api/filter/network/http_connection_manager.proto +++ b/envoy/api/v2/filter/network/http_connection_manager.proto @@ -3,11 +3,11 @@ syntax = "proto3"; package envoy.api.v2.filter.network; option go_package = "network"; -import "api/base.proto"; -import "api/config_source.proto"; -import "api/protocol.proto"; -import "api/filter/accesslog/accesslog.proto"; -import "api/route/route.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/config_source.proto"; +import "envoy/api/v2/protocol.proto"; +import "envoy/api/v2/filter/accesslog/accesslog.proto"; +import "envoy/api/v2/route/route.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; diff --git a/api/filter/network/mongo_proxy.proto b/envoy/api/v2/filter/network/mongo_proxy.proto similarity index 95% rename from api/filter/network/mongo_proxy.proto rename to envoy/api/v2/filter/network/mongo_proxy.proto index cd16906dd..f4540c4a1 100644 --- a/api/filter/network/mongo_proxy.proto +++ b/envoy/api/v2/filter/network/mongo_proxy.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.filter.network; -import "api/filter/fault.proto"; +import "envoy/api/v2/filter/fault.proto"; import "validate/validate.proto"; diff --git a/api/filter/network/rate_limit.proto b/envoy/api/v2/filter/network/rate_limit.proto similarity index 96% rename from api/filter/network/rate_limit.proto rename to envoy/api/v2/filter/network/rate_limit.proto index 6ef063298..3bc7fd3bf 100644 --- a/api/filter/network/rate_limit.proto +++ b/envoy/api/v2/filter/network/rate_limit.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.filter.network; -import "api/rls.proto"; +import "envoy/api/v2/rls.proto"; import "google/protobuf/duration.proto"; import "validate/validate.proto"; diff --git a/api/filter/network/redis_proxy.proto b/envoy/api/v2/filter/network/redis_proxy.proto similarity index 100% rename from api/filter/network/redis_proxy.proto rename to envoy/api/v2/filter/network/redis_proxy.proto diff --git a/api/filter/network/tcp_proxy.proto b/envoy/api/v2/filter/network/tcp_proxy.proto similarity index 98% rename from api/filter/network/tcp_proxy.proto rename to envoy/api/v2/filter/network/tcp_proxy.proto index 022e31e26..8ed14a4d6 100644 --- a/api/filter/network/tcp_proxy.proto +++ b/envoy/api/v2/filter/network/tcp_proxy.proto @@ -3,8 +3,8 @@ syntax = "proto3"; package envoy.api.v2.filter.network; option go_package = "network"; -import "api/filter/accesslog/accesslog.proto"; -import "api/address.proto"; +import "envoy/api/v2/filter/accesslog/accesslog.proto"; +import "envoy/api/v2/address.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; diff --git a/api/grpc_service.proto b/envoy/api/v2/grpc_service.proto similarity index 98% rename from api/grpc_service.proto rename to envoy/api/v2/grpc_service.proto index fba11378e..e8434941b 100644 --- a/api/grpc_service.proto +++ b/envoy/api/v2/grpc_service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2; -import "api/base.proto"; +import "envoy/api/v2/base.proto"; import "google/protobuf/duration.proto"; diff --git a/api/hds.proto b/envoy/api/v2/hds.proto similarity index 98% rename from api/hds.proto rename to envoy/api/v2/hds.proto index a40d41573..25da3e9dc 100644 --- a/api/hds.proto +++ b/envoy/api/v2/hds.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package envoy.api.v2; -import "api/base.proto"; -import "api/health_check.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/health_check.proto"; import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; diff --git a/api/health_check.proto b/envoy/api/v2/health_check.proto similarity index 100% rename from api/health_check.proto rename to envoy/api/v2/health_check.proto diff --git a/api/listener/BUILD b/envoy/api/v2/listener/BUILD similarity index 57% rename from api/listener/BUILD rename to envoy/api/v2/listener/BUILD index dc496fabf..4ba17da1f 100644 --- a/api/listener/BUILD +++ b/envoy/api/v2/listener/BUILD @@ -6,9 +6,9 @@ api_proto_library( name = "listener", srcs = ["listener.proto"], deps = [ - "//api:address", - "//api:base", - "//api/cert", + "//envoy/api/v2:address", + "//envoy/api/v2:base", + "//envoy/api/v2/cert", ], ) @@ -16,8 +16,8 @@ api_go_proto_library( name = "listener", proto = ":listener", deps = [ - "//api:address_go_proto", - "//api:base_go_proto", - "//api/cert:cert_go_proto", + "//envoy/api/v2:address_go_proto", + "//envoy/api/v2:base_go_proto", + "//envoy/api/v2/cert:cert_go_proto", ], ) diff --git a/api/listener/listener.proto b/envoy/api/v2/listener/listener.proto similarity index 98% rename from api/listener/listener.proto rename to envoy/api/v2/listener/listener.proto index 0bf198f57..8d3dd93cc 100644 --- a/api/listener/listener.proto +++ b/envoy/api/v2/listener/listener.proto @@ -3,9 +3,9 @@ syntax = "proto3"; package envoy.api.v2.listener; option go_package = "listener"; -import "api/address.proto"; -import "api/base.proto"; -import "api/cert/cert.proto"; +import "envoy/api/v2/address.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/cert/cert.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; diff --git a/api/metrics_service.proto b/envoy/api/v2/metrics_service.proto similarity index 95% rename from api/metrics_service.proto rename to envoy/api/v2/metrics_service.proto index 0d82a076d..703177e5f 100644 --- a/api/metrics_service.proto +++ b/envoy/api/v2/metrics_service.proto @@ -6,8 +6,8 @@ syntax = "proto3"; package envoy.api.v2; -import "api/base.proto"; -import "api/grpc_service.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/grpc_service.proto"; import "metrics.proto"; diff --git a/api/protocol.proto b/envoy/api/v2/protocol.proto similarity index 100% rename from api/protocol.proto rename to envoy/api/v2/protocol.proto diff --git a/api/rls.proto b/envoy/api/v2/rls.proto similarity index 100% rename from api/rls.proto rename to envoy/api/v2/rls.proto diff --git a/api/route/BUILD b/envoy/api/v2/route/BUILD similarity index 66% rename from api/route/BUILD rename to envoy/api/v2/route/BUILD index 309c36b7c..53fc2e1f0 100644 --- a/api/route/BUILD +++ b/envoy/api/v2/route/BUILD @@ -6,8 +6,8 @@ api_proto_library( name = "route", srcs = ["route.proto"], deps = [ - "//api:base", - "//api/auth", + "//envoy/api/v2:base", + "//envoy/api/v2/auth", ], ) @@ -15,7 +15,7 @@ api_go_proto_library( name = "route", proto = ":route", deps = [ - "//api:base_go_proto", - "//api/auth:auth_go_proto", + "//envoy/api/v2:base_go_proto", + "//envoy/api/v2/auth:auth_go_proto", ], ) diff --git a/api/route/route.proto b/envoy/api/v2/route/route.proto similarity index 99% rename from api/route/route.proto rename to envoy/api/v2/route/route.proto index 5d457e93e..3884ff5b6 100644 --- a/api/route/route.proto +++ b/envoy/api/v2/route/route.proto @@ -3,8 +3,8 @@ syntax = "proto3"; package envoy.api.v2.route; option go_package = "route"; -import "api/base.proto"; -import "api/auth/auth.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/auth/auth.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; diff --git a/api/stats.proto b/envoy/api/v2/stats.proto similarity index 99% rename from api/stats.proto rename to envoy/api/v2/stats.proto index d4377923f..f9aa85b87 100644 --- a/api/stats.proto +++ b/envoy/api/v2/stats.proto @@ -5,7 +5,7 @@ syntax = "proto3"; package envoy.api.v2; -import "api/address.proto"; +import "envoy/api/v2/address.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; diff --git a/api/trace.proto b/envoy/api/v2/trace.proto similarity index 100% rename from api/trace.proto rename to envoy/api/v2/trace.proto diff --git a/test/build/BUILD b/test/build/BUILD index e5d203ae4..2cb2d4e25 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -6,15 +6,15 @@ api_cc_test( name = "build_test", srcs = ["build_test.cc"], proto_deps = [ - "//api:hds", - "//api:metrics", - "//api:rls", - "//api/discovery:ads", - "//api/discovery:cds", - "//api/discovery:eds", - "//api/discovery:lds", - "//api/discovery:rds", - "//api/filter/accesslog", + "//envoy/api/v2:hds", + "//envoy/api/v2:metrics", + "//envoy/api/v2:rls", + "//envoy/api/v2/discovery:ads", + "//envoy/api/v2/discovery:cds", + "//envoy/api/v2/discovery:eds", + "//envoy/api/v2/discovery:lds", + "//envoy/api/v2/discovery:rds", + "//envoy/api/v2/filter/accesslog", ], ) @@ -24,15 +24,15 @@ api_go_test( srcs = ["go_build_test.go"], importpath = "go_build_test", deps = [ - "//api:hds_go_grpc", - "//api:rls_go_grpc", - "//api/bootstrap:bootstrap_go_proto", - "//api/cert:cert_go_proto", - "//api/discovery:ads_go_grpc", - "//api/discovery:cds_go_grpc", - "//api/discovery:eds_go_grpc", - "//api/discovery:lds_go_grpc", - "//api/discovery:rds_go_grpc", - "//api/discovery:sds_go_grpc", + "//envoy/api/v2:hds_go_grpc", + "//envoy/api/v2:rls_go_grpc", + "//envoy/api/v2/bootstrap:bootstrap_go_proto", + "//envoy/api/v2/cert:cert_go_proto", + "//envoy/api/v2/discovery:ads_go_grpc", + "//envoy/api/v2/discovery:cds_go_grpc", + "//envoy/api/v2/discovery:eds_go_grpc", + "//envoy/api/v2/discovery:lds_go_grpc", + "//envoy/api/v2/discovery:rds_go_grpc", + "//envoy/api/v2/discovery:sds_go_grpc", ], ) diff --git a/test/validate/BUILD b/test/validate/BUILD index 7c91efaec..2ced8a390 100644 --- a/test/validate/BUILD +++ b/test/validate/BUILD @@ -6,23 +6,23 @@ api_cc_test( name = "pgv_test", srcs = ["pgv_test.cc"], proto_deps = [ - "//api:protocol", - "//api/bootstrap", - "//api/discovery:cds", - "//api/discovery:eds", - "//api/discovery:lds", - "//api/discovery:rds", - "//api/filter/accesslog", - "//api/filter/http:buffer", - "//api/filter/http:fault", - "//api/filter/http:health_check", - "//api/filter/http:lua", - "//api/filter/http:router", - "//api/filter/http:squash", - "//api/filter/http:transcoder", - "//api/filter/network:http_connection_manager", - "//api/filter/network:mongo_proxy", - "//api/filter/network:redis_proxy", - "//api/filter/network:tcp_proxy", + "//envoy/api/v2:protocol", + "//envoy/api/v2/bootstrap", + "//envoy/api/v2/discovery:cds", + "//envoy/api/v2/discovery:eds", + "//envoy/api/v2/discovery:lds", + "//envoy/api/v2/discovery:rds", + "//envoy/api/v2/filter/accesslog", + "//envoy/api/v2/filter/http:buffer", + "//envoy/api/v2/filter/http:fault", + "//envoy/api/v2/filter/http:health_check", + "//envoy/api/v2/filter/http:lua", + "//envoy/api/v2/filter/http:router", + "//envoy/api/v2/filter/http:squash", + "//envoy/api/v2/filter/http:transcoder", + "//envoy/api/v2/filter/network:http_connection_manager", + "//envoy/api/v2/filter/network:mongo_proxy", + "//envoy/api/v2/filter/network:redis_proxy", + "//envoy/api/v2/filter/network:tcp_proxy", ], ) diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index a7df8edd5..cbf49f03f 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -3,24 +3,24 @@ // We don't use all the headers in the test below, but including them anyway as // a cheap way to get some C++ compiler sanity checking. -#include "api/protocol.pb.validate.h" -#include "api/bootstrap/bootstrap.pb.validate.h" -#include "api/cluster/cluster.pb.validate.h" -#include "api/discovery/eds.pb.validate.h" -#include "api/filter/accesslog/accesslog.pb.validate.h" -#include "api/filter/http/buffer.pb.validate.h" -#include "api/filter/http/fault.pb.validate.h" -#include "api/filter/http/health_check.pb.validate.h" -#include "api/filter/http/lua.pb.validate.h" -#include "api/filter/http/router.pb.validate.h" -#include "api/filter/http/squash.pb.validate.h" -#include "api/filter/http/transcoder.pb.validate.h" -#include "api/filter/network/http_connection_manager.pb.validate.h" -#include "api/filter/network/mongo_proxy.pb.validate.h" -#include "api/filter/network/redis_proxy.pb.validate.h" -#include "api/filter/network/tcp_proxy.pb.validate.h" -#include "api/listener/listener.pb.validate.h" -#include "api/route/route.pb.validate.h" +#include "envoy/api/v2/protocol.pb.validate.h" +#include "envoy/api/v2/bootstrap/bootstrap.pb.validate.h" +#include "envoy/api/v2/cluster/cluster.pb.validate.h" +#include "envoy/api/v2/discovery/eds.pb.validate.h" +#include "envoy/api/v2/filter/accesslog/accesslog.pb.validate.h" +#include "envoy/api/v2/filter/http/buffer.pb.validate.h" +#include "envoy/api/v2/filter/http/fault.pb.validate.h" +#include "envoy/api/v2/filter/http/health_check.pb.validate.h" +#include "envoy/api/v2/filter/http/lua.pb.validate.h" +#include "envoy/api/v2/filter/http/router.pb.validate.h" +#include "envoy/api/v2/filter/http/squash.pb.validate.h" +#include "envoy/api/v2/filter/http/transcoder.pb.validate.h" +#include "envoy/api/v2/filter/network/http_connection_manager.pb.validate.h" +#include "envoy/api/v2/filter/network/mongo_proxy.pb.validate.h" +#include "envoy/api/v2/filter/network/redis_proxy.pb.validate.h" +#include "envoy/api/v2/filter/network/tcp_proxy.pb.validate.h" +#include "envoy/api/v2/listener/listener.pb.validate.h" +#include "envoy/api/v2/route/route.pb.validate.h" #include "google/protobuf/text_format.h" diff --git a/tools/BUILD b/tools/BUILD index 731ed370d..0f3325a52 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -6,8 +6,8 @@ py_binary( licenses = ["notice"], # Apache 2 visibility = ["//visibility:public"], deps = [ - "//api/filter/network:http_connection_manager_py", - "//api/listener:listener_py", + "//envoy/api/v2/filter/network:http_connection_manager_py", + "//envoy/api/v2/listener:listener_py", ], ) diff --git a/tools/generate_listeners.py b/tools/generate_listeners.py index 454c70661..f35cb776e 100644 --- a/tools/generate_listeners.py +++ b/tools/generate_listeners.py @@ -16,8 +16,8 @@ from google.protobuf import struct_pb2 from google.protobuf import text_format -from api.listener import listener_pb2 -from api.filter.network import http_connection_manager_pb2 +from envoy.api.v2.listener import listener_pb2 +from envoy.api.v2.filter.network import http_connection_manager_pb2 # Convert an arbitrary proto object to its Struct proto representation. From 8dcf677a917c7c3159b495e38e7c96f19509cf17 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 17 Jan 2018 11:56:03 -0800 Subject: [PATCH 11/47] fix ci Signed-off-by: Kuat Yessenov --- ci/do_ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 069b708d1..cadeb639a 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -15,7 +15,7 @@ echo "building using ${NUM_CPUS} CPUs" if [[ "$1" == "bazel.test" ]]; then echo "bazel building and testing..." - bazel --batch build ${BAZEL_BUILD_OPTIONS} //api/... + bazel --batch build ${BAZEL_BUILD_OPTIONS} //envoy/api/... bazel --batch test ${BAZEL_TEST_OPTIONS} //test/... //tools/... exit 0 elif [[ "$1" == "bazel.docs" ]]; then From a83ba75066b385e91ddacb2774be060599e3a2f2 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 17 Jan 2018 13:13:31 -0800 Subject: [PATCH 12/47] move hds.proto to discovery Signed-off-by: Kuat Yessenov --- envoy/api/v2/BUILD | 19 ------------------- envoy/api/v2/discovery/BUILD | 19 +++++++++++++++++++ envoy/api/v2/{ => discovery}/hds.proto | 2 +- test/build/BUILD | 4 ++-- test/build/build_test.cc | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) rename envoy/api/v2/{ => discovery}/hds.proto (99%) diff --git a/envoy/api/v2/BUILD b/envoy/api/v2/BUILD index 77f8ca81c..490b13454 100644 --- a/envoy/api/v2/BUILD +++ b/envoy/api/v2/BUILD @@ -66,25 +66,6 @@ api_go_proto_library( deps = [":base_go_proto"], ) -api_proto_library( - name = "hds", - srcs = ["hds.proto"], - has_services = 1, - deps = [ - ":base", - ":health_check", - ], -) - -api_go_grpc_library( - name = "hds", - proto = ":hds", - deps = [ - ":base_go_proto", - ":health_check_go_proto", - ], -) - api_proto_library( name = "metrics", srcs = ["metrics_service.proto"], diff --git a/envoy/api/v2/discovery/BUILD b/envoy/api/v2/discovery/BUILD index 70e81bb73..a55a11b7a 100644 --- a/envoy/api/v2/discovery/BUILD +++ b/envoy/api/v2/discovery/BUILD @@ -88,6 +88,25 @@ api_go_grpc_library( ], ) +api_proto_library( + name = "hds", + srcs = ["hds.proto"], + has_services = 1, + deps = [ + "//envoy/api/v2:base", + "//envoy/api/v2:health_check", + ], +) + +api_go_grpc_library( + name = "hds", + proto = ":hds", + deps = [ + "//envoy/api/v2:base_go_proto", + "//envoy/api/v2:health_check_go_proto", + ], +) + api_proto_library( name = "rds", srcs = ["rds.proto"], diff --git a/envoy/api/v2/hds.proto b/envoy/api/v2/discovery/hds.proto similarity index 99% rename from envoy/api/v2/hds.proto rename to envoy/api/v2/discovery/hds.proto index 25da3e9dc..561ee91d8 100644 --- a/envoy/api/v2/hds.proto +++ b/envoy/api/v2/discovery/hds.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.discovery; import "envoy/api/v2/base.proto"; import "envoy/api/v2/health_check.proto"; diff --git a/test/build/BUILD b/test/build/BUILD index 2cb2d4e25..05ab9e024 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -6,12 +6,12 @@ api_cc_test( name = "build_test", srcs = ["build_test.cc"], proto_deps = [ - "//envoy/api/v2:hds", "//envoy/api/v2:metrics", "//envoy/api/v2:rls", "//envoy/api/v2/discovery:ads", "//envoy/api/v2/discovery:cds", "//envoy/api/v2/discovery:eds", + "//envoy/api/v2/discovery:hds", "//envoy/api/v2/discovery:lds", "//envoy/api/v2/discovery:rds", "//envoy/api/v2/filter/accesslog", @@ -24,13 +24,13 @@ api_go_test( srcs = ["go_build_test.go"], importpath = "go_build_test", deps = [ - "//envoy/api/v2:hds_go_grpc", "//envoy/api/v2:rls_go_grpc", "//envoy/api/v2/bootstrap:bootstrap_go_proto", "//envoy/api/v2/cert:cert_go_proto", "//envoy/api/v2/discovery:ads_go_grpc", "//envoy/api/v2/discovery:cds_go_grpc", "//envoy/api/v2/discovery:eds_go_grpc", + "//envoy/api/v2/discovery:hds_go_grpc", "//envoy/api/v2/discovery:lds_go_grpc", "//envoy/api/v2/discovery:rds_go_grpc", "//envoy/api/v2/discovery:sds_go_grpc", diff --git a/test/build/build_test.cc b/test/build/build_test.cc index 8b1618cf1..847bb1e97 100644 --- a/test/build/build_test.cc +++ b/test/build/build_test.cc @@ -12,12 +12,12 @@ int main(int argc, char* argv[]) { "envoy.api.v2.discovery.ClusterDiscoveryService.StreamClusters", "envoy.api.v2.discovery.EndpointDiscoveryService.FetchEndpoints", "envoy.api.v2.discovery.EndpointDiscoveryService.StreamEndpoints", + "envoy.api.v2.discovery.HealthDiscoveryService.FetchHealthCheck", + "envoy.api.v2.discovery.HealthDiscoveryService.StreamHealthCheck", "envoy.api.v2.discovery.ListenerDiscoveryService.FetchListeners", "envoy.api.v2.discovery.ListenerDiscoveryService.StreamListeners", "envoy.api.v2.discovery.RouteDiscoveryService.FetchRoutes", "envoy.api.v2.discovery.RouteDiscoveryService.StreamRoutes", - "envoy.api.v2.HealthDiscoveryService.FetchHealthCheck", - "envoy.api.v2.HealthDiscoveryService.StreamHealthCheck", "envoy.api.v2.MetricsService.StreamMetrics", "envoy.api.v2.RateLimitService.ShouldRateLimit", }; From 958c99fc4064db2d66f8d027c61c31b9fc97c06d Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 17 Jan 2018 15:25:55 -0800 Subject: [PATCH 13/47] fix docs Signed-off-by: Kuat Yessenov --- docs/build.sh | 73 ++++++++++--------- docs/root/api-v2/api.rst | 16 ++-- docs/root/configuration/access_log.rst | 4 +- .../cluster_circuit_breakers.rst | 2 +- .../cluster_manager/cluster_manager.rst | 2 +- .../configuration/http_conn_man/headers.rst | 6 +- .../configuration/listeners/listeners.rst | 2 +- .../network_filters/echo_filter.rst | 2 +- .../configuration/overview/v2_overview.rst | 48 ++++++------ docs/root/configuration/rate_limit.rst | 2 +- docs/root/configuration/runtime.rst | 2 +- docs/root/faq/sni.rst | 4 +- .../arch_overview/dynamic_configuration.rst | 2 +- .../intro/arch_overview/load_balancing.rst | 4 +- docs/root/intro/arch_overview/ssl.rst | 4 +- docs/root/intro/arch_overview/statistics.rst | 2 +- docs/root/intro/version_history.rst | 22 +++--- docs/root/operations/admin.rst | 2 +- docs/root/operations/cli.rst | 6 +- envoy/api/v2/BUILD | 4 +- envoy/api/v2/bootstrap/BUILD | 4 +- envoy/api/v2/bootstrap/bootstrap.proto | 10 +-- envoy/api/v2/cert/cert.proto | 8 +- envoy/api/v2/cluster/BUILD | 10 +-- envoy/api/v2/cluster/circuit_breaker.proto | 4 +- envoy/api/v2/cluster/cluster.proto | 48 ++++++------ envoy/api/v2/cluster/outlier_detection.proto | 2 + envoy/api/v2/discovery/BUILD | 1 + envoy/api/v2/discovery/eds.proto | 8 +- envoy/api/v2/filter/network/tcp_proxy.proto | 4 +- envoy/api/v2/grpc_service.proto | 4 +- envoy/api/v2/listener/listener.proto | 8 +- envoy/api/v2/route/route.proto | 44 +++++------ envoy/api/v2/trace.proto | 6 +- 34 files changed, 189 insertions(+), 181 deletions(-) diff --git a/docs/build.sh b/docs/build.sh index ddafb6dea..90bd80811 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -20,46 +20,47 @@ fi source "${BUILD_DIR}"/venv/bin/activate -bazel --batch build ${BAZEL_BUILD_OPTIONS} //api --aspects \ +bazel --batch build ${BAZEL_BUILD_OPTIONS} //envoy/api/v2:api --aspects \ tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst # These are the protos we want to put in docs, this list will grow. # TODO(htuch): Factor this out of this script. PROTO_RST=" - /api/address/api/address.proto.rst - /api/base/api/base.proto.rst - /api/bootstrap/api/bootstrap.proto.rst - /api/cds/api/cds.proto.rst - /api/config_source/api/config_source.proto.rst - /api/discovery/api/discovery.proto.rst - /api/eds/api/eds.proto.rst - /api/grpc_service/api/grpc_service.proto.rst - /api/health_check/api/health_check.proto.rst - /api/lds/api/lds.proto.rst - /api/metrics/api/metrics_service.proto.rst - /api/rds/api/rds.proto.rst - /api/rls/api/rls.proto.rst - /api/sds/api/sds.proto.rst - /api/stats/api/stats.proto.rst - /api/trace/api/trace.proto.rst - /api/filter/accesslog/accesslog/api/filter/accesslog/accesslog.proto.rst - /api/filter/fault/api/filter/fault.proto.rst - /api/filter/http/buffer/api/filter/http/buffer.proto.rst - /api/filter/http/fault/api/filter/http/fault.proto.rst - /api/filter/http/health_check/api/filter/http/health_check.proto.rst - /api/filter/http/lua/api/filter/http/lua.proto.rst - /api/filter/http/rate_limit/api/filter/http/rate_limit.proto.rst - /api/filter/http/router/api/filter/http/router.proto.rst - /api/filter/http/squash/api/filter/http/squash.proto.rst - /api/filter/http/transcoder/api/filter/http/transcoder.proto.rst - /api/filter/network/client_ssl_auth/api/filter/network/client_ssl_auth.proto.rst - /api/filter/network/http_connection_manager/api/filter/network/http_connection_manager.proto.rst - /api/filter/network/mongo_proxy/api/filter/network/mongo_proxy.proto.rst - /api/filter/network/rate_limit/api/filter/network/rate_limit.proto.rst - /api/filter/network/redis_proxy/api/filter/network/redis_proxy.proto.rst - /api/filter/network/tcp_proxy/api/filter/network/tcp_proxy.proto.rst - /api/protocol/api/protocol.proto.rst - /api/rds/api/rds.proto.rst + /envoy/api/v2/address/envoy/api/v2/address.proto.rst + /envoy/api/v2/base/envoy/api/v2/base.proto.rst + /envoy/api/v2/bootstrap/bootstrap/envoy/api/v2/bootstrap/bootstrap.proto.rst + /envoy/api/v2/cert/cert/envoy/api/v2/cert/cert.proto.rst + /envoy/api/v2/cluster/cluster/envoy/api/v2/cluster/cluster.proto.rst + /envoy/api/v2/cluster/outlier_detection/envoy/api/v2/cluster/outlier_detection.proto.rst + /envoy/api/v2/cluster/circuit_breaker/envoy/api/v2/cluster/circuit_breaker.proto.rst + /envoy/api/v2/route/route/envoy/api/v2/route/route.proto.rst + /envoy/api/v2/listener/listener/envoy/api/v2/listener/listener.proto.rst + /envoy/api/v2/config_source/envoy/api/v2/config_source.proto.rst + /envoy/api/v2/discovery/common/envoy/api/v2/discovery/common.proto.rst + /envoy/api/v2/discovery/eds/envoy/api/v2/discovery/eds.proto.rst + /envoy/api/v2/grpc_service/envoy/api/v2/grpc_service.proto.rst + /envoy/api/v2/health_check/envoy/api/v2/health_check.proto.rst + /envoy/api/v2/metrics/envoy/api/v2/metrics_service.proto.rst + /envoy/api/v2/rls/envoy/api/v2/rls.proto.rst + /envoy/api/v2/stats/envoy/api/v2/stats.proto.rst + /envoy/api/v2/trace/envoy/api/v2/trace.proto.rst + /envoy/api/v2/filter/accesslog/accesslog/envoy/api/v2/filter/accesslog/accesslog.proto.rst + /envoy/api/v2/filter/fault/envoy/api/v2/filter/fault.proto.rst + /envoy/api/v2/filter/http/buffer/envoy/api/v2/filter/http/buffer.proto.rst + /envoy/api/v2/filter/http/fault/envoy/api/v2/filter/http/fault.proto.rst + /envoy/api/v2/filter/http/health_check/envoy/api/v2/filter/http/health_check.proto.rst + /envoy/api/v2/filter/http/lua/envoy/api/v2/filter/http/lua.proto.rst + /envoy/api/v2/filter/http/rate_limit/envoy/api/v2/filter/http/rate_limit.proto.rst + /envoy/api/v2/filter/http/router/envoy/api/v2/filter/http/router.proto.rst + /envoy/api/v2/filter/http/squash/envoy/api/v2/filter/http/squash.proto.rst + /envoy/api/v2/filter/http/transcoder/envoy/api/v2/filter/http/transcoder.proto.rst + /envoy/api/v2/filter/network/client_ssl_auth/envoy/api/v2/filter/network/client_ssl_auth.proto.rst + /envoy/api/v2/filter/network/http_connection_manager/envoy/api/v2/filter/network/http_connection_manager.proto.rst + /envoy/api/v2/filter/network/mongo_proxy/envoy/api/v2/filter/network/mongo_proxy.proto.rst + /envoy/api/v2/filter/network/rate_limit/envoy/api/v2/filter/network/rate_limit.proto.rst + /envoy/api/v2/filter/network/redis_proxy/envoy/api/v2/filter/network/redis_proxy.proto.rst + /envoy/api/v2/filter/network/tcp_proxy/envoy/api/v2/filter/network/tcp_proxy.proto.rst + /envoy/api/v2/protocol/envoy/api/v2/protocol.proto.rst " # Dump all the generated RST so they can be added to PROTO_RST easily. @@ -68,7 +69,7 @@ find -L bazel-bin -name "*.proto.rst" # Only copy in the protos we care about and know how to deal with in protodoc. for p in $PROTO_RST do - DEST="${GENERATED_RST_DIR}/api-v2/$(sed -e 's#/api.*/api/##' <<< "$p")" + DEST="${GENERATED_RST_DIR}/api-v2/$(sed -e 's#/envoy\/api\/v2.*/envoy\/api\/v2/##' <<< "$p")" mkdir -p "$(dirname "${DEST}")" cp -f bazel-bin/"${p}" "${DEST}" done diff --git a/docs/root/api-v2/api.rst b/docs/root/api-v2/api.rst index 4106a7655..b21d0eceb 100644 --- a/docs/root/api-v2/api.rst +++ b/docs/root/api-v2/api.rst @@ -7,21 +7,23 @@ v2 API reference :glob: :maxdepth: 2 - bootstrap.proto + bootstrap/bootstrap.proto config_source.proto grpc_service.proto - lds.proto - cds.proto - eds.proto + listener/listener.proto + cluster/cluster.proto + cluster/outlier_detection.proto + cluster/circuit_breaker.proto + discovery/eds.proto health_check.proto - rds.proto - sds.proto + route/route.proto + cert/cert.proto stats.proto metrics_service.proto trace.proto base.proto address.proto protocol.proto - discovery.proto + discovery/common.proto rls.proto filter/filter diff --git a/docs/root/configuration/access_log.rst b/docs/root/configuration/access_log.rst index cf005d8cd..26f8ad73e 100644 --- a/docs/root/configuration/access_log.rst +++ b/docs/root/configuration/access_log.rst @@ -116,7 +116,7 @@ The following command operators are supported: .. note:: This may not be the physical remote address of the peer if the address has been inferred from - :ref:`proxy proto ` or :ref:`x-forwarded-for + :ref:`proxy proto ` or :ref:`x-forwarded-for `. %DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT% @@ -126,7 +126,7 @@ The following command operators are supported: .. note:: This may not be the physical remote address of the peer if the address has been inferred from - :ref:`proxy proto ` or :ref:`x-forwarded-for + :ref:`proxy proto ` or :ref:`x-forwarded-for `. %DOWNSTREAM_LOCAL_ADDRESS% diff --git a/docs/root/configuration/cluster_manager/cluster_circuit_breakers.rst b/docs/root/configuration/cluster_manager/cluster_circuit_breakers.rst index 8b1b137b9..331d59b8e 100644 --- a/docs/root/configuration/cluster_manager/cluster_circuit_breakers.rst +++ b/docs/root/configuration/cluster_manager/cluster_circuit_breakers.rst @@ -5,7 +5,7 @@ Circuit breaking * Circuit Breaking :ref:`architecture overview `. * :ref:`v1 API documentation `. -* :ref:`v2 API documentation `. +* :ref:`v2 API documentation `. Runtime ------- diff --git a/docs/root/configuration/cluster_manager/cluster_manager.rst b/docs/root/configuration/cluster_manager/cluster_manager.rst index e89afa58b..f7ca59217 100644 --- a/docs/root/configuration/cluster_manager/cluster_manager.rst +++ b/docs/root/configuration/cluster_manager/cluster_manager.rst @@ -14,4 +14,4 @@ Cluster manager * Cluster manager :ref:`architecture overview ` * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` diff --git a/docs/root/configuration/http_conn_man/headers.rst b/docs/root/configuration/http_conn_man/headers.rst index d0f0f6a10..2e4591364 100644 --- a/docs/root/configuration/http_conn_man/headers.rst +++ b/docs/root/configuration/http_conn_man/headers.rst @@ -283,7 +283,7 @@ Custom request/response headers Custom request/response headers can be added to a request/response that matches a specific route at the route, virtual host, and global route configuration level. See the relevant :ref:`v1 -` and :ref:`v2 ` API +` and :ref:`v2 ` API documentation. **Note:** Headers are appended to requests/responses in the following order: route level headers, virtual host @@ -307,7 +307,7 @@ Supported dynamic values are: .. note:: This may not be the physical remote address of the peer if the address has been inferred from - :ref:`proxy proto ` or :ref:`x-forwarded-for + :ref:`proxy proto ` or :ref:`x-forwarded-for `. %PROTOCOL% @@ -315,7 +315,7 @@ Supported dynamic values are: :ref:`x-forwarded-proto ` request header. %UPSTREAM_METADATA(["namespace", "key", ...])% - Populates the header with ref:`EDS endpoint metadata ` from the + Populates the header with ref:`EDS endpoint metadata ` from the upstream host selected by the router. Metadata may be selected from any namespace. In general, metadata values may be strings, numbers, booleans, lists, nested structures, or null. Upstream metadata values may be selected from nested structs by specifying multiple keys. Otherwise, diff --git a/docs/root/configuration/listeners/listeners.rst b/docs/root/configuration/listeners/listeners.rst index 947c7a8b1..920328301 100644 --- a/docs/root/configuration/listeners/listeners.rst +++ b/docs/root/configuration/listeners/listeners.rst @@ -7,7 +7,7 @@ The top level Envoy configuration contains a list of :ref:`listeners ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` .. toctree:: :hidden: diff --git a/docs/root/configuration/network_filters/echo_filter.rst b/docs/root/configuration/network_filters/echo_filter.rst index e1b2199ee..0073eedaa 100644 --- a/docs/root/configuration/network_filters/echo_filter.rst +++ b/docs/root/configuration/network_filters/echo_filter.rst @@ -7,4 +7,4 @@ The echo is a trivial network filter mainly meant to demonstrate the network fil installed it will echo (write) all received data back to the connected downstream client. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` diff --git a/docs/root/configuration/overview/v2_overview.rst b/docs/root/configuration/overview/v2_overview.rst index c24035c8c..7279ddd54 100644 --- a/docs/root/configuration/overview/v2_overview.rst +++ b/docs/root/configuration/overview/v2_overview.rst @@ -44,15 +44,15 @@ where the extension reflects the underlying v2 config representation. The to autodetect the config file version, but this option provides an enhanced debug experience when configuration parsing fails. -The :ref:`Bootstrap ` message is the root of the -configuration. A key concept in the :ref:`Bootstrap ` +The :ref:`Bootstrap ` message is the root of the +configuration. A key concept in the :ref:`Bootstrap ` message is the distinction between static and dynamic resouces. Resources such -as a :ref:`Listener ` or :ref:`Cluster -` may be supplied either statically in -:ref:`static_resources ` or have +as a :ref:`Listener ` or :ref:`Cluster +` may be supplied either statically in +:ref:`static_resources ` or have an xDS service such as :ref:`LDS ` or :ref:`CDS ` configured in -:ref:`dynamic_resources `. +:ref:`dynamic_resources `. Example ------- @@ -105,7 +105,7 @@ Mostly static with dynamic EDS A bootstrap config that continues from the above example with :ref:`dynamic endpoint discovery ` via an -:ref:`EDS` gRPC management server listening +:ref:`EDS` gRPC management server listening on 127.0.0.3:5678 is provided below: .. code-block:: yaml @@ -158,7 +158,7 @@ an otherwise completely dynamic configurations, some static resources need to be defined to point Envoy at its xDS management server(s). In the above example, the EDS management server could then return a proto encoding of a -:ref:`DiscoveryResponse `: +:ref:`DiscoveryResponse `: .. code-block:: yaml @@ -293,8 +293,8 @@ Management server A v2 xDS management server will implement the below endpoints as required for gRPC and/or REST serving. In both streaming gRPC and -REST-JSON cases, a :ref:`DiscoveryRequest ` is sent and a -:ref:`DiscoveryResponse ` received following the +REST-JSON cases, a :ref:`DiscoveryRequest ` is sent and a +:ref:`DiscoveryResponse ` received following the `xDS protocol `_. .. _v2_grpc_streaming_endpoints: @@ -316,8 +316,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /envoy.api.v2.EndpointDiscoveryService/StreamEndpoints @@ -333,8 +333,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`eds_cluster_config -` field of the :ref:`Cluster -` config. +` field of the :ref:`Cluster +` config. .. http:post:: /envoy.api.v2.ListenerDiscoveryService/StreamListeners @@ -350,8 +350,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /envoy.api.v2.RouteDiscoveryService/StreamRoutes @@ -388,8 +388,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /v2/discovery:endpoints @@ -405,8 +405,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`eds_cluster_config -` field of the :ref:`Cluster -` config. +` field of the :ref:`Cluster +` config. .. http:post:: /v2/discovery:listeners @@ -422,8 +422,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /v2/discovery:routes @@ -488,8 +488,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_ads_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. When this is set, any of the configuration sources :ref:`above ` can be set to use the ADS channel. For example, a LDS config could be changed from diff --git a/docs/root/configuration/rate_limit.rst b/docs/root/configuration/rate_limit.rst index b73dc40f9..22882233c 100644 --- a/docs/root/configuration/rate_limit.rst +++ b/docs/root/configuration/rate_limit.rst @@ -8,7 +8,7 @@ limit service Envoy should talk to when it needs to make global rate limit decis limit service is configured, a "null" service will be used which will always return OK if called. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` gRPC service IDL ---------------- diff --git a/docs/root/configuration/runtime.rst b/docs/root/configuration/runtime.rst index de5f5ecd5..f9d779847 100644 --- a/docs/root/configuration/runtime.rst +++ b/docs/root/configuration/runtime.rst @@ -8,7 +8,7 @@ system tree that contains re-loadable configuration elements. If runtime is not provider is used which has the effect of using all defaults built into the code. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` File system layout ------------------ diff --git a/docs/root/faq/sni.rst b/docs/root/faq/sni.rst index 78e4155d6..21e1e500a 100644 --- a/docs/root/faq/sni.rst +++ b/docs/root/faq/sni.rst @@ -7,10 +7,10 @@ How do I setup SNI? configuration/API `. The current implementation has the requirement that the :ref:`filters -` in every :ref:`FilterChain ` must +` in every :ref:`FilterChain ` must be identical. In a future release, this requirement will be relaxed so that SNI can be used to choose between completely different filter chains. :ref:`Domain name matching -` can still be used within the HTTP connection manager to +` can still be used within the HTTP connection manager to choose different routes. This is by far the most common use case for SNI. The following is a YAML example of the above requirement. diff --git a/docs/root/intro/arch_overview/dynamic_configuration.rst b/docs/root/intro/arch_overview/dynamic_configuration.rst index bbce93e0c..fd67e7786 100644 --- a/docs/root/intro/arch_overview/dynamic_configuration.rst +++ b/docs/root/intro/arch_overview/dynamic_configuration.rst @@ -34,7 +34,7 @@ SDS/EDS only The :ref:`service discovery service (SDS) API ` provides a more advanced mechanism by which Envoy can discover members of an upstream cluster. SDS has been renamed to :ref:`Endpoint -Discovery Service (EDS)` in the +Discovery Service (EDS)` in the :ref:`v2 API `. Layered on top of a static configuration, SDS allows an Envoy deployment to circumvent the limitations of DNS (maximum records in a response, etc.) as well as consume more information used in load balancing and routing (e.g., diff --git a/docs/root/intro/arch_overview/load_balancing.rst b/docs/root/intro/arch_overview/load_balancing.rst index 6223162df..876049846 100644 --- a/docs/root/intro/arch_overview/load_balancing.rst +++ b/docs/root/intro/arch_overview/load_balancing.rst @@ -97,7 +97,7 @@ Priority levels ------------------ During load balancing, Envoy will generally only consider hosts configured at the highest priority -level. For each EDS :ref:`LocalityLbEndpoints` an optional +level. For each EDS :ref:`LocalityLbEndpoints` an optional priority may also be specified. When endpoints at the highest priority level (P=0) are healthy, all traffic will land on endpoints in that priority level. As endpoints for the highest priority level become unhealthy, traffic will begin to trickle to lower priority levels. @@ -240,7 +240,7 @@ not be used with subsets because the upstream hosts are not known in advance. Su with zone aware routing, but be aware that the use of subsets may easily violate the minimum hosts condition described above. -If subsets are :ref:`configured ` and a route +If subsets are :ref:`configured ` and a route specifies no metadata or no subset matching the metadata exists, the subset load balancer initiates its fallback policy. The default policy is ``NO_ENDPOINT``, in which case the request fails as if the cluster had no hosts. Conversely, the ``ANY_ENDPOINT`` fallback policy load balances across all diff --git a/docs/root/intro/arch_overview/ssl.rst b/docs/root/intro/arch_overview/ssl.rst index 508795eb1..c809e8157 100644 --- a/docs/root/intro/arch_overview/ssl.rst +++ b/docs/root/intro/arch_overview/ssl.rst @@ -78,8 +78,8 @@ standard Debian installations. Common paths for system CA bundles on Linux and B * /usr/local/etc/ssl/cert.pem (FreeBSD) * /etc/ssl/cert.pem (OpenBSD) -See the reference for :ref:`UpstreamTlsContexts ` and -:ref:`DownstreamTlsContexts ` for other TLS options. +See the reference for :ref:`UpstreamTlsContexts ` and +:ref:`DownstreamTlsContexts ` for other TLS options. .. _arch_overview_ssl_auth_filter: diff --git a/docs/root/intro/arch_overview/statistics.rst b/docs/root/intro/arch_overview/statistics.rst index 83486752b..dbe7dcd9e 100644 --- a/docs/root/intro/arch_overview/statistics.rst +++ b/docs/root/intro/arch_overview/statistics.rst @@ -23,4 +23,4 @@ received. Note: what were previously referred to as timers have become histogram difference between the two representations was the units. * :ref:`v1 API reference `. -* :ref:`v2 API reference `. +* :ref:`v2 API reference `. diff --git a/docs/root/intro/version_history.rst b/docs/root/intro/version_history.rst index 439d1f33a..c86ca8ced 100644 --- a/docs/root/intro/version_history.rst +++ b/docs/root/intro/version_history.rst @@ -20,11 +20,11 @@ Version history * http: end-to-end HTTP flow control is now complete across both connections, streams, and filters. * load balancer: added :ref:`subset load balancer `. * load balancer: added ring size and hash :ref:`configuration options - `. This used to be configurable via runtime. The runtime + `. This used to be configurable via runtime. The runtime configuration was deleted without deprecation as we are fairly certain no one is using it. * log: added the ability to optionally log to a file instead of stderr via the :option:`--log-path` option. -* listeners: added :ref:`drain_type ` option. +* listeners: added :ref:`drain_type ` option. * lua: added experimental :ref:`Lua filter `. * mongo filter: added :ref:`fault injection `. * mongo filter: added :ref:`"drain close" ` support. @@ -35,20 +35,20 @@ Version history production ready. * redis: added :ref:`"drain close" ` functionality. * router: added :ref:`x-envoy-overloaded ` support. -* router: added :ref:`regex ` route matching. +* router: added :ref:`regex ` route matching. * router: added :ref:`custom request headers ` for upstream requests. * router: added :ref:`downstream IP hashing - ` for HTTP ketama routing. -* router: added :ref:`cookie hashing `. + ` for HTTP ketama routing. +* router: added :ref:`cookie hashing `. * router: added :ref:`start_child_span ` option to create child span for egress calls. * router: added optional :ref:`upstream logs `. * router: added complete :ref:`custom append/override/remove support ` of request/response headers. * router: added support to :ref:`specify response code during redirect - `. -* router: added :ref:`configuration ` + `. +* router: added :ref:`configuration ` to return either a 404 or 503 if the upstream cluster does not exist. * runtime: added :ref:`comment capability `. * server: change default log level (:option:`-l`) to `info`. @@ -60,11 +60,11 @@ Version history * tcp proxy: enable use of :ref:`outlier detector `. * tls: added :ref:`SNI support `. * tls: added support for specifying :ref:`TLS session ticket keys - `. + `. * tls: allow configuration of the :ref:`min - ` and :ref:`max - ` TLS protocol versions. -* tracing: added :ref:`custom trace span decorators `. + ` and :ref:`max + ` TLS protocol versions. +* tracing: added :ref:`custom trace span decorators `. * Many small bug fixes and performance improvements not listed. 1.4.0 diff --git a/docs/root/operations/admin.rst b/docs/root/operations/admin.rst index 34392811a..59c36af83 100644 --- a/docs/root/operations/admin.rst +++ b/docs/root/operations/admin.rst @@ -7,7 +7,7 @@ Envoy exposes a local administration interface that can be used to query and modify different aspects of the server: * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` .. http:get:: / diff --git a/docs/root/operations/cli.rst b/docs/root/operations/cli.rst index 2224f3ba0..1bc94daf0 100644 --- a/docs/root/operations/cli.rst +++ b/docs/root/operations/cli.rst @@ -90,7 +90,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service cluster name where Envoy is running. The local service cluster name is first sourced from the :ref:`Bootstrap node - ` message's :ref:`cluster + ` message's :ref:`cluster ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if any of the following features are used: @@ -107,7 +107,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service node name where Envoy is running. The local service node name is first sourced from the :ref:`Bootstrap node - ` message's :ref:`id + ` message's :ref:`id ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if any of the following features are used: @@ -120,7 +120,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service zone where Envoy is running. The local service zone is first sourced from the :ref:`Bootstrap node - ` message's :ref:`locality.zone + ` message's :ref:`locality.zone ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if discovery service routing is diff --git a/envoy/api/v2/BUILD b/envoy/api/v2/BUILD index 490b13454..d98ef27a3 100644 --- a/envoy/api/v2/BUILD +++ b/envoy/api/v2/BUILD @@ -126,7 +126,7 @@ api_go_proto_library( ) # TODO(htuch): Grow this to cover everything we want to generate docs for, so we can just invoke -# bazel build //envoy/api/v2 --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst +# bazel build //envoy/api/v2:api --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst proto_library( name = "api", deps = [ @@ -134,7 +134,7 @@ proto_library( ":protocol", ":rls", "//envoy/api/v2/bootstrap", - "//envoy/api/v2/cluster", + "//envoy/api/v2/cluster:cluster_docs", "//envoy/api/v2/discovery", "//envoy/api/v2/filter/accesslog", "//envoy/api/v2/filter/http", diff --git a/envoy/api/v2/bootstrap/BUILD b/envoy/api/v2/bootstrap/BUILD index 8f94352ed..f6a608f90 100644 --- a/envoy/api/v2/bootstrap/BUILD +++ b/envoy/api/v2/bootstrap/BUILD @@ -13,7 +13,7 @@ api_proto_library( "//envoy/api/v2:stats", "//envoy/api/v2:trace", "//envoy/api/v2/cert", - "//envoy/api/v2/cluster:cluster_def", + "//envoy/api/v2/cluster", "//envoy/api/v2/listener", ], ) @@ -29,7 +29,7 @@ api_go_proto_library( "//envoy/api/v2:stats_go_proto", "//envoy/api/v2:trace_go_proto", "//envoy/api/v2/cert:cert_go_proto", - "//envoy/api/v2/cluster:cluster_def_go_proto", + "//envoy/api/v2/cluster:cluster_go_proto", "//envoy/api/v2/listener:listener_go_proto", ], ) diff --git a/envoy/api/v2/bootstrap/bootstrap.proto b/envoy/api/v2/bootstrap/bootstrap.proto index d90153306..bedfd8f04 100644 --- a/envoy/api/v2/bootstrap/bootstrap.proto +++ b/envoy/api/v2/bootstrap/bootstrap.proto @@ -30,12 +30,12 @@ message Bootstrap { Node node = 1; message StaticResources { - // Static :ref:`Listeners `. These listeners are + // Static :ref:`Listeners `. These listeners are // available regardless of LDS configuration. repeated listener.Listener listeners = 1; // If a network based configuration source is specified for :ref:`cds_config - // `, it's necessary + // `, it's necessary // to have some initial cluster definitions available to allow Envoy to know // how to speak to the management server. These cluster definitions may not // use :ref:`EDS ` (i.e. they should be static @@ -49,11 +49,11 @@ message Bootstrap { StaticResources static_resources = 2; message DynamicResources { - // All :ref:`Listeners ` are provided by a single + // All :ref:`Listeners ` are provided by a single // :ref:`LDS ` configuration source. ConfigSource lds_config = 1; - // All post-bootstrap :ref:`Cluster ` definitions are + // All post-bootstrap :ref:`Cluster ` definitions are // provided by a single :ref:`CDS ` // configuration source. ConfigSource cds_config = 2; @@ -141,7 +141,7 @@ message ClusterManager { // If *local_cluster_name* is defined then :ref:`clusters // ` must be defined in the :ref:`Bootstrap // static cluster resources - // `. This is unrelated to + // `. This is unrelated to // the :option:`--service-cluster` option which does not `affect zone aware // routing `_. string local_cluster_name = 1; diff --git a/envoy/api/v2/cert/cert.proto b/envoy/api/v2/cert/cert.proto index 3a5524510..5e5ca8be4 100644 --- a/envoy/api/v2/cert/cert.proto +++ b/envoy/api/v2/cert/cert.proto @@ -92,7 +92,7 @@ message TlsSessionTicketKeys { // All keys are candidates for decrypting received tickets. This allows for easy rotation of keys // by, for example, putting the new key first, and the previous key second. // - // If :ref:`session_ticket_keys ` is not + // If :ref:`session_ticket_keys ` is not // specified, the TLS library will still support resuming // sessions via tickets, but it will use an internally-generated and managed key, so sessions // cannot be resumed across hot restarts or on different hosts. @@ -119,11 +119,11 @@ message CertificateValidationContext { // for listeners). If not specified and a peer certificate is presented it will not be // verified. By default, a client certificate is optional, unless one of the additional // options (:ref:`require_client_certificate - // `, + // `, // :ref:`verify_certificate_hash - // `, or + // `, or // :ref:`verify_subject_alt_name - // `) is also specified. + // `) is also specified. // // See :ref:`the TLS overview ` for a list of common // system CA locations. diff --git a/envoy/api/v2/cluster/BUILD b/envoy/api/v2/cluster/BUILD index 7ed304f65..dcb6d241c 100644 --- a/envoy/api/v2/cluster/BUILD +++ b/envoy/api/v2/cluster/BUILD @@ -29,7 +29,7 @@ api_go_proto_library( ) api_proto_library( - name = "cluster_def", + name = "cluster", srcs = ["cluster.proto"], deps = [ ":circuit_breaker", @@ -44,8 +44,8 @@ api_proto_library( ) api_go_proto_library( - name = "cluster_def", - proto = ":cluster_def", + name = "cluster", + proto = ":cluster", deps = [ ":circuit_breaker_go_proto", ":outlier_detection_go_proto", @@ -59,11 +59,11 @@ api_go_proto_library( ) proto_library( - name = "cluster", + name = "cluster_docs", visibility = ["//envoy/api/v2:__pkg__"], deps = [ ":circuit_breaker", - ":cluster_def", + ":cluster", ":outlier_detection", ], ) diff --git a/envoy/api/v2/cluster/circuit_breaker.proto b/envoy/api/v2/cluster/circuit_breaker.proto index 376f8a605..06c19abd1 100644 --- a/envoy/api/v2/cluster/circuit_breaker.proto +++ b/envoy/api/v2/cluster/circuit_breaker.proto @@ -6,6 +6,8 @@ import "envoy/api/v2/base.proto"; import "google/protobuf/wrappers.proto"; +// [#protodoc-title: Circuit breakers] + // :ref:`Circuit breaking` settings can be // specified individually for each defined priority. message CircuitBreakers { @@ -36,7 +38,7 @@ message CircuitBreakers { google.protobuf.UInt32Value max_retries = 5; } - // If multiple :ref:`Thresholds` + // If multiple :ref:`Thresholds` // are defined with the same :ref:`RoutingPriority`, // the first one in the list is used. If no Thresholds is defined for a given // :ref:`RoutingPriority`, the default values diff --git a/envoy/api/v2/cluster/cluster.proto b/envoy/api/v2/cluster/cluster.proto index b14b8a8ad..a6558088e 100644 --- a/envoy/api/v2/cluster/cluster.proto +++ b/envoy/api/v2/cluster/cluster.proto @@ -19,7 +19,7 @@ import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; import "gogoproto/gogo.proto"; -// [#protodoc-title: Clusters and CDS] +// [#protodoc-title: Clusters] message Cluster { // Supplies the name of the cluster which must be unique across all clusters. @@ -119,9 +119,9 @@ message Cluster { LbPolicy lb_policy = 6 [(validate.rules).enum.defined_only = true]; // If the service discovery type is - // :ref:`STATIC`, - // :ref:`STRICT_DNS` - // or :ref:`LOGICAL_DNS`, + // :ref:`STATIC`, + // :ref:`STRICT_DNS` + // or :ref:`LOGICAL_DNS`, // then hosts is required. repeated Address hosts = 7; @@ -146,7 +146,7 @@ message Cluster { // .. attention:: // // Server certificate verification is not enabled by default. Configure - // :ref:`trusted_ca` to enable + // :ref:`trusted_ca` to enable // verification. cert.UpstreamTlsContext tls_context = 11; @@ -166,13 +166,13 @@ message Cluster { reserved 15; // If the DNS refresh rate is specified and the cluster type is either - // :ref:`STRICT_DNS`, - // or :ref:`LOGICAL_DNS`, + // :ref:`STRICT_DNS`, + // or :ref:`LOGICAL_DNS`, // this value is used as the cluster’s DNS refresh // rate. If this setting is not specified, the value defaults to 5000. For // cluster types other than - // :ref:`STRICT_DNS` - // and :ref:`LOGICAL_DNS` + // :ref:`STRICT_DNS` + // and :ref:`LOGICAL_DNS` // this setting is ignored. google.protobuf.Duration dns_refresh_rate = 16 [(validate.rules).duration.gt = {}, (gogoproto.stdduration) = true]; @@ -183,8 +183,8 @@ message Cluster { // specified, the DNS resolver will first perform a lookup for addresses in // the IPv6 family and fallback to a lookup for addresses in the IPv4 family. // For cluster types other than - // :ref:`STRICT_DNS` and - // :ref:`LOGICAL_DNS`, + // :ref:`STRICT_DNS` and + // :ref:`LOGICAL_DNS`, // this setting is // ignored. enum DnsLookupFamily { @@ -195,18 +195,18 @@ message Cluster { // The DNS IP address resolution policy. If this setting is not specified, the // value defaults to - // :ref:`AUTO`. + // :ref:`AUTO`. DnsLookupFamily dns_lookup_family = 17 [(validate.rules).enum.defined_only = true]; // If DNS resolvers are specified and the cluster type is either - // :ref:`STRICT_DNS`, - // or :ref:`LOGICAL_DNS`, + // :ref:`STRICT_DNS`, + // or :ref:`LOGICAL_DNS`, // this value is used to specify the cluster’s dns resolvers. // If this setting is not specified, the value defaults to the default // resolver, which uses /etc/resolv.conf for configuration. For cluster types // other than - // :ref:`STRICT_DNS` - // and :ref:`LOGICAL_DNS` + // :ref:`STRICT_DNS` + // and :ref:`LOGICAL_DNS` // this setting is ignored. repeated Address dns_resolvers = 18; @@ -216,7 +216,7 @@ message Cluster { OutlierDetection outlier_detection = 19; // The interval for removing stale hosts from a cluster type - // :ref:`ORIGINAL_DST`. + // :ref:`ORIGINAL_DST`. // Hosts are considered stale if they have not been used // as upstream destinations during this interval. New hosts are added // to original destination clusters on demand as new connections are @@ -226,7 +226,7 @@ message Cluster { // them remain open, saving the latency that would otherwise be spent // on opening new connections. If this setting is not specified, the // value defaults to 5000ms. For cluster types other than - // :ref:`ORIGINAL_DST` + // :ref:`ORIGINAL_DST` // this setting is ignored. google.protobuf.Duration cleanup_interval = 20 [(validate.rules).duration.gt = {}, (gogoproto.stdduration) = true]; @@ -253,17 +253,17 @@ message Cluster { // The behavior used when no endpoint subset matches the selected route's // metadata. The value defaults to - // :ref:`NO_FALLBACK`. + // :ref:`NO_FALLBACK`. LbSubsetFallbackPolicy fallback_policy = 1 [(validate.rules).enum.defined_only = true]; // Specifies the default subset of endpoints used during fallback if // fallback_policy is - // :ref:`DEFAULT_SUBSET`. + // :ref:`DEFAULT_SUBSET`. // Each field in default_subset is // compared to the matching LbEndpoint.Metadata under the *envoy.lb* // namespace. It is valid for no hosts to match, in which case the behavior // is the same as a fallback_policy of - // :ref:`NO_FALLBACK`. + // :ref:`NO_FALLBACK`. google.protobuf.Struct default_subset = 2; // Specifications for subsets. @@ -317,10 +317,10 @@ message Cluster { // Optional configuration for the load balancing algorithm selected by // LbPolicy. Currently only - // :ref:`RING_HASH` + // :ref:`RING_HASH` // has additional configuration options. // Specifying ring_hash_lb_config without setting the LbPolicy to - // :ref:`RING_HASH` + // :ref:`RING_HASH` // will generate an error at runtime. oneof lb_config { // Optional configuration for the Ring Hash load balancing policy. @@ -339,7 +339,7 @@ message Cluster { enum ClusterProtocolSelection { // Cluster can only operate on one of the possible upstream protocols (HTTP1.1, HTTP2). - // If :ref:`http2_protocol_options ` are + // If :ref:`http2_protocol_options ` are // present, HTTP2 will be used, otherwise HTTP1.1 will be used. USE_CONFIGURED_PROTOCOL = 0; // Use HTTP1.1 or HTTP2, depending on which one is used on the downstream connection. diff --git a/envoy/api/v2/cluster/outlier_detection.proto b/envoy/api/v2/cluster/outlier_detection.proto index ab85ae199..0eeeda6cf 100644 --- a/envoy/api/v2/cluster/outlier_detection.proto +++ b/envoy/api/v2/cluster/outlier_detection.proto @@ -7,6 +7,8 @@ import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; +// [#protodoc-title: Outlier detection] + // See the :ref:`architecture overview ` for // more information on outlier detection. message OutlierDetection { diff --git a/envoy/api/v2/discovery/BUILD b/envoy/api/v2/discovery/BUILD index a55a11b7a..5ff6dbb63 100644 --- a/envoy/api/v2/discovery/BUILD +++ b/envoy/api/v2/discovery/BUILD @@ -151,5 +151,6 @@ proto_library( ":eds", ":lds", ":rds", + ":sds", ], ) diff --git a/envoy/api/v2/discovery/eds.proto b/envoy/api/v2/discovery/eds.proto index 310414466..5c5289dbf 100644 --- a/envoy/api/v2/discovery/eds.proto +++ b/envoy/api/v2/discovery/eds.proto @@ -151,7 +151,7 @@ message EndpointLoadMetricStats { // These are stats Envoy reports to GLB every so often. Report frequency is // defined by -// :ref:`LoadStatsResponse.load_reporting_interval`. +// :ref:`LoadStatsResponse.load_reporting_interval`. // Stats per upstream region/zone and optionally per subzone. // [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. message UpstreamLocalityStats { @@ -199,7 +199,7 @@ message UpstreamLocalityStats { } // Per cluster load stats. Envoy reports these stats a management server in a -// :ref:`LoadStatsRequest` +// :ref:`LoadStatsRequest` // [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. message ClusterStats { // The name of the cluster. @@ -244,9 +244,9 @@ message LoadStatsRequest { // load_balancing_weight of its Locality. message ClusterLoadAssignment { // Name of the cluster. This will be the :ref:`service_name - // ` value if specified + // ` value if specified // in the cluster :ref:`EdsClusterConfig - // `. + // `. string cluster_name = 1 [(validate.rules).string.min_bytes = 1]; // List of endpoints to load balance to. diff --git a/envoy/api/v2/filter/network/tcp_proxy.proto b/envoy/api/v2/filter/network/tcp_proxy.proto index 8ed14a4d6..42d8458e7 100644 --- a/envoy/api/v2/filter/network/tcp_proxy.proto +++ b/envoy/api/v2/filter/network/tcp_proxy.proto @@ -25,7 +25,7 @@ message TcpProxy { // // Once full filter chain matching is implemented in listeners, this field will become the only // way to configure the target cluster. All other matching will be done via :ref:`filter chain - // matching rules `. For very simple configurations, this field + // matching rules `. For very simple configurations, this field // can still be used to select the cluster when no other matching rules are required. Otherwise, // a :ref:`deprecated_v1 ` configuration // is required to use more complex routing in the interim. @@ -55,7 +55,7 @@ message TcpProxy { // TCP Proxy filter configuration using V1 format, until Envoy gets the // ability to match source/destination at the listener level (called - // :ref:`filter chain match `). + // :ref:`filter chain match `). message DeprecatedV1 { // A TCP proxy route consists of a set of optional L4 criteria and the // name of a cluster. If a downstream connection matches all the diff --git a/envoy/api/v2/grpc_service.proto b/envoy/api/v2/grpc_service.proto index e8434941b..ab3e80673 100644 --- a/envoy/api/v2/grpc_service.proto +++ b/envoy/api/v2/grpc_service.proto @@ -16,8 +16,8 @@ import "validate/validate.proto"; message GrpcService { message EnvoyGrpc { // The name of the upstream gRPC cluster. SSL credentials will be supplied - // in the :ref:`Cluster ` :ref:`tls_context - // `. + // in the :ref:`Cluster ` :ref:`tls_context + // `. string cluster_name = 1 [(validate.rules).string.min_bytes = 1]; } diff --git a/envoy/api/v2/listener/listener.proto b/envoy/api/v2/listener/listener.proto index 8d3dd93cc..5d30ca820 100644 --- a/envoy/api/v2/listener/listener.proto +++ b/envoy/api/v2/listener/listener.proto @@ -12,7 +12,7 @@ import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; -// [#protodoc-title: Listeners and LDS] +// [#protodoc-title: Listeners] // Listener :ref:`configuration overview ` message Listener { @@ -30,15 +30,15 @@ message Listener { Address address = 2 [(validate.rules).message.required = true]; // A list of filter chains to consider for this listener. The - // :ref:`FilterChain ` with the most specific :ref:`FilterChainMatch - // ` criteria is used on a connection. + // :ref:`FilterChain ` with the most specific :ref:`FilterChainMatch + // ` criteria is used on a connection. // // .. attention:: // // In the current version, multiple filter chains are supported **only** so that SNI can be // configured. See the :ref:`FAQ entry ` on how to configure SNI for more // information. When multiple filter chains are configured, each filter chain must have an - // **identical** set of :ref:`filters `. If the filters + // **identical** set of :ref:`filters `. If the filters // differ, the configuration will fail to load. In the future, this limitation will be relaxed // such that different filters can be used depending on which filter chain matches (based on SNI // or some other parameter). diff --git a/envoy/api/v2/route/route.proto b/envoy/api/v2/route/route.proto index 3884ff5b6..4f98baab0 100644 --- a/envoy/api/v2/route/route.proto +++ b/envoy/api/v2/route/route.proto @@ -12,7 +12,7 @@ import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; import "gogoproto/gogo.proto"; -// [#protodoc-title: HTTP route management and RDS] +// [#protodoc-title: HTTP route management] // * Routing :ref:`architecture overview ` // * HTTP :ref:`router filter ` @@ -33,8 +33,8 @@ message RouteConfiguration { // Specifies a list of HTTP headers that should be added to each response that // the connection manager encodes. Headers specified at this level are applied - // after headers from any enclosed :ref:`envoy_api_msg_VirtualHost` or - // :ref:`envoy_api_msg_RouteAction`. + // after headers from any enclosed :ref:`envoy_api_msg_route.VirtualHost` or + // :ref:`envoy_api_msg_route.RouteAction`. repeated HeaderValueOption response_headers_to_add = 4; // Specifies a list of HTTP headers that should be removed from each response @@ -43,8 +43,8 @@ message RouteConfiguration { // Specifies a list of HTTP headers that should be added to each request // routed by the HTTP connection manager. Headers specified at this level are - // applied after headers from any enclosed :ref:`envoy_api_msg_VirtualHost` or - // :ref:`envoy_api_msg_RouteAction`. For more information see the documentation on + // applied after headers from any enclosed :ref:`envoy_api_msg_route.VirtualHost` or + // :ref:`envoy_api_msg_route.RouteAction`. For more information see the documentation on // :ref:`custom request headers `. repeated HeaderValueOption request_headers_to_add = 6; @@ -118,15 +118,15 @@ message VirtualHost { // Specifies a list of HTTP headers that should be added to each request // handled by this virtual host. Headers specified at this level are applied - // after headers from enclosed :ref:`envoy_api_msg_RouteAction` and before headers from the - // enclosing :ref:`envoy_api_msg_RouteConfiguration`. For more information see the documentation + // after headers from enclosed :ref:`envoy_api_msg_route.RouteAction` and before headers from the + // enclosing :ref:`envoy_api_msg_route.RouteConfiguration`. For more information see the documentation // on :ref:`custom request headers `. repeated HeaderValueOption request_headers_to_add = 7; // Specifies a list of HTTP headers that should be added to each response // handled by this virtual host. Headers specified at this level are applied - // after headers from enclosed :ref:`envoy_api_msg_RouteAction` and before headers from the - // enclosing :ref:`envoy_api_msg_RouteConfiguration`. + // after headers from enclosed :ref:`envoy_api_msg_route.RouteAction` and before headers from the + // enclosing :ref:`envoy_api_msg_route.RouteConfiguration`. repeated HeaderValueOption response_headers_to_add = 10; // Specifies a list of HTTP headers that should be removed from each response @@ -147,7 +147,7 @@ message VirtualHost { // .. attention:: // // Envoy supports routing on HTTP method via :ref:`header matching -// `. +// `. message Route { // Route matching parameters. RouteMatch match = 1 [(validate.rules).message.required = true]; @@ -180,9 +180,9 @@ message Route { auth.AuthAction auth = 6; } -// Compared to the :ref:`cluster ` field that specifies a +// Compared to the :ref:`cluster ` field that specifies a // single upstream cluster as the target of a request, the :ref:`weighted_clusters -// ` option allows for specification of +// ` option allows for specification of // multiple upstream clusters along with weights that indicate the percentage of // traffic to be forwarded to each cluster. The router selects an upstream cluster based on the // weights. @@ -389,7 +389,7 @@ message RouteAction { // .. note:: // // If left unspecified, Envoy will use the global - // :ref:`route timeout ` for the request. + // :ref:`route timeout ` for the request. // Consequently, when using a :ref:`5xx ` based // retry policy, a request that times out will not be retried as the total timeout budget // would have been exhausted. @@ -430,15 +430,15 @@ message RouteAction { // Specifies a set of headers that will be added to requests matching this // route. Headers specified at this level are applied before headers from the - // enclosing :ref:`envoy_api_msg_VirtualHost` and :ref:`envoy_api_msg_RouteConfiguration`. + // enclosing :ref:`envoy_api_msg_route.VirtualHost` and :ref:`envoy_api_msg_route.RouteConfiguration`. // For more information see the documentation on :ref:`custom request headers // `. repeated HeaderValueOption request_headers_to_add = 12; // Specifies a set of headers that will be added to responses to requests // matching this route. Headers specified at this level are applied before - // headers from the enclosing :ref:`envoy_api_msg_VirtualHost` and - // :ref:`envoy_api_msg_RouteConfiguration`. + // headers from the enclosing :ref:`envoy_api_msg_route.VirtualHost` and + // :ref:`envoy_api_msg_route.RouteConfiguration`. repeated HeaderValueOption response_headers_to_add = 18; // Specifies a list of HTTP headers that should be removed from each response @@ -451,7 +451,7 @@ message RouteAction { // Specifies if the rate limit filter should include the virtual host rate // limits. By default, if the route configured rate limits, the virtual host - // :ref:`rate_limits ` are not applied to the request. + // :ref:`rate_limits ` are not applied to the request. google.protobuf.BoolValue include_vh_rate_limits = 14; // Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer @@ -580,7 +580,7 @@ message DirectResponseAction { // .. note:: // // Headers can be specified using *response_headers_to_add* in - // :ref:`envoy_api_msg_RouteConfiguration`. + // :ref:`envoy_api_msg_route.RouteConfiguration`. DataSource body = 2; } @@ -669,14 +669,14 @@ message RateLimit { // ("destination_cluster", "") // // Once a request matches against a route table rule, a routed cluster is determined by one of - // the following :ref:`route table configuration ` + // the following :ref:`route table configuration ` // settings: // - // * :ref:`cluster ` indicates the upstream cluster + // * :ref:`cluster ` indicates the upstream cluster // to route to. - // * :ref:`weighted_clusters ` + // * :ref:`weighted_clusters ` // chooses a cluster randomly from a set of clusters with attributed weight. - // * :ref:`cluster_header ` indicates which + // * :ref:`cluster_header ` indicates which // header in the request contains the target cluster. message DestinationCluster { } diff --git a/envoy/api/v2/trace.proto b/envoy/api/v2/trace.proto index ca5a2d3aa..005906ca8 100644 --- a/envoy/api/v2/trace.proto +++ b/envoy/api/v2/trace.proto @@ -11,8 +11,8 @@ import "validate/validate.proto"; // The tracing configuration specifies global // settings for the HTTP tracer used by Envoy. The configuration is defined by -// the :ref:`Bootstrap ` :ref:`tracing -// ` field. Envoy may support other tracers +// the :ref:`Bootstrap ` :ref:`tracing +// ` field. Envoy may support other tracers // in the future, but right now the HTTP tracer is the only one supported. message Tracing { message Http { @@ -44,7 +44,7 @@ message LightstepConfig { message ZipkinConfig { // The cluster manager cluster that hosts the Zipkin collectors. Note that the // Zipkin cluster must be defined in the :ref:`Bootstrap static cluster - // resources `. + // resources `. string collector_cluster = 1 [(validate.rules).string.min_bytes = 1]; // The API endpoint of the Zipkin service where the spans will be sent. When From 898199591af6dd4b058d6207febbae15fa9cedd0 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 17 Jan 2018 15:35:07 -0800 Subject: [PATCH 14/47] fix format Signed-off-by: Kuat Yessenov --- envoy/api/v2/cert/cert.proto | 11 ++++++----- envoy/api/v2/filter/network/tcp_proxy.proto | 8 ++++---- envoy/api/v2/listener/listener.proto | 13 +++++++------ envoy/api/v2/route/route.proto | 14 ++++++++------ 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/envoy/api/v2/cert/cert.proto b/envoy/api/v2/cert/cert.proto index 5e5ca8be4..b97c6ba5e 100644 --- a/envoy/api/v2/cert/cert.proto +++ b/envoy/api/v2/cert/cert.proto @@ -92,10 +92,10 @@ message TlsSessionTicketKeys { // All keys are candidates for decrypting received tickets. This allows for easy rotation of keys // by, for example, putting the new key first, and the previous key second. // - // If :ref:`session_ticket_keys ` is not - // specified, the TLS library will still support resuming - // sessions via tickets, but it will use an internally-generated and managed key, so sessions - // cannot be resumed across hot restarts or on different hosts. + // If :ref:`session_ticket_keys ` + // is not specified, the TLS library will still support resuming sessions via tickets, but it will + // use an internally-generated and managed key, so sessions cannot be resumed across hot restarts + // or on different hosts. // // Each key must contain exactly 80 bytes of cryptographically-secure random data. For // example, the output of ``openssl rand 80``. @@ -123,7 +123,8 @@ message CertificateValidationContext { // :ref:`verify_certificate_hash // `, or // :ref:`verify_subject_alt_name - // `) is also specified. + // `) is also + // specified. // // See :ref:`the TLS overview ` for a list of common // system CA locations. diff --git a/envoy/api/v2/filter/network/tcp_proxy.proto b/envoy/api/v2/filter/network/tcp_proxy.proto index 42d8458e7..189dbcd13 100644 --- a/envoy/api/v2/filter/network/tcp_proxy.proto +++ b/envoy/api/v2/filter/network/tcp_proxy.proto @@ -25,10 +25,10 @@ message TcpProxy { // // Once full filter chain matching is implemented in listeners, this field will become the only // way to configure the target cluster. All other matching will be done via :ref:`filter chain - // matching rules `. For very simple configurations, this field - // can still be used to select the cluster when no other matching rules are required. Otherwise, - // a :ref:`deprecated_v1 ` configuration - // is required to use more complex routing in the interim. + // matching rules `. For very simple configurations, + // this field can still be used to select the cluster when no other matching rules are required. + // Otherwise, a :ref:`deprecated_v1 ` + // configuration is required to use more complex routing in the interim. // string cluster = 2; diff --git a/envoy/api/v2/listener/listener.proto b/envoy/api/v2/listener/listener.proto index 5d30ca820..e9b132feb 100644 --- a/envoy/api/v2/listener/listener.proto +++ b/envoy/api/v2/listener/listener.proto @@ -30,18 +30,19 @@ message Listener { Address address = 2 [(validate.rules).message.required = true]; // A list of filter chains to consider for this listener. The - // :ref:`FilterChain ` with the most specific :ref:`FilterChainMatch - // ` criteria is used on a connection. + // :ref:`FilterChain ` with the most specific + // :ref:`FilterChainMatch ` criteria is used on a + // connection. // // .. attention:: // // In the current version, multiple filter chains are supported **only** so that SNI can be // configured. See the :ref:`FAQ entry ` on how to configure SNI for more // information. When multiple filter chains are configured, each filter chain must have an - // **identical** set of :ref:`filters `. If the filters - // differ, the configuration will fail to load. In the future, this limitation will be relaxed - // such that different filters can be used depending on which filter chain matches (based on SNI - // or some other parameter). + // **identical** set of :ref:`filters `. If the + // filters differ, the configuration will fail to load. In the future, this limitation will be + // relaxed such that different filters can be used depending on which filter chain matches + // (based on SNI or some other parameter). repeated FilterChain filter_chains = 3 [(validate.rules).repeated .min_items = 1]; // If a connection is redirected using *iptables*, the port on which the proxy diff --git a/envoy/api/v2/route/route.proto b/envoy/api/v2/route/route.proto index 4f98baab0..d58a05c10 100644 --- a/envoy/api/v2/route/route.proto +++ b/envoy/api/v2/route/route.proto @@ -119,8 +119,9 @@ message VirtualHost { // Specifies a list of HTTP headers that should be added to each request // handled by this virtual host. Headers specified at this level are applied // after headers from enclosed :ref:`envoy_api_msg_route.RouteAction` and before headers from the - // enclosing :ref:`envoy_api_msg_route.RouteConfiguration`. For more information see the documentation - // on :ref:`custom request headers `. + // enclosing :ref:`envoy_api_msg_route.RouteConfiguration`. For more information see the + // documentation on :ref:`custom request headers + // `. repeated HeaderValueOption request_headers_to_add = 7; // Specifies a list of HTTP headers that should be added to each response @@ -430,9 +431,9 @@ message RouteAction { // Specifies a set of headers that will be added to requests matching this // route. Headers specified at this level are applied before headers from the - // enclosing :ref:`envoy_api_msg_route.VirtualHost` and :ref:`envoy_api_msg_route.RouteConfiguration`. - // For more information see the documentation on :ref:`custom request headers - // `. + // enclosing :ref:`envoy_api_msg_route.VirtualHost` and + // :ref:`envoy_api_msg_route.RouteConfiguration`. For more information see the documentation on + // :ref:`custom request headers `. repeated HeaderValueOption request_headers_to_add = 12; // Specifies a set of headers that will be added to responses to requests @@ -451,7 +452,8 @@ message RouteAction { // Specifies if the rate limit filter should include the virtual host rate // limits. By default, if the route configured rate limits, the virtual host - // :ref:`rate_limits ` are not applied to the request. + // :ref:`rate_limits ` are not applied to the + // request. google.protobuf.BoolValue include_vh_rate_limits = 14; // Specifies the route's hashing policy if the upstream cluster uses a hashing :ref:`load balancer From ee86b83060d01dc68f6cd579ce7f75c10e89f0ff Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Thu, 18 Jan 2018 14:21:15 -0800 Subject: [PATCH 15/47] package monitoring Signed-off-by: Kuat Yessenov --- envoy/api/v2/BUILD | 44 ++-------------- envoy/api/v2/bootstrap/BUILD | 8 +-- envoy/api/v2/bootstrap/bootstrap.proto | 10 ++-- envoy/api/v2/cluster/BUILD | 10 ---- envoy/api/v2/monitoring/BUILD | 51 +++++++++++++++++++ .../v2/{ => monitoring}/metrics_service.proto | 2 +- envoy/api/v2/{ => monitoring}/stats.proto | 2 +- envoy/api/v2/{ => monitoring}/trace.proto | 2 +- test/build/BUILD | 2 +- test/build/build_test.cc | 4 +- 10 files changed, 70 insertions(+), 65 deletions(-) create mode 100644 envoy/api/v2/monitoring/BUILD rename envoy/api/v2/{ => monitoring}/metrics_service.proto (97%) rename envoy/api/v2/{ => monitoring}/stats.proto (99%) rename envoy/api/v2/{ => monitoring}/trace.proto (98%) diff --git a/envoy/api/v2/BUILD b/envoy/api/v2/BUILD index d98ef27a3..d496b3d9a 100644 --- a/envoy/api/v2/BUILD +++ b/envoy/api/v2/BUILD @@ -66,18 +66,6 @@ api_go_proto_library( deps = [":base_go_proto"], ) -api_proto_library( - name = "metrics", - srcs = ["metrics_service.proto"], - has_services = 1, - require_py = 0, - deps = [ - ":base", - ":grpc_service", - "@promotheus_metrics_model//:client_model", - ], -) - api_proto_library( name = "protocol", srcs = ["protocol.proto"], @@ -99,47 +87,23 @@ api_go_grpc_library( proto = ":rls", ) -api_proto_library( - name = "stats", - srcs = ["stats.proto"], - deps = [ - ":address", - ], -) - -api_go_proto_library( - name = "stats", - proto = ":stats", - deps = [ - ":address_go_proto", - ], -) - -api_proto_library( - name = "trace", - srcs = ["trace.proto"], -) - -api_go_proto_library( - name = "trace", - proto = ":trace", -) - # TODO(htuch): Grow this to cover everything we want to generate docs for, so we can just invoke # bazel build //envoy/api/v2:api --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst proto_library( name = "api", deps = [ - ":metrics", ":protocol", ":rls", "//envoy/api/v2/bootstrap", - "//envoy/api/v2/cluster:cluster_docs", + "//envoy/api/v2/cluster", + "//envoy/api/v2/cluster:outlier_detection", + "//envoy/api/v2/cluster:circuit_breaker", "//envoy/api/v2/discovery", "//envoy/api/v2/filter/accesslog", "//envoy/api/v2/filter/http", "//envoy/api/v2/filter/network", "//envoy/api/v2/listener", + "//envoy/api/v2/monitoring:metrics", "//envoy/api/v2/route", ], ) diff --git a/envoy/api/v2/bootstrap/BUILD b/envoy/api/v2/bootstrap/BUILD index f6a608f90..4957c34bd 100644 --- a/envoy/api/v2/bootstrap/BUILD +++ b/envoy/api/v2/bootstrap/BUILD @@ -10,11 +10,11 @@ api_proto_library( "//envoy/api/v2:base", "//envoy/api/v2:config_source", "//envoy/api/v2:grpc_service", - "//envoy/api/v2:stats", - "//envoy/api/v2:trace", "//envoy/api/v2/cert", "//envoy/api/v2/cluster", "//envoy/api/v2/listener", + "//envoy/api/v2/monitoring:stats", + "//envoy/api/v2/monitoring:trace", ], ) @@ -26,10 +26,10 @@ api_go_proto_library( "//envoy/api/v2:base_go_proto", "//envoy/api/v2:config_source_go_proto", "//envoy/api/v2:grpc_service_go_proto", - "//envoy/api/v2:stats_go_proto", - "//envoy/api/v2:trace_go_proto", "//envoy/api/v2/cert:cert_go_proto", "//envoy/api/v2/cluster:cluster_go_proto", "//envoy/api/v2/listener:listener_go_proto", + "//envoy/api/v2/monitoring:stats_go_proto", + "//envoy/api/v2/monitoring:trace_go_proto", ], ) diff --git a/envoy/api/v2/bootstrap/bootstrap.proto b/envoy/api/v2/bootstrap/bootstrap.proto index bedfd8f04..261da6918 100644 --- a/envoy/api/v2/bootstrap/bootstrap.proto +++ b/envoy/api/v2/bootstrap/bootstrap.proto @@ -15,8 +15,8 @@ import "envoy/api/v2/cluster/cluster.proto"; import "envoy/api/v2/grpc_service.proto"; import "envoy/api/v2/listener/listener.proto"; import "envoy/api/v2/cert/cert.proto"; -import "envoy/api/v2/stats.proto"; -import "envoy/api/v2/trace.proto"; +import "envoy/api/v2/monitoring/stats.proto"; +import "envoy/api/v2/monitoring/trace.proto"; import "google/protobuf/duration.proto"; @@ -87,10 +87,10 @@ message Bootstrap { string flags_path = 5; // Optional set of stats sinks. - repeated StatsSink stats_sinks = 6; + repeated monitoring.StatsSink stats_sinks = 6; // Configuration for internal processing of stats. - StatsConfig stats_config = 13; + monitoring.StatsConfig stats_config = 13; // Optional duration between flushes to configured stats sinks. For // performance reasons Envoy latches counters and only flushes counters and @@ -103,7 +103,7 @@ message Bootstrap { // Configuration for an external tracing provider. If not specified, no // tracing will be performed. - Tracing tracing = 9; + monitoring.Tracing tracing = 9; // Configuration for an external rate limit service provider. If not // specified, any calls to the rate limit service will immediately return diff --git a/envoy/api/v2/cluster/BUILD b/envoy/api/v2/cluster/BUILD index dcb6d241c..5728d7685 100644 --- a/envoy/api/v2/cluster/BUILD +++ b/envoy/api/v2/cluster/BUILD @@ -57,13 +57,3 @@ api_go_proto_library( "//envoy/api/v2/cert:cert_go_proto", ], ) - -proto_library( - name = "cluster_docs", - visibility = ["//envoy/api/v2:__pkg__"], - deps = [ - ":circuit_breaker", - ":cluster", - ":outlier_detection", - ], -) diff --git a/envoy/api/v2/monitoring/BUILD b/envoy/api/v2/monitoring/BUILD new file mode 100644 index 000000000..0b57a47d3 --- /dev/null +++ b/envoy/api/v2/monitoring/BUILD @@ -0,0 +1,51 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library", "api_go_grpc_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "metrics", + srcs = ["metrics_service.proto"], + has_services = 1, + require_py = 0, + deps = [ + "//envoy/api/v2:base", + "//envoy/api/v2:grpc_service", + "@promotheus_metrics_model//:client_model", + ], +) + +api_proto_library( + name = "stats", + srcs = ["stats.proto"], + deps = [ + "//envoy/api/v2:address", + ], +) + +api_go_proto_library( + name = "stats", + proto = ":stats", + deps = [ + "//envoy/api/v2:address_go_proto", + ], +) + +api_proto_library( + name = "trace", + srcs = ["trace.proto"], +) + +api_go_proto_library( + name = "trace", + proto = ":trace", +) + +proto_library( + name = "monitoring", + visibility = ["//envoy/api/v2:__pkg__"], + deps = [ + ":metrics", + ":stats", + ":trace", + ], +) diff --git a/envoy/api/v2/metrics_service.proto b/envoy/api/v2/monitoring/metrics_service.proto similarity index 97% rename from envoy/api/v2/metrics_service.proto rename to envoy/api/v2/monitoring/metrics_service.proto index 703177e5f..f2f2be933 100644 --- a/envoy/api/v2/metrics_service.proto +++ b/envoy/api/v2/monitoring/metrics_service.proto @@ -4,7 +4,7 @@ syntax = "proto3"; // [#protodoc-title: Metrics Service] -package envoy.api.v2; +package envoy.api.v2.monitoring; import "envoy/api/v2/base.proto"; import "envoy/api/v2/grpc_service.proto"; diff --git a/envoy/api/v2/stats.proto b/envoy/api/v2/monitoring/stats.proto similarity index 99% rename from envoy/api/v2/stats.proto rename to envoy/api/v2/monitoring/stats.proto index f9aa85b87..a9752095e 100644 --- a/envoy/api/v2/stats.proto +++ b/envoy/api/v2/monitoring/stats.proto @@ -3,7 +3,7 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.monitoring; import "envoy/api/v2/address.proto"; diff --git a/envoy/api/v2/trace.proto b/envoy/api/v2/monitoring/trace.proto similarity index 98% rename from envoy/api/v2/trace.proto rename to envoy/api/v2/monitoring/trace.proto index 005906ca8..5efc42984 100644 --- a/envoy/api/v2/trace.proto +++ b/envoy/api/v2/monitoring/trace.proto @@ -3,7 +3,7 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.monitoring; import "google/protobuf/struct.proto"; diff --git a/test/build/BUILD b/test/build/BUILD index 05ab9e024..0bde02202 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -6,7 +6,6 @@ api_cc_test( name = "build_test", srcs = ["build_test.cc"], proto_deps = [ - "//envoy/api/v2:metrics", "//envoy/api/v2:rls", "//envoy/api/v2/discovery:ads", "//envoy/api/v2/discovery:cds", @@ -15,6 +14,7 @@ api_cc_test( "//envoy/api/v2/discovery:lds", "//envoy/api/v2/discovery:rds", "//envoy/api/v2/filter/accesslog", + "//envoy/api/v2/monitoring:metrics", ], ) diff --git a/test/build/build_test.cc b/test/build/build_test.cc index 847bb1e97..e1907d717 100644 --- a/test/build/build_test.cc +++ b/test/build/build_test.cc @@ -6,7 +6,6 @@ // Basic C++ build/link validation for the v2 xDS APIs. int main(int argc, char* argv[]) { const auto methods = { - "envoy.api.v2.filter.accesslog.AccessLogService.StreamAccessLogs", "envoy.api.v2.discovery.AggregatedDiscoveryService.StreamAggregatedResources", "envoy.api.v2.discovery.ClusterDiscoveryService.FetchClusters", "envoy.api.v2.discovery.ClusterDiscoveryService.StreamClusters", @@ -18,7 +17,8 @@ int main(int argc, char* argv[]) { "envoy.api.v2.discovery.ListenerDiscoveryService.StreamListeners", "envoy.api.v2.discovery.RouteDiscoveryService.FetchRoutes", "envoy.api.v2.discovery.RouteDiscoveryService.StreamRoutes", - "envoy.api.v2.MetricsService.StreamMetrics", + "envoy.api.v2.filter.accesslog.AccessLogService.StreamAccessLogs", + "envoy.api.v2.monitoring.MetricsService.StreamMetrics", "envoy.api.v2.RateLimitService.ShouldRateLimit", }; From 587b89a900088bf0efae5f4a57b1d3bed7be279f Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Thu, 18 Jan 2018 14:37:18 -0800 Subject: [PATCH 16/47] fix checks Signed-off-by: Kuat Yessenov --- docs/build.sh | 6 +++--- docs/root/api-v2/api.rst | 6 +++--- docs/root/intro/arch_overview/tracing.rst | 2 +- envoy/api/v2/BUILD | 2 +- .../network/http_connection_manager.proto | 2 +- envoy/api/v2/monitoring/metrics_service.proto | 3 ++- envoy/api/v2/monitoring/stats.proto | 21 ++++++++++--------- envoy/api/v2/monitoring/trace.proto | 4 ++-- 8 files changed, 24 insertions(+), 22 deletions(-) diff --git a/docs/build.sh b/docs/build.sh index 28fc3d32c..7713ed3ee 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -40,10 +40,10 @@ PROTO_RST=" /envoy/api/v2/discovery/eds/envoy/api/v2/discovery/eds.proto.rst /envoy/api/v2/grpc_service/envoy/api/v2/grpc_service.proto.rst /envoy/api/v2/health_check/envoy/api/v2/health_check.proto.rst - /envoy/api/v2/metrics/envoy/api/v2/metrics_service.proto.rst /envoy/api/v2/rls/envoy/api/v2/rls.proto.rst - /envoy/api/v2/stats/envoy/api/v2/stats.proto.rst - /envoy/api/v2/trace/envoy/api/v2/trace.proto.rst + /envoy/api/v2/monitoring/metrics/envoy/api/v2/monitoring/metrics_service.proto.rst + /envoy/api/v2/monitoring/stats/envoy/api/v2/monitoring/stats.proto.rst + /envoy/api/v2/monitoring/trace/envoy/api/v2/monitoring/trace.proto.rst /envoy/api/v2/filter/accesslog/accesslog/envoy/api/v2/filter/accesslog/accesslog.proto.rst /envoy/api/v2/filter/fault/envoy/api/v2/filter/fault.proto.rst /envoy/api/v2/filter/http/buffer/envoy/api/v2/filter/http/buffer.proto.rst diff --git a/docs/root/api-v2/api.rst b/docs/root/api-v2/api.rst index b21d0eceb..e79a3033c 100644 --- a/docs/root/api-v2/api.rst +++ b/docs/root/api-v2/api.rst @@ -18,9 +18,9 @@ v2 API reference health_check.proto route/route.proto cert/cert.proto - stats.proto - metrics_service.proto - trace.proto + monitoring/stats.proto + monitoring/metrics_service.proto + monitoring/trace.proto base.proto address.proto protocol.proto diff --git a/docs/root/intro/arch_overview/tracing.rst b/docs/root/intro/arch_overview/tracing.rst index c6ed919cc..b9dbee1d9 100644 --- a/docs/root/intro/arch_overview/tracing.rst +++ b/docs/root/intro/arch_overview/tracing.rst @@ -102,6 +102,6 @@ request ID :ref:`config_http_conn_man_headers_x-request-id` (LightStep) or the trace ID configuration (Zipkin). See * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` for more information on how to setup tracing in Envoy. diff --git a/envoy/api/v2/BUILD b/envoy/api/v2/BUILD index d496b3d9a..2d038bb0b 100644 --- a/envoy/api/v2/BUILD +++ b/envoy/api/v2/BUILD @@ -96,8 +96,8 @@ proto_library( ":rls", "//envoy/api/v2/bootstrap", "//envoy/api/v2/cluster", - "//envoy/api/v2/cluster:outlier_detection", "//envoy/api/v2/cluster:circuit_breaker", + "//envoy/api/v2/cluster:outlier_detection", "//envoy/api/v2/discovery", "//envoy/api/v2/filter/accesslog", "//envoy/api/v2/filter/http", diff --git a/envoy/api/v2/filter/network/http_connection_manager.proto b/envoy/api/v2/filter/network/http_connection_manager.proto index 865352a31..28671b1a7 100644 --- a/envoy/api/v2/filter/network/http_connection_manager.proto +++ b/envoy/api/v2/filter/network/http_connection_manager.proto @@ -85,7 +85,7 @@ message HttpConnectionManager { // Presence of the object defines whether the connection manager // emits :ref:`tracing ` data to the :ref:`configured tracing provider - // `. + // `. Tracing tracing = 7; // Additional HTTP/1 settings that are passed to the HTTP/1 codec. diff --git a/envoy/api/v2/monitoring/metrics_service.proto b/envoy/api/v2/monitoring/metrics_service.proto index f2f2be933..42a06ac7e 100644 --- a/envoy/api/v2/monitoring/metrics_service.proto +++ b/envoy/api/v2/monitoring/metrics_service.proto @@ -40,7 +40,8 @@ message StreamMetricsMessage { } // Metrics Service is configured as a built-in *envoy.metrics_service* :ref:`StatsSink -// `. This opaque configuration will be used to create Metrics Service. +// `. This opaque configuration will be used to create Metrics +// Service. message MetricsServiceConfig { // The upstream gRPC cluster that hosts the metrics service. GrpcService grpc_service = 1 [(validate.rules).message.required = true]; diff --git a/envoy/api/v2/monitoring/stats.proto b/envoy/api/v2/monitoring/stats.proto index a9752095e..0de620480 100644 --- a/envoy/api/v2/monitoring/stats.proto +++ b/envoy/api/v2/monitoring/stats.proto @@ -17,13 +17,13 @@ message StatsSink { // The name of the stats sink to instantiate. The name must match a supported // stats sink. The built-in stats sinks are: // - // * :ref:`envoy.statsd ` - // * :ref:`envoy.dog_statsd ` - // * :ref:`envoy.metrics_service ` + // * :ref:`envoy.statsd ` + // * :ref:`envoy.dog_statsd ` + // * :ref:`envoy.metrics_service ` string name = 1; // Stats sink specific configuration which depends on the sink being - // instantiated. See :ref:`StatsdSink ` for an + // instantiated. See :ref:`StatsdSink ` for an // example. google.protobuf.Struct config = 2; } @@ -32,13 +32,13 @@ message StatsSink { message StatsConfig { // Each stat name is iteratively processed through these tag specifiers. // When a tag is matched, the first capture group is removed from the name so - // later :ref:`TagSpecifiers ` cannot match that + // later :ref:`TagSpecifiers ` cannot match that // same portion of the match. repeated TagSpecifier stats_tags = 1; // Use all default tag regexes specified in Envoy. These can be combined with // custom tags specified in :ref:`stats_tags - // `. They will be processed before + // `. They will be processed before // the custom tags. // // .. note:: @@ -64,9 +64,9 @@ message TagSpecifier { // portions of existing stats, which can be found in `well_known_names.h // `_ // in the Envoy repository. If a :ref:`tag_name - // ` is provided in the config and neither - // :ref:`regex ` or - // :ref:`fixed_value ` were specified, + // ` is provided in the config and neither + // :ref:`regex ` or + // :ref:`fixed_value ` were specified, // Envoy will attempt to find that name in its set of defaults and use the accompanying regex. // // .. note:: @@ -155,7 +155,8 @@ message StatsdSink { // Stats configuration proto schema for built-in *envoy.dog_statsd* sink. // The sink emits stats with `DogStatsD `_ -// compatible tags. Tags are configurable via :ref:`StatsConfig `. +// compatible tags. Tags are configurable via :ref:`StatsConfig +// `. message DogStatsdSink { oneof dog_statsd_specifier { option (validate.required) = true; diff --git a/envoy/api/v2/monitoring/trace.proto b/envoy/api/v2/monitoring/trace.proto index 5efc42984..06f0c425f 100644 --- a/envoy/api/v2/monitoring/trace.proto +++ b/envoy/api/v2/monitoring/trace.proto @@ -23,8 +23,8 @@ message Tracing { // Trace driver specific configuration which depends on the driver being // instantiated. See the :ref:`LightstepConfig - // ` and :ref:`ZipkinConfig - // ` trace drivers for examples. + // ` and :ref:`ZipkinConfig + // ` trace drivers for examples. google.protobuf.Struct config = 2; } // Provides configuration for the HTTP tracer. From 2d1555f61e869a98e05dc096b235827fdce528d6 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Thu, 18 Jan 2018 15:11:13 -0800 Subject: [PATCH 17/47] package ratelimit Signed-off-by: Kuat Yessenov --- docs/build.sh | 2 +- docs/root/api-v2/api.rst | 2 +- docs/root/configuration/rate_limit.rst | 2 +- envoy/api/v2/BUILD | 13 +-------- envoy/api/v2/bootstrap/BUILD | 2 ++ envoy/api/v2/bootstrap/bootstrap.proto | 23 ++-------------- envoy/api/v2/filter/network/BUILD | 2 +- envoy/api/v2/filter/network/rate_limit.proto | 4 +-- envoy/api/v2/ratelimit/BUILD | 28 ++++++++++++++++++++ envoy/api/v2/{ => ratelimit}/rls.proto | 24 ++++++++++++++++- test/build/BUILD | 4 +-- test/build/build_test.cc | 2 +- 12 files changed, 65 insertions(+), 43 deletions(-) create mode 100644 envoy/api/v2/ratelimit/BUILD rename envoy/api/v2/{ => ratelimit}/rls.proto (83%) diff --git a/docs/build.sh b/docs/build.sh index 7713ed3ee..4c900986f 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -40,7 +40,7 @@ PROTO_RST=" /envoy/api/v2/discovery/eds/envoy/api/v2/discovery/eds.proto.rst /envoy/api/v2/grpc_service/envoy/api/v2/grpc_service.proto.rst /envoy/api/v2/health_check/envoy/api/v2/health_check.proto.rst - /envoy/api/v2/rls/envoy/api/v2/rls.proto.rst + /envoy/api/v2/ratelimit/rls/envoy/api/v2/ratelimit/rls.proto.rst /envoy/api/v2/monitoring/metrics/envoy/api/v2/monitoring/metrics_service.proto.rst /envoy/api/v2/monitoring/stats/envoy/api/v2/monitoring/stats.proto.rst /envoy/api/v2/monitoring/trace/envoy/api/v2/monitoring/trace.proto.rst diff --git a/docs/root/api-v2/api.rst b/docs/root/api-v2/api.rst index e79a3033c..2e4756a2f 100644 --- a/docs/root/api-v2/api.rst +++ b/docs/root/api-v2/api.rst @@ -25,5 +25,5 @@ v2 API reference address.proto protocol.proto discovery/common.proto - rls.proto + ratelimit/rls.proto filter/filter diff --git a/docs/root/configuration/rate_limit.rst b/docs/root/configuration/rate_limit.rst index 22882233c..56cb42ad8 100644 --- a/docs/root/configuration/rate_limit.rst +++ b/docs/root/configuration/rate_limit.rst @@ -8,7 +8,7 @@ limit service Envoy should talk to when it needs to make global rate limit decis limit service is configured, a "null" service will be used which will always return OK if called. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` gRPC service IDL ---------------- diff --git a/envoy/api/v2/BUILD b/envoy/api/v2/BUILD index 2d038bb0b..3a784149c 100644 --- a/envoy/api/v2/BUILD +++ b/envoy/api/v2/BUILD @@ -76,24 +76,12 @@ api_go_proto_library( proto = ":protocol", ) -api_proto_library( - name = "rls", - srcs = ["rls.proto"], - has_services = 1, -) - -api_go_grpc_library( - name = "rls", - proto = ":rls", -) - # TODO(htuch): Grow this to cover everything we want to generate docs for, so we can just invoke # bazel build //envoy/api/v2:api --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst proto_library( name = "api", deps = [ ":protocol", - ":rls", "//envoy/api/v2/bootstrap", "//envoy/api/v2/cluster", "//envoy/api/v2/cluster:circuit_breaker", @@ -104,6 +92,7 @@ proto_library( "//envoy/api/v2/filter/network", "//envoy/api/v2/listener", "//envoy/api/v2/monitoring:metrics", + "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", ], ) diff --git a/envoy/api/v2/bootstrap/BUILD b/envoy/api/v2/bootstrap/BUILD index 4957c34bd..e323028e0 100644 --- a/envoy/api/v2/bootstrap/BUILD +++ b/envoy/api/v2/bootstrap/BUILD @@ -15,6 +15,7 @@ api_proto_library( "//envoy/api/v2/listener", "//envoy/api/v2/monitoring:stats", "//envoy/api/v2/monitoring:trace", + "//envoy/api/v2/ratelimit:rls", ], ) @@ -31,5 +32,6 @@ api_go_proto_library( "//envoy/api/v2/listener:listener_go_proto", "//envoy/api/v2/monitoring:stats_go_proto", "//envoy/api/v2/monitoring:trace_go_proto", + "//envoy/api/v2/ratelimit:rls_go_grpc", ], ) diff --git a/envoy/api/v2/bootstrap/bootstrap.proto b/envoy/api/v2/bootstrap/bootstrap.proto index 261da6918..7298a4cc3 100644 --- a/envoy/api/v2/bootstrap/bootstrap.proto +++ b/envoy/api/v2/bootstrap/bootstrap.proto @@ -17,6 +17,7 @@ import "envoy/api/v2/listener/listener.proto"; import "envoy/api/v2/cert/cert.proto"; import "envoy/api/v2/monitoring/stats.proto"; import "envoy/api/v2/monitoring/trace.proto"; +import "envoy/api/v2/ratelimit/rls.proto"; import "google/protobuf/duration.proto"; @@ -108,7 +109,7 @@ message Bootstrap { // Configuration for an external rate limit service provider. If not // specified, any calls to the rate limit service will immediately return // success. - RateLimitServiceConfig rate_limit_service = 10; + ratelimit.RateLimitServiceConfig rate_limit_service = 10; // Configuration for the runtime configuration provider. If not specified, a // “null” provider will be used which will result in all defaults being used. @@ -208,23 +209,3 @@ message Runtime { // configuration. See below for exactly how the override directory is used. string override_subdirectory = 3; } - -// Rate limit :ref:`configuration overview `. -message RateLimitServiceConfig { - oneof service_specifier { - option (validate.required) = true; - - // Specifies the cluster manager cluster name that hosts the rate limit - // service. The client will connect to this cluster when it needs to make - // rate limit service requests. This field is deprecated and `grpc_service` - // should be used instead. The :ref:`Envoy gRPC client - // ` will be used when this field is - // specified. - string cluster_name = 1 [(validate.rules).string.min_bytes = 1, deprecated = true]; - - // Specifies the gRPC service that hosts the rate limit service. The client - // will connect to this cluster when it needs to make rate limit service - // requests. - GrpcService grpc_service = 2; - } -} diff --git a/envoy/api/v2/filter/network/BUILD b/envoy/api/v2/filter/network/BUILD index 3d22141e1..cccf4ff3f 100644 --- a/envoy/api/v2/filter/network/BUILD +++ b/envoy/api/v2/filter/network/BUILD @@ -43,7 +43,7 @@ api_proto_library( api_proto_library( name = "rate_limit", srcs = ["rate_limit.proto"], - deps = ["//envoy/api/v2:rls"], + deps = ["//envoy/api/v2/ratelimit:rls"], ) api_proto_library( diff --git a/envoy/api/v2/filter/network/rate_limit.proto b/envoy/api/v2/filter/network/rate_limit.proto index 3bc7fd3bf..e1322dfde 100644 --- a/envoy/api/v2/filter/network/rate_limit.proto +++ b/envoy/api/v2/filter/network/rate_limit.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.filter.network; -import "envoy/api/v2/rls.proto"; +import "envoy/api/v2/ratelimit/rls.proto"; import "google/protobuf/duration.proto"; import "validate/validate.proto"; @@ -18,7 +18,7 @@ message RateLimit { string domain = 2 [(validate.rules).string.min_bytes = 1]; // The rate limit descriptor list to use in the rate limit service request. - repeated RateLimitDescriptor descriptors = 3 [(validate.rules).repeated .min_items = 1]; + repeated ratelimit.RateLimitDescriptor descriptors = 3 [(validate.rules).repeated .min_items = 1]; // The timeout in milliseconds for the rate limit service RPC. If not // set, this defaults to 20ms. diff --git a/envoy/api/v2/ratelimit/BUILD b/envoy/api/v2/ratelimit/BUILD new file mode 100644 index 000000000..e5d451794 --- /dev/null +++ b/envoy/api/v2/ratelimit/BUILD @@ -0,0 +1,28 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_grpc_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "rls", + srcs = ["rls.proto"], + has_services = 1, + deps = [ + "//envoy/api/v2:grpc_service", + ], +) + +api_go_grpc_library( + name = "rls", + proto = ":rls", + deps = [ + "//envoy/api/v2:grpc_service_go_proto", + ], +) + +proto_library( + name = "ratelimit", + visibility = ["//envoy/api/v2:__pkg__"], + deps = [ + ":rls", + ], +) diff --git a/envoy/api/v2/rls.proto b/envoy/api/v2/ratelimit/rls.proto similarity index 83% rename from envoy/api/v2/rls.proto rename to envoy/api/v2/ratelimit/rls.proto index 8f4f79084..3c4fdcfbd 100644 --- a/envoy/api/v2/rls.proto +++ b/envoy/api/v2/ratelimit/rls.proto @@ -1,6 +1,8 @@ syntax = "proto3"; -package envoy.api.v2; +package envoy.api.v2.ratelimit; + +import "envoy/api/v2/grpc_service.proto"; import "validate/validate.proto"; @@ -129,3 +131,23 @@ message RateLimitResponse { // descriptors failed and/or what the currently configured limits are for all of them. repeated DescriptorStatus statuses = 2; } + +// Rate limit :ref:`configuration overview `. +message RateLimitServiceConfig { + oneof service_specifier { + option (validate.required) = true; + + // Specifies the cluster manager cluster name that hosts the rate limit + // service. The client will connect to this cluster when it needs to make + // rate limit service requests. This field is deprecated and `grpc_service` + // should be used instead. The :ref:`Envoy gRPC client + // ` will be used when this field is + // specified. + string cluster_name = 1 [(validate.rules).string.min_bytes = 1, deprecated = true]; + + // Specifies the gRPC service that hosts the rate limit service. The client + // will connect to this cluster when it needs to make rate limit service + // requests. + GrpcService grpc_service = 2; + } +} diff --git a/test/build/BUILD b/test/build/BUILD index 0bde02202..162a257cc 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -6,7 +6,6 @@ api_cc_test( name = "build_test", srcs = ["build_test.cc"], proto_deps = [ - "//envoy/api/v2:rls", "//envoy/api/v2/discovery:ads", "//envoy/api/v2/discovery:cds", "//envoy/api/v2/discovery:eds", @@ -15,6 +14,7 @@ api_cc_test( "//envoy/api/v2/discovery:rds", "//envoy/api/v2/filter/accesslog", "//envoy/api/v2/monitoring:metrics", + "//envoy/api/v2/ratelimit:rls", ], ) @@ -24,7 +24,6 @@ api_go_test( srcs = ["go_build_test.go"], importpath = "go_build_test", deps = [ - "//envoy/api/v2:rls_go_grpc", "//envoy/api/v2/bootstrap:bootstrap_go_proto", "//envoy/api/v2/cert:cert_go_proto", "//envoy/api/v2/discovery:ads_go_grpc", @@ -34,5 +33,6 @@ api_go_test( "//envoy/api/v2/discovery:lds_go_grpc", "//envoy/api/v2/discovery:rds_go_grpc", "//envoy/api/v2/discovery:sds_go_grpc", + "//envoy/api/v2/ratelimit:rls_go_grpc", ], ) diff --git a/test/build/build_test.cc b/test/build/build_test.cc index e1907d717..c94389125 100644 --- a/test/build/build_test.cc +++ b/test/build/build_test.cc @@ -19,7 +19,7 @@ int main(int argc, char* argv[]) { "envoy.api.v2.discovery.RouteDiscoveryService.StreamRoutes", "envoy.api.v2.filter.accesslog.AccessLogService.StreamAccessLogs", "envoy.api.v2.monitoring.MetricsService.StreamMetrics", - "envoy.api.v2.RateLimitService.ShouldRateLimit", + "envoy.api.v2.ratelimit.RateLimitService.ShouldRateLimit", }; for (const auto& method : methods) { From bb131ea471535ec9d1f6d8e42ed78eaf084fc682 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Thu, 18 Jan 2018 15:44:22 -0800 Subject: [PATCH 18/47] package load_stats Signed-off-by: Kuat Yessenov --- envoy/api/v2/BUILD | 1 + envoy/api/v2/discovery/eds.proto | 140 --------------------------- envoy/api/v2/load_stats/BUILD | 30 ++++++ envoy/api/v2/load_stats/lrs.proto | 155 ++++++++++++++++++++++++++++++ 4 files changed, 186 insertions(+), 140 deletions(-) create mode 100644 envoy/api/v2/load_stats/BUILD create mode 100644 envoy/api/v2/load_stats/lrs.proto diff --git a/envoy/api/v2/BUILD b/envoy/api/v2/BUILD index 3a784149c..4f59f9e81 100644 --- a/envoy/api/v2/BUILD +++ b/envoy/api/v2/BUILD @@ -91,6 +91,7 @@ proto_library( "//envoy/api/v2/filter/http", "//envoy/api/v2/filter/network", "//envoy/api/v2/listener", + "//envoy/api/v2/load_stats", "//envoy/api/v2/monitoring:metrics", "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", diff --git a/envoy/api/v2/discovery/eds.proto b/envoy/api/v2/discovery/eds.proto index 5c5289dbf..2c8dbc1a9 100644 --- a/envoy/api/v2/discovery/eds.proto +++ b/envoy/api/v2/discovery/eds.proto @@ -26,37 +26,6 @@ service EndpointDiscoveryService { body: "*" }; } - - // Advanced API to allow for multi-dimensional load balancing by remote - // server. For receiving LB assignments, the steps are: - // 1, The management server is configured with per cluster/zone/load metric - // capacity configuration. The capacity configuration definition is - // outside of the scope of this document. - // 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters - // to balance. - // - // Independently, Envoy will initiate a StreamLoadStats bidi stream with a - // management server: - // 1. Once a connection establishes, the management server publishes a - // LoadStatsResponse for all clusters it is interested in learning load - // stats about. - // 2. For each cluster, Envoy load balances incoming traffic to upstream hosts - // based on per-zone weights and/or per-instance weights (if specified) - // based on intra-zone LbPolicy. This information comes from the above - // {Stream,Fetch}Endpoints. - // 3. When upstream hosts reply, they optionally add header with ASCII representation of EndpointLoadMetricStats. - // 4. Envoy aggregates load reports over the period of time given to it in - // LoadStatsResponse.load_reporting_interval. This includes aggregation - // stats Envoy maintains by itself (total_requests, rpc_errors etc.) as - // well as load metrics from upstream hosts. - // 5. When the timer of load_reporting_interval expires, Envoy sends new - // LoadStatsRequest filled with load reports for each cluster. - // 6. The management server uses the load reports from all reported Envoys - // from around the world, computes global assignment and prepares traffic - // assignment destined for each zone Envoys are located in. Goto 2. - rpc StreamLoadStats(stream LoadStatsRequest) returns (stream LoadStatsResponse) { - } } // An Endpoint that Envoy can route traffic to. @@ -136,104 +105,6 @@ message LocalityLbEndpoints { uint32 priority = 5; } -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message EndpointLoadMetricStats { - // Name of the metric; may be empty. - string metric_name = 1; - - // Number of calls that finished and included this metric. - uint64 num_requests_finished_with_metric = 2; - - // Sum of metric values across all calls that finished with this metric for - // load_reporting_interval. - double total_metric_value = 3; -} - -// These are stats Envoy reports to GLB every so often. Report frequency is -// defined by -// :ref:`LoadStatsResponse.load_reporting_interval`. -// Stats per upstream region/zone and optionally per subzone. -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message UpstreamLocalityStats { - // Name of zone, region and optionally endpoint group these metrics were - // collected from. Zone and region names could be empty if unknown. - Locality locality = 1; - - // The total number of requests sent by this Envoy since the last report. A - // single HTTP or gRPC request or stream is counted as one request. A TCP - // connection is also treated as one request. There is no explicit - // total_requests field below for a locality, but it may be inferred from: - // - // .. code-block:: none - // - // total_requests = total_successful_requests + total_requests_in_progress + - // total_error_requests - // - // The total number of requests successfully completed by the endpoints in the - // locality. These include non-5xx responses for HTTP, where errors - // originate at the client and the endpoint responded successfuly. For gRPC, - // the grpc-status values are those not covered by total_error_requests below. - uint64 total_successful_requests = 2; - - // The total number of unfinished requests - uint64 total_requests_in_progress = 3; - - // The total number of requests that failed due to errors at the endpoint. - // For HTTP these are responses with 5xx status codes and for gRPC the - // grpc-status values: - // - // - DeadlineExceeded - // - Unimplemented - // - Internal - // - Unavailable - // - Unknown - // - DataLoss - uint64 total_error_requests = 4; - - // Stats for multi-dimensional load balancing. - repeated EndpointLoadMetricStats load_metric_stats = 5; - - // [#not-implemented-hide:] The priority of the endpoint group these metrics - // were collected from. - uint32 priority = 6; -} - -// Per cluster load stats. Envoy reports these stats a management server in a -// :ref:`LoadStatsRequest` -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message ClusterStats { - // The name of the cluster. - string cluster_name = 1 [(validate.rules).string.min_bytes = 1]; - - // Need at least one. - repeated UpstreamLocalityStats upstream_locality_stats = 2 - [(validate.rules).repeated .min_items = 1]; - - // Cluster-level stats such as total_successful_requests may be computed by - // summing upstream_locality_stats. In addition, below there are additional - // cluster-wide stats. The following total_requests equality holds at the - // cluster-level: - // - // .. code-block:: none - // - // sum_locality(total_successful_requests) + sum_locality(total_requests_in_progress) + - // sum_locality(total_error_requests) + total_dropped_requests` - // - // The total number of dropped requests. This covers requests - // deliberately dropped by the drop_overload policy and circuit breaking. - uint64 total_dropped_requests = 3; -} - -// A load report Envoy sends to the management server. -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message LoadStatsRequest { - // Node identifier for Envoy instance. - Node node = 1; - - // A list of load stats to report. - repeated ClusterStats cluster_stats = 2; -} - // Each route from RDS will map to a single cluster or traffic split across // clusters using weights expressed in the RDS WeightedCluster. // @@ -265,14 +136,3 @@ message ClusterLoadAssignment { // Load balancing policy settings. Policy policy = 4; } - -// The management server sends envoy a LoadStatsResponse with all clusters it -// is interested in learning load stats about. -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message LoadStatsResponse { - // Clusters to report stats for. - repeated string clusters = 1 [(validate.rules).repeated .min_items = 1]; - - // The interval of time to collect stats. The default is 10 seconds. - google.protobuf.Duration load_reporting_interval = 2; -} diff --git a/envoy/api/v2/load_stats/BUILD b/envoy/api/v2/load_stats/BUILD new file mode 100644 index 000000000..f4766bf3a --- /dev/null +++ b/envoy/api/v2/load_stats/BUILD @@ -0,0 +1,30 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library", "api_go_grpc_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "lrs", + srcs = ["lrs.proto"], + has_services = 1, + deps = [ + "//envoy/api/v2:address", + "//envoy/api/v2:base", + ], +) + +api_go_grpc_library( + name = "lrs", + proto = ":lrs", + deps = [ + "//envoy/api/v2:address_go_proto", + "//envoy/api/v2:base_go_proto", + ], +) + +proto_library( + name = "load_stats", + visibility = ["//envoy/api/v2:__pkg__"], + deps = [ + ":lrs", + ], +) diff --git a/envoy/api/v2/load_stats/lrs.proto b/envoy/api/v2/load_stats/lrs.proto new file mode 100644 index 000000000..eb00e4041 --- /dev/null +++ b/envoy/api/v2/load_stats/lrs.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; + +package envoy.api.v2.load_stats; + +import "envoy/api/v2/base.proto"; + +import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; + +import "validate/validate.proto"; + +// [#protodoc-title: Load reporting service] + +service LoadReportingService { + // Advanced API to allow for multi-dimensional load balancing by remote + // server. For receiving LB assignments, the steps are: + // 1, The management server is configured with per cluster/zone/load metric + // capacity configuration. The capacity configuration definition is + // outside of the scope of this document. + // 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters + // to balance. + // + // Independently, Envoy will initiate a StreamLoadStats bidi stream with a + // management server: + // 1. Once a connection establishes, the management server publishes a + // LoadStatsResponse for all clusters it is interested in learning load + // stats about. + // 2. For each cluster, Envoy load balances incoming traffic to upstream hosts + // based on per-zone weights and/or per-instance weights (if specified) + // based on intra-zone LbPolicy. This information comes from the above + // {Stream,Fetch}Endpoints. + // 3. When upstream hosts reply, they optionally add header with ASCII representation of EndpointLoadMetricStats. + // 4. Envoy aggregates load reports over the period of time given to it in + // LoadStatsResponse.load_reporting_interval. This includes aggregation + // stats Envoy maintains by itself (total_requests, rpc_errors etc.) as + // well as load metrics from upstream hosts. + // 5. When the timer of load_reporting_interval expires, Envoy sends new + // LoadStatsRequest filled with load reports for each cluster. + // 6. The management server uses the load reports from all reported Envoys + // from around the world, computes global assignment and prepares traffic + // assignment destined for each zone Envoys are located in. Goto 2. + rpc StreamLoadStats(stream LoadStatsRequest) returns (stream LoadStatsResponse) { + } +} + +// These are stats Envoy reports to GLB every so often. Report frequency is +// defined by +// :ref:`LoadStatsResponse.load_reporting_interval`. +// Stats per upstream region/zone and optionally per subzone. +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message UpstreamLocalityStats { + // Name of zone, region and optionally endpoint group these metrics were + // collected from. Zone and region names could be empty if unknown. + Locality locality = 1; + + // The total number of requests sent by this Envoy since the last report. A + // single HTTP or gRPC request or stream is counted as one request. A TCP + // connection is also treated as one request. There is no explicit + // total_requests field below for a locality, but it may be inferred from: + // + // .. code-block:: none + // + // total_requests = total_successful_requests + total_requests_in_progress + + // total_error_requests + // + // The total number of requests successfully completed by the endpoints in the + // locality. These include non-5xx responses for HTTP, where errors + // originate at the client and the endpoint responded successfuly. For gRPC, + // the grpc-status values are those not covered by total_error_requests below. + uint64 total_successful_requests = 2; + + // The total number of unfinished requests + uint64 total_requests_in_progress = 3; + + // The total number of requests that failed due to errors at the endpoint. + // For HTTP these are responses with 5xx status codes and for gRPC the + // grpc-status values: + // + // - DeadlineExceeded + // - Unimplemented + // - Internal + // - Unavailable + // - Unknown + // - DataLoss + uint64 total_error_requests = 4; + + // Stats for multi-dimensional load balancing. + repeated EndpointLoadMetricStats load_metric_stats = 5; + + // [#not-implemented-hide:] The priority of the endpoint group these metrics + // were collected from. + uint32 priority = 6; +} + +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message EndpointLoadMetricStats { + // Name of the metric; may be empty. + string metric_name = 1; + + // Number of calls that finished and included this metric. + uint64 num_requests_finished_with_metric = 2; + + // Sum of metric values across all calls that finished with this metric for + // load_reporting_interval. + double total_metric_value = 3; +} + +// Per cluster load stats. Envoy reports these stats a management server in a +// :ref:`LoadStatsRequest` +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message ClusterStats { + // The name of the cluster. + string cluster_name = 1 [(validate.rules).string.min_bytes = 1]; + + // Need at least one. + repeated UpstreamLocalityStats upstream_locality_stats = 2 + [(validate.rules).repeated .min_items = 1]; + + // Cluster-level stats such as total_successful_requests may be computed by + // summing upstream_locality_stats. In addition, below there are additional + // cluster-wide stats. The following total_requests equality holds at the + // cluster-level: + // + // .. code-block:: none + // + // sum_locality(total_successful_requests) + sum_locality(total_requests_in_progress) + + // sum_locality(total_error_requests) + total_dropped_requests` + // + // The total number of dropped requests. This covers requests + // deliberately dropped by the drop_overload policy and circuit breaking. + uint64 total_dropped_requests = 3; +} + +// A load report Envoy sends to the management server. +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message LoadStatsRequest { + // Node identifier for Envoy instance. + Node node = 1; + + // A list of load stats to report. + repeated ClusterStats cluster_stats = 2; +} + +// The management server sends envoy a LoadStatsResponse with all clusters it +// is interested in learning load stats about. +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message LoadStatsResponse { + // Clusters to report stats for. + repeated string clusters = 1 [(validate.rules).repeated .min_items = 1]; + + // The interval of time to collect stats. The default is 10 seconds. + google.protobuf.Duration load_reporting_interval = 2; +} From 88433d8860f5f4cb33bad1f4d4311ace3bb7f639 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 12:55:20 -0800 Subject: [PATCH 19/47] move discovery and load_stats Signed-off-by: Kuat Yessenov --- envoy/BUILD | 23 +++++++++++++++++++ envoy/api/v2/BUILD | 18 ++------------- envoy/api/v2/filter/http/BUILD | 2 +- envoy/api/v2/filter/network/BUILD | 2 +- envoy/api/v2/ratelimit/BUILD | 2 +- envoy/service/discovery/BUILD | 13 +++++++++++ .../discovery => service/discovery/v2}/BUILD | 14 ----------- .../discovery/v2}/ads.proto | 6 ++--- .../discovery/v2}/cds.proto | 4 ++-- .../discovery/v2}/common.proto | 4 ++-- .../discovery/v2}/eds.proto | 12 +++++----- .../discovery/v2}/hds.proto | 14 +++++------ .../discovery/v2}/lds.proto | 4 ++-- .../discovery/v2}/rds.proto | 4 ++-- .../discovery/v2}/sds.proto | 4 ++-- envoy/service/load_stats/BUILD | 7 ++++++ .../load_stats/v2}/BUILD | 8 ------- .../load_stats/v2}/lrs.proto | 7 +++--- 18 files changed, 76 insertions(+), 72 deletions(-) create mode 100644 envoy/BUILD create mode 100644 envoy/service/discovery/BUILD rename envoy/{api/v2/discovery => service/discovery/v2}/BUILD (91%) rename envoy/{api/v2/discovery => service/discovery/v2}/ads.proto (84%) rename envoy/{api/v2/discovery => service/discovery/v2}/cds.proto (82%) rename envoy/{api/v2/discovery => service/discovery/v2}/common.proto (98%) rename envoy/{api/v2/discovery => service/discovery/v2}/eds.proto (95%) rename envoy/{api/v2/discovery => service/discovery/v2}/hds.proto (94%) rename envoy/{api/v2/discovery => service/discovery/v2}/lds.proto (88%) rename envoy/{api/v2/discovery => service/discovery/v2}/rds.proto (88%) rename envoy/{api/v2/discovery => service/discovery/v2}/sds.proto (80%) create mode 100644 envoy/service/load_stats/BUILD rename envoy/{api/v2/load_stats => service/load_stats/v2}/BUILD (79%) rename envoy/{api/v2/load_stats => service/load_stats/v2}/lrs.proto (98%) diff --git a/envoy/BUILD b/envoy/BUILD new file mode 100644 index 000000000..9becc8002 --- /dev/null +++ b/envoy/BUILD @@ -0,0 +1,23 @@ +licenses(["notice"]) # Apache 2 + +# TODO(htuch): Grow this to cover everything we want to generate docs for, so we can just invoke +# bazel build //envoy/api --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst +proto_library( + name = "envoy", + deps = [ + "//envoy/api/v2", + "//envoy/api/v2/bootstrap", + "//envoy/api/v2/cluster", + "//envoy/api/v2/cluster:circuit_breaker", + "//envoy/api/v2/cluster:outlier_detection", + "//envoy/service/discovery", + "//envoy/api/v2/filter/accesslog", + "//envoy/api/v2/filter/http", + "//envoy/api/v2/filter/network", + "//envoy/api/v2/listener", + "//envoy/service/load_stats", + "//envoy/api/v2/monitoring:metrics", + "//envoy/api/v2/ratelimit", + "//envoy/api/v2/route", + ], +) diff --git a/envoy/api/v2/BUILD b/envoy/api/v2/BUILD index 4f59f9e81..381a3be17 100644 --- a/envoy/api/v2/BUILD +++ b/envoy/api/v2/BUILD @@ -76,24 +76,10 @@ api_go_proto_library( proto = ":protocol", ) -# TODO(htuch): Grow this to cover everything we want to generate docs for, so we can just invoke -# bazel build //envoy/api/v2:api --aspects tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst proto_library( - name = "api", + name = "v2", + visibility = ["//envoy:__pkg__"], deps = [ ":protocol", - "//envoy/api/v2/bootstrap", - "//envoy/api/v2/cluster", - "//envoy/api/v2/cluster:circuit_breaker", - "//envoy/api/v2/cluster:outlier_detection", - "//envoy/api/v2/discovery", - "//envoy/api/v2/filter/accesslog", - "//envoy/api/v2/filter/http", - "//envoy/api/v2/filter/network", - "//envoy/api/v2/listener", - "//envoy/api/v2/load_stats", - "//envoy/api/v2/monitoring:metrics", - "//envoy/api/v2/ratelimit", - "//envoy/api/v2/route", ], ) diff --git a/envoy/api/v2/filter/http/BUILD b/envoy/api/v2/filter/http/BUILD index 1de84c047..1d54b2744 100644 --- a/envoy/api/v2/filter/http/BUILD +++ b/envoy/api/v2/filter/http/BUILD @@ -69,7 +69,7 @@ api_proto_library( proto_library( name = "http", - visibility = ["//envoy/api/v2:__pkg__"], + visibility = ["//envoy:__pkg__"], deps = [ ":buffer", ":ext_authz", diff --git a/envoy/api/v2/filter/network/BUILD b/envoy/api/v2/filter/network/BUILD index cccf4ff3f..63e419980 100644 --- a/envoy/api/v2/filter/network/BUILD +++ b/envoy/api/v2/filter/network/BUILD @@ -54,7 +54,7 @@ api_proto_library( proto_library( name = "network", - visibility = ["//envoy/api/v2:__pkg__"], + visibility = ["//envoy:__pkg__"], deps = [ ":client_ssl_auth", ":ext_authz", diff --git a/envoy/api/v2/ratelimit/BUILD b/envoy/api/v2/ratelimit/BUILD index e5d451794..4a5e55872 100644 --- a/envoy/api/v2/ratelimit/BUILD +++ b/envoy/api/v2/ratelimit/BUILD @@ -21,7 +21,7 @@ api_go_grpc_library( proto_library( name = "ratelimit", - visibility = ["//envoy/api/v2:__pkg__"], + visibility = ["//envoy:__pkg__"], deps = [ ":rls", ], diff --git a/envoy/service/discovery/BUILD b/envoy/service/discovery/BUILD new file mode 100644 index 000000000..606b2450c --- /dev/null +++ b/envoy/service/discovery/BUILD @@ -0,0 +1,13 @@ +proto_library( + name = "discovery", + visibility = ["//envoy:__pkg__"], + deps = [ + "//envoy/service/discovery/v2:ads", + "//envoy/service/discovery/v2:cds", + "//envoy/service/discovery/v2:common", + "//envoy/service/discovery/v2:eds", + "//envoy/service/discovery/v2:lds", + "//envoy/service/discovery/v2:rds", + "//envoy/service/discovery/v2:sds", + ], +) diff --git a/envoy/api/v2/discovery/BUILD b/envoy/service/discovery/v2/BUILD similarity index 91% rename from envoy/api/v2/discovery/BUILD rename to envoy/service/discovery/v2/BUILD index 5ff6dbb63..22b7e53f7 100644 --- a/envoy/api/v2/discovery/BUILD +++ b/envoy/service/discovery/v2/BUILD @@ -140,17 +140,3 @@ api_go_grpc_library( ":common_go_proto", ], ) - -proto_library( - name = "discovery", - visibility = ["//envoy/api/v2:__pkg__"], - deps = [ - ":ads", - ":cds", - ":common", - ":eds", - ":lds", - ":rds", - ":sds", - ], -) diff --git a/envoy/api/v2/discovery/ads.proto b/envoy/service/discovery/v2/ads.proto similarity index 84% rename from envoy/api/v2/discovery/ads.proto rename to envoy/service/discovery/v2/ads.proto index 5d76ceef8..145a58203 100644 --- a/envoy/api/v2/discovery/ads.proto +++ b/envoy/service/discovery/v2/ads.proto @@ -1,10 +1,8 @@ syntax = "proto3"; -package envoy.api.v2.discovery; +package envoy.service.discovery.v2; -import "envoy/api/v2/discovery/common.proto"; - -import "google/protobuf/any.proto"; +import "envoy/service/discovery/v2/common.proto"; // See https://github.com/lyft/envoy-api#apis for a description of the role of // ADS and how it is intended to be used by a management server. ADS requests diff --git a/envoy/api/v2/discovery/cds.proto b/envoy/service/discovery/v2/cds.proto similarity index 82% rename from envoy/api/v2/discovery/cds.proto rename to envoy/service/discovery/v2/cds.proto index 320573634..9b257bdbe 100644 --- a/envoy/api/v2/discovery/cds.proto +++ b/envoy/service/discovery/v2/cds.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package envoy.api.v2.discovery; +package envoy.service.discovery.v2; -import "envoy/api/v2/discovery/common.proto"; +import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; diff --git a/envoy/api/v2/discovery/common.proto b/envoy/service/discovery/v2/common.proto similarity index 98% rename from envoy/api/v2/discovery/common.proto rename to envoy/service/discovery/v2/common.proto index 48b8c66a8..9ab41e52b 100644 --- a/envoy/api/v2/discovery/common.proto +++ b/envoy/service/discovery/v2/common.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package envoy.api.v2.discovery; +package envoy.service.discovery.v2; option go_package = "discovery"; import "envoy/api/v2/base.proto"; @@ -22,7 +22,7 @@ message DiscoveryRequest { string version_info = 1; // The node making the request. - Node node = 2; + envoy.api.v2.Node node = 2; // List of resources to subscribe to, e.g. list of cluster names or a route // configuration name. If this is empty, all resources for the API are diff --git a/envoy/api/v2/discovery/eds.proto b/envoy/service/discovery/v2/eds.proto similarity index 95% rename from envoy/api/v2/discovery/eds.proto rename to envoy/service/discovery/v2/eds.proto index 2c8dbc1a9..7829dc673 100644 --- a/envoy/api/v2/discovery/eds.proto +++ b/envoy/service/discovery/v2/eds.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package envoy.api.v2.discovery; +package envoy.service.discovery.v2; +import "envoy/service/discovery/v2/common.proto"; import "envoy/api/v2/base.proto"; -import "envoy/api/v2/discovery/common.proto"; import "envoy/api/v2/health_check.proto"; import "google/api/annotations.proto"; @@ -31,11 +31,11 @@ service EndpointDiscoveryService { // An Endpoint that Envoy can route traffic to. message LbEndpoint { // Upstream host identifier - Endpoint endpoint = 1; + envoy.api.v2.Endpoint endpoint = 1; // [#not-implemented-hide:] Optional health status when known and supplied by // EDS server. - HealthStatus health_status = 2; + envoy.api.v2.HealthStatus health_status = 2; // The endpoint metadata specifies values that may be used by the load // balancer to select endpoints in a cluster for a given request. The filter @@ -43,7 +43,7 @@ message LbEndpoint { // is *canary*, providing the optional canary status of the upstream host. // This may be matched against in a route's ForwardAction metadata_match field // to subset the endpoints considered in cluster load balancing. - Metadata metadata = 3; + envoy.api.v2.Metadata metadata = 3; // The optional load balancing weight of the upstream host, in the range 1 - // 128. Envoy uses the load balancing weight in some of the built in load @@ -69,7 +69,7 @@ message LbEndpoint { // balancing weights or different priorities. message LocalityLbEndpoints { // Identifies location of where the upstream hosts run. - Locality locality = 1; + envoy.api.v2.Locality locality = 1; // The group of endpoints belonging to the locality specified. repeated LbEndpoint lb_endpoints = 2; diff --git a/envoy/api/v2/discovery/hds.proto b/envoy/service/discovery/v2/hds.proto similarity index 94% rename from envoy/api/v2/discovery/hds.proto rename to envoy/service/discovery/v2/hds.proto index 561ee91d8..a02db4a8e 100644 --- a/envoy/api/v2/discovery/hds.proto +++ b/envoy/service/discovery/v2/hds.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package envoy.api.v2.discovery; +package envoy.service.discovery.v2; import "envoy/api/v2/base.proto"; import "envoy/api/v2/health_check.proto"; @@ -78,13 +78,13 @@ message Capability { } message HealthCheckRequest { - Node node = 1; + envoy.api.v2.Node node = 1; Capability capability = 2; } message EndpointHealth { - Endpoint endpoint = 1; - HealthStatus health_status = 2; + envoy.api.v2.Endpoint endpoint = 1; + envoy.api.v2.HealthStatus health_status = 2; } message EndpointHealthResponse { @@ -99,8 +99,8 @@ message HealthCheckRequestOrEndpointHealthResponse { } message LocalityEndpoints { - Locality locality = 1; - repeated Endpoint endpoints = 2; + envoy.api.v2.Locality locality = 1; + repeated envoy.api.v2.Endpoint endpoints = 2; } // The cluster name and locality is provided to Envoy for the endpoints that it @@ -109,7 +109,7 @@ message LocalityEndpoints { // same cluster structure as that provided by EDS. message ClusterHealthCheck { string cluster_name = 1; - repeated HealthCheck health_checks = 2; + repeated envoy.api.v2.HealthCheck health_checks = 2; repeated LocalityEndpoints endpoints = 3; } diff --git a/envoy/api/v2/discovery/lds.proto b/envoy/service/discovery/v2/lds.proto similarity index 88% rename from envoy/api/v2/discovery/lds.proto rename to envoy/service/discovery/v2/lds.proto index 19cbb8899..7af6d7a97 100644 --- a/envoy/api/v2/discovery/lds.proto +++ b/envoy/service/discovery/v2/lds.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package envoy.api.v2.discovery; +package envoy.service.discovery.v2; -import "envoy/api/v2/discovery/common.proto"; +import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; diff --git a/envoy/api/v2/discovery/rds.proto b/envoy/service/discovery/v2/rds.proto similarity index 88% rename from envoy/api/v2/discovery/rds.proto rename to envoy/service/discovery/v2/rds.proto index aa3340fd2..7a9df4425 100644 --- a/envoy/api/v2/discovery/rds.proto +++ b/envoy/service/discovery/v2/rds.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package envoy.api.v2.discovery; +package envoy.service.discovery.v2; -import "envoy/api/v2/discovery/common.proto"; +import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; diff --git a/envoy/api/v2/discovery/sds.proto b/envoy/service/discovery/v2/sds.proto similarity index 80% rename from envoy/api/v2/discovery/sds.proto rename to envoy/service/discovery/v2/sds.proto index 73763b065..8c7b975db 100644 --- a/envoy/api/v2/discovery/sds.proto +++ b/envoy/service/discovery/v2/sds.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package envoy.api.v2.discovery; +package envoy.service.discovery.v2; -import "envoy/api/v2/discovery/common.proto"; +import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; diff --git a/envoy/service/load_stats/BUILD b/envoy/service/load_stats/BUILD new file mode 100644 index 000000000..e9dc0a430 --- /dev/null +++ b/envoy/service/load_stats/BUILD @@ -0,0 +1,7 @@ +proto_library( + name = "load_stats", + visibility = ["//envoy:__pkg__"], + deps = [ + "//envoy/service/load_stats/v2:lrs", + ], +) diff --git a/envoy/api/v2/load_stats/BUILD b/envoy/service/load_stats/v2/BUILD similarity index 79% rename from envoy/api/v2/load_stats/BUILD rename to envoy/service/load_stats/v2/BUILD index f4766bf3a..dde1edeb8 100644 --- a/envoy/api/v2/load_stats/BUILD +++ b/envoy/service/load_stats/v2/BUILD @@ -20,11 +20,3 @@ api_go_grpc_library( "//envoy/api/v2:base_go_proto", ], ) - -proto_library( - name = "load_stats", - visibility = ["//envoy/api/v2:__pkg__"], - deps = [ - ":lrs", - ], -) diff --git a/envoy/api/v2/load_stats/lrs.proto b/envoy/service/load_stats/v2/lrs.proto similarity index 98% rename from envoy/api/v2/load_stats/lrs.proto rename to envoy/service/load_stats/v2/lrs.proto index eb00e4041..91b2ab57f 100644 --- a/envoy/api/v2/load_stats/lrs.proto +++ b/envoy/service/load_stats/v2/lrs.proto @@ -1,12 +1,11 @@ syntax = "proto3"; -package envoy.api.v2.load_stats; +package envoy.service.load_stats.v2; import "envoy/api/v2/base.proto"; import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; @@ -53,7 +52,7 @@ service LoadReportingService { message UpstreamLocalityStats { // Name of zone, region and optionally endpoint group these metrics were // collected from. Zone and region names could be empty if unknown. - Locality locality = 1; + envoy.api.v2.Locality locality = 1; // The total number of requests sent by this Envoy since the last report. A // single HTTP or gRPC request or stream is counted as one request. A TCP @@ -137,7 +136,7 @@ message ClusterStats { // [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. message LoadStatsRequest { // Node identifier for Envoy instance. - Node node = 1; + envoy.api.v2.Node node = 1; // A list of load stats to report. repeated ClusterStats cluster_stats = 2; From dff8d2755c7e1530e418efab46a4bf313e4fb0e2 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 13:09:52 -0800 Subject: [PATCH 20/47] move external_auth Signed-off-by: Kuat Yessenov --- envoy/api/v2/auth/BUILD | 32 +++++++++++-------- envoy/api/v2/auth/auth.proto | 4 +-- envoy/api/v2/{cert => auth}/cert.proto | 3 +- envoy/api/v2/bootstrap/BUILD | 4 +-- envoy/api/v2/bootstrap/bootstrap.proto | 4 +-- envoy/api/v2/cert/BUILD | 21 ------------ envoy/api/v2/cluster/BUILD | 4 +-- envoy/api/v2/cluster/cluster.proto | 6 ++-- envoy/api/v2/listener/BUILD | 4 +-- envoy/api/v2/listener/listener.proto | 4 +-- envoy/service/auth/v2/BUILD | 14 ++++++++ .../auth/v2}/external_auth.proto | 7 ++-- envoy/service/load_stats/v2/lrs.proto | 1 + 13 files changed, 54 insertions(+), 54 deletions(-) rename envoy/api/v2/{cert => auth}/cert.proto (99%) delete mode 100644 envoy/api/v2/cert/BUILD create mode 100644 envoy/service/auth/v2/BUILD rename envoy/{api/v2/auth => service/auth/v2}/external_auth.proto (98%) diff --git a/envoy/api/v2/auth/BUILD b/envoy/api/v2/auth/BUILD index cafc647fe..bb807defe 100644 --- a/envoy/api/v2/auth/BUILD +++ b/envoy/api/v2/auth/BUILD @@ -3,30 +3,36 @@ load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library" licenses(["notice"]) # Apache 2 api_proto_library( - name = "external_auth", - srcs = [ - "external_auth.proto", + name = "auth", + srcs = ["auth.proto"], + deps = [ + ":cert", ], - has_services = 1, +) + +api_go_proto_library( + name = "auth", + proto = ":auth", deps = [ - "//envoy/api/v2:address", + ":cert_go_proto", + "@googleapis//:rpc_status_go_proto", ], ) api_proto_library( - name = "auth", - srcs = ["auth.proto"], + name = "cert", + srcs = ["cert.proto"], deps = [ - "//envoy/api/v2/cert", + "//envoy/api/v2:base", + "//envoy/api/v2:config_source", ], ) api_go_proto_library( - name = "auth", - proto = ":auth", + name = "cert", + proto = ":cert", deps = [ - "//envoy/api/v2:address_go_proto", - "//envoy/api/v2/cert:cert_go_proto", - "@googleapis//:rpc_status_go_proto", + "//envoy/api/v2:base_go_proto", + "//envoy/api/v2:config_source_go_proto", ], ) diff --git a/envoy/api/v2/auth/auth.proto b/envoy/api/v2/auth/auth.proto index d946e6411..ef44e27ec 100644 --- a/envoy/api/v2/auth/auth.proto +++ b/envoy/api/v2/auth/auth.proto @@ -4,7 +4,7 @@ syntax = "proto3"; package envoy.api.v2.auth; -import "envoy/api/v2/cert/cert.proto"; +import "envoy/api/v2/auth/cert.proto"; message AuthAction { // Should we do white-list or black-list style access control. @@ -31,7 +31,7 @@ message AuthAction { // Check peer identity using X.509 certificate. message X509Rule { // How to validate peer certificates. - cert.CertificateValidationContext validation_context = 3; + CertificateValidationContext validation_context = 3; } // Element type of AndRule/OrRule, it chooses among different type of rule. diff --git a/envoy/api/v2/cert/cert.proto b/envoy/api/v2/auth/cert.proto similarity index 99% rename from envoy/api/v2/cert/cert.proto rename to envoy/api/v2/auth/cert.proto index b97c6ba5e..16a250e35 100644 --- a/envoy/api/v2/cert/cert.proto +++ b/envoy/api/v2/auth/cert.proto @@ -1,7 +1,6 @@ syntax = "proto3"; -package envoy.api.v2.cert; -option go_package = "cert"; +package envoy.api.v2.auth; import "envoy/api/v2/base.proto"; import "envoy/api/v2/config_source.proto"; diff --git a/envoy/api/v2/bootstrap/BUILD b/envoy/api/v2/bootstrap/BUILD index e323028e0..513091a85 100644 --- a/envoy/api/v2/bootstrap/BUILD +++ b/envoy/api/v2/bootstrap/BUILD @@ -10,7 +10,7 @@ api_proto_library( "//envoy/api/v2:base", "//envoy/api/v2:config_source", "//envoy/api/v2:grpc_service", - "//envoy/api/v2/cert", + "//envoy/api/v2/auth:cert", "//envoy/api/v2/cluster", "//envoy/api/v2/listener", "//envoy/api/v2/monitoring:stats", @@ -27,7 +27,7 @@ api_go_proto_library( "//envoy/api/v2:base_go_proto", "//envoy/api/v2:config_source_go_proto", "//envoy/api/v2:grpc_service_go_proto", - "//envoy/api/v2/cert:cert_go_proto", + "//envoy/api/v2/auth:cert_go_proto", "//envoy/api/v2/cluster:cluster_go_proto", "//envoy/api/v2/listener:listener_go_proto", "//envoy/api/v2/monitoring:stats_go_proto", diff --git a/envoy/api/v2/bootstrap/bootstrap.proto b/envoy/api/v2/bootstrap/bootstrap.proto index 7298a4cc3..719d503db 100644 --- a/envoy/api/v2/bootstrap/bootstrap.proto +++ b/envoy/api/v2/bootstrap/bootstrap.proto @@ -10,11 +10,11 @@ option go_package = "bootstrap"; import "envoy/api/v2/address.proto"; import "envoy/api/v2/base.proto"; +import "envoy/api/v2/auth/cert.proto"; import "envoy/api/v2/config_source.proto"; import "envoy/api/v2/cluster/cluster.proto"; import "envoy/api/v2/grpc_service.proto"; import "envoy/api/v2/listener/listener.proto"; -import "envoy/api/v2/cert/cert.proto"; import "envoy/api/v2/monitoring/stats.proto"; import "envoy/api/v2/monitoring/trace.proto"; import "envoy/api/v2/ratelimit/rls.proto"; @@ -44,7 +44,7 @@ message Bootstrap { repeated cluster.Cluster clusters = 2; // [#not-implemented-hide:] - repeated cert.Secret secrets = 3; + repeated auth.Secret secrets = 3; } // Statically specified resources. StaticResources static_resources = 2; diff --git a/envoy/api/v2/cert/BUILD b/envoy/api/v2/cert/BUILD deleted file mode 100644 index eabb72808..000000000 --- a/envoy/api/v2/cert/BUILD +++ /dev/null @@ -1,21 +0,0 @@ -load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") - -licenses(["notice"]) # Apache 2 - -api_proto_library( - name = "cert", - srcs = ["cert.proto"], - deps = [ - "//envoy/api/v2:base", - "//envoy/api/v2:config_source", - ], -) - -api_go_proto_library( - name = "cert", - proto = ":cert", - deps = [ - "//envoy/api/v2:base_go_proto", - "//envoy/api/v2:config_source_go_proto", - ], -) diff --git a/envoy/api/v2/cluster/BUILD b/envoy/api/v2/cluster/BUILD index 5728d7685..a02109915 100644 --- a/envoy/api/v2/cluster/BUILD +++ b/envoy/api/v2/cluster/BUILD @@ -39,7 +39,7 @@ api_proto_library( "//envoy/api/v2:config_source", "//envoy/api/v2:health_check", "//envoy/api/v2:protocol", - "//envoy/api/v2/cert", + "//envoy/api/v2/auth:cert", ], ) @@ -54,6 +54,6 @@ api_go_proto_library( "//envoy/api/v2:config_source_go_proto", "//envoy/api/v2:health_check_go_proto", "//envoy/api/v2:protocol_go_proto", - "//envoy/api/v2/cert:cert_go_proto", + "//envoy/api/v2/auth:cert_go_proto", ], ) diff --git a/envoy/api/v2/cluster/cluster.proto b/envoy/api/v2/cluster/cluster.proto index a6558088e..e34401bc0 100644 --- a/envoy/api/v2/cluster/cluster.proto +++ b/envoy/api/v2/cluster/cluster.proto @@ -4,11 +4,11 @@ package envoy.api.v2.cluster; option go_package = "cluster"; import "envoy/api/v2/address.proto"; +import "envoy/api/v2/auth/cert.proto"; import "envoy/api/v2/base.proto"; import "envoy/api/v2/config_source.proto"; import "envoy/api/v2/health_check.proto"; import "envoy/api/v2/protocol.proto"; -import "envoy/api/v2/cert/cert.proto"; import "envoy/api/v2/cluster/circuit_breaker.proto"; import "envoy/api/v2/cluster/outlier_detection.proto"; @@ -146,9 +146,9 @@ message Cluster { // .. attention:: // // Server certificate verification is not enabled by default. Configure - // :ref:`trusted_ca` to enable + // :ref:`trusted_ca` to enable // verification. - cert.UpstreamTlsContext tls_context = 11; + auth.UpstreamTlsContext tls_context = 11; reserved 12; diff --git a/envoy/api/v2/listener/BUILD b/envoy/api/v2/listener/BUILD index 4ba17da1f..f62611329 100644 --- a/envoy/api/v2/listener/BUILD +++ b/envoy/api/v2/listener/BUILD @@ -8,7 +8,7 @@ api_proto_library( deps = [ "//envoy/api/v2:address", "//envoy/api/v2:base", - "//envoy/api/v2/cert", + "//envoy/api/v2/auth:cert", ], ) @@ -18,6 +18,6 @@ api_go_proto_library( deps = [ "//envoy/api/v2:address_go_proto", "//envoy/api/v2:base_go_proto", - "//envoy/api/v2/cert:cert_go_proto", + "//envoy/api/v2/auth:cert_go_proto", ], ) diff --git a/envoy/api/v2/listener/listener.proto b/envoy/api/v2/listener/listener.proto index e9b132feb..e1ae9aab0 100644 --- a/envoy/api/v2/listener/listener.proto +++ b/envoy/api/v2/listener/listener.proto @@ -4,8 +4,8 @@ package envoy.api.v2.listener; option go_package = "listener"; import "envoy/api/v2/address.proto"; +import "envoy/api/v2/auth/cert.proto"; import "envoy/api/v2/base.proto"; -import "envoy/api/v2/cert/cert.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; @@ -167,7 +167,7 @@ message FilterChain { FilterChainMatch filter_chain_match = 1; // The TLS context for this filter chain. - cert.DownstreamTlsContext tls_context = 2; + auth.DownstreamTlsContext tls_context = 2; // A list of individual network filters that make up the filter chain for // connections established with the listener. Order matters as the filters are diff --git a/envoy/service/auth/v2/BUILD b/envoy/service/auth/v2/BUILD new file mode 100644 index 000000000..b5131d82d --- /dev/null +++ b/envoy/service/auth/v2/BUILD @@ -0,0 +1,14 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "external_auth", + srcs = [ + "external_auth.proto", + ], + has_services = 1, + deps = [ + "//envoy/api/v2:address", + ], +) diff --git a/envoy/api/v2/auth/external_auth.proto b/envoy/service/auth/v2/external_auth.proto similarity index 98% rename from envoy/api/v2/auth/external_auth.proto rename to envoy/service/auth/v2/external_auth.proto index 27eaf9c74..0befab914 100644 --- a/envoy/api/v2/auth/external_auth.proto +++ b/envoy/service/auth/v2/external_auth.proto @@ -2,12 +2,13 @@ syntax = "proto3"; // [#proto-status: draft] -package envoy.api.v2.auth; - +package envoy.service.auth.v2; option go_package = "auth"; import "envoy/api/v2/address.proto"; + import "google/protobuf/timestamp.proto"; + import "google/rpc/status.proto"; // A generic interface for performing authorization check on incoming @@ -42,7 +43,7 @@ message AttributeContext { message Peer { // The address of the peer, this is typically the IP address. // It can also be UDS path, or others. - Address address = 1; + envoy.api.v2.Address address = 1; // The canonical service name of the peer. // It should be set to :ref:`the HTTP x-envoy-downstream-service-cluster diff --git a/envoy/service/load_stats/v2/lrs.proto b/envoy/service/load_stats/v2/lrs.proto index 91b2ab57f..87b0a5ba4 100644 --- a/envoy/service/load_stats/v2/lrs.proto +++ b/envoy/service/load_stats/v2/lrs.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package envoy.service.load_stats.v2; +option go_package = "load_stats"; import "envoy/api/v2/base.proto"; From 16c9cc55b10f2efc9483a82f39689c3fb24515c2 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 13:27:17 -0800 Subject: [PATCH 21/47] add accesslog service Signed-off-by: Kuat Yessenov --- envoy/api/v2/filter/accesslog/BUILD | 1 - envoy/api/v2/filter/accesslog/accesslog.proto | 89 ----------------- envoy/service/accesslog/v2/BUILD | 12 +++ envoy/service/accesslog/v2/als.proto | 98 +++++++++++++++++++ 4 files changed, 110 insertions(+), 90 deletions(-) create mode 100644 envoy/service/accesslog/v2/BUILD create mode 100644 envoy/service/accesslog/v2/als.proto diff --git a/envoy/api/v2/filter/accesslog/BUILD b/envoy/api/v2/filter/accesslog/BUILD index 8adfb5c19..6a7af7693 100644 --- a/envoy/api/v2/filter/accesslog/BUILD +++ b/envoy/api/v2/filter/accesslog/BUILD @@ -3,7 +3,6 @@ load("//bazel:api_build_system.bzl", "api_proto_library") api_proto_library( name = "accesslog", srcs = ["accesslog.proto"], - has_services = 1, deps = [ "//envoy/api/v2:address", "//envoy/api/v2:base", diff --git a/envoy/api/v2/filter/accesslog/accesslog.proto b/envoy/api/v2/filter/accesslog/accesslog.proto index 265a44868..9fa8336e4 100644 --- a/envoy/api/v2/filter/accesslog/accesslog.proto +++ b/envoy/api/v2/filter/accesslog/accesslog.proto @@ -5,7 +5,6 @@ option go_package = "accesslog"; import "envoy/api/v2/address.proto"; import "envoy/api/v2/base.proto"; -import "envoy/api/v2/grpc_service.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; @@ -401,91 +400,3 @@ message FileAccessLog { // `. string format = 2; } - -// Configuration for the built-in *envoy.tcp_grpc_access_log* type. This configuration will -// populate *StreamAccessLogsMessage.tcp_logs*. -// [#not-implemented-hide:] -// [#comment:TODO(mattklein123): Block type in non-tcp proxy cases?] -message TcpGrpcAccessLogConfig { - CommonGrpcAccessLogConfig common_config = 1 [(validate.rules).message.required = true]; -} - -// Configuration for the built-in *envoy.http_grpc_access_log* type. This configuration will -// populate *StreamAccessLogsMessage.http_logs*. -// [#not-implemented-hide:] -// [#comment:TODO(mattklein123): Block type in non-http/router proxy cases?] -message HttpGrpcAccessLogConfig { - CommonGrpcAccessLogConfig common_config = 1 [(validate.rules).message.required = true]; - - // Additional request headers to log in *HTTPRequestProperties.request_headers*. - repeated string additional_request_headers_to_log = 2; - - // Additional response headers to log in *HTTPResponseProperties.response_headers*. - repeated string additional_response_headers_to_log = 3; -} - -// Common configuration for gRPC access logs. -// [#not-implemented-hide:] -message CommonGrpcAccessLogConfig { - // The friendly name of the access log to be returned in StreamAccessLogsMessage.Identifier. This - // allows the access log server to differentiate between different access logs coming from the - // same Envoy. - string log_name = 1 [(validate.rules).string.min_bytes = 1]; - - // The gRPC service for the access log service. - GrpcService grpc_service = 2 [(validate.rules).message.required = true]; -} - -// [#proto-status: experimental] -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -// Stream message for the StreamAccessLogs API. Envoy will open a stream to the server and stream -// access logs without ever expecting a response. -message StreamAccessLogsMessage { - message Identifier { - // The node sending the access log messages over the stream. - Node node = 1 [(validate.rules).message.required = true]; - - // The friendly name of the log configured in AccessLogServiceConfig. - string log_name = 2 [(validate.rules).string.min_bytes = 1]; - } - - // Identifier data that will only be sent in the first message on the stream. This is effectively - // structured metadata and is a performance optimization. - Identifier identifier = 1; - - // Wrapper for batches of HTTP access log entries. - message HTTPAccessLogEntries { - repeated HTTPAccessLogEntry log_entry = 1 [(validate.rules).repeated .min_items = 1]; - } - - // Wrapper for batches of TCP access log entries. - message TCPAccessLogEntries { - repeated TCPAccessLogEntry log_entry = 1 [(validate.rules).repeated .min_items = 1]; - } - - // Batches of log entries of a single type. Generally speaking, a given stream should only - // ever incude one type of log entry. - oneof log_entries { - option (validate.required) = true; - - HTTPAccessLogEntries http_logs = 2; - TCPAccessLogEntries tcp_logs = 3; - } -} - -// Empty response for the StreamAccessLogs API. Will never be sent. See below. -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message StreamAccessLogsResponse { -} - -// Service for streaming access logs from Envoy to an access log server. -service AccessLogService { - // Envoy will connect and send StreamAccessLogsMessage messages forever. It does not expect any - // response to be sent as nothing would be done in the case of failure. The server should - // disconnect if it expects Envoy to reconnect. In the future we may decide to add a different - // API for "critical" access logs in which Envoy will buffer access logs for some period of time - // until it gets an ACK so it could then retry. This API is designed for high throughput with the - // expectation that it might be lossy. - rpc StreamAccessLogs(stream StreamAccessLogsMessage) returns (StreamAccessLogsResponse) { - } -} diff --git a/envoy/service/accesslog/v2/BUILD b/envoy/service/accesslog/v2/BUILD new file mode 100644 index 000000000..4d3ba6b59 --- /dev/null +++ b/envoy/service/accesslog/v2/BUILD @@ -0,0 +1,12 @@ +load("//bazel:api_build_system.bzl", "api_proto_library") + +api_proto_library( + name = "als", + srcs = ["als.proto"], + has_services = 1, + deps = [ + "//envoy/api/v2:base", + "//envoy/api/v2:grpc_service", + "//envoy/api/v2/filter/accesslog", + ], +) diff --git a/envoy/service/accesslog/v2/als.proto b/envoy/service/accesslog/v2/als.proto new file mode 100644 index 000000000..48210ebbb --- /dev/null +++ b/envoy/service/accesslog/v2/als.proto @@ -0,0 +1,98 @@ +syntax = "proto3"; + +package envoy.service.accesslog.v2; +option go_package = "accesslog"; + +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/grpc_service.proto"; +import "envoy/api/v2/filter/accesslog/accesslog.proto"; + +import "validate/validate.proto"; + +// Service for streaming access logs from Envoy to an access log server. +service AccessLogService { + // Envoy will connect and send StreamAccessLogsMessage messages forever. It does not expect any + // response to be sent as nothing would be done in the case of failure. The server should + // disconnect if it expects Envoy to reconnect. In the future we may decide to add a different + // API for "critical" access logs in which Envoy will buffer access logs for some period of time + // until it gets an ACK so it could then retry. This API is designed for high throughput with the + // expectation that it might be lossy. + rpc StreamAccessLogs(stream StreamAccessLogsMessage) returns (StreamAccessLogsResponse) { + } +} + +// Empty response for the StreamAccessLogs API. Will never be sent. See below. +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message StreamAccessLogsResponse { +} + +// [#proto-status: experimental] +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +// Stream message for the StreamAccessLogs API. Envoy will open a stream to the server and stream +// access logs without ever expecting a response. +message StreamAccessLogsMessage { + message Identifier { + // The node sending the access log messages over the stream. + envoy.api.v2.Node node = 1 [(validate.rules).message.required = true]; + + // The friendly name of the log configured in AccessLogServiceConfig. + string log_name = 2 [(validate.rules).string.min_bytes = 1]; + } + + // Identifier data that will only be sent in the first message on the stream. This is effectively + // structured metadata and is a performance optimization. + Identifier identifier = 1; + + // Wrapper for batches of HTTP access log entries. + message HTTPAccessLogEntries { + repeated envoy.api.v2.filter.accesslog.HTTPAccessLogEntry log_entry = 1 [(validate.rules).repeated .min_items = 1]; + } + + // Wrapper for batches of TCP access log entries. + message TCPAccessLogEntries { + repeated envoy.api.v2.filter.accesslog.TCPAccessLogEntry log_entry = 1 [(validate.rules).repeated .min_items = 1]; + } + + // Batches of log entries of a single type. Generally speaking, a given stream should only + // ever incude one type of log entry. + oneof log_entries { + option (validate.required) = true; + + HTTPAccessLogEntries http_logs = 2; + TCPAccessLogEntries tcp_logs = 3; + } +} + +// Configuration for the built-in *envoy.tcp_grpc_access_log* type. This configuration will +// populate *StreamAccessLogsMessage.tcp_logs*. +// [#not-implemented-hide:] +// [#comment:TODO(mattklein123): Block type in non-tcp proxy cases?] +message TcpGrpcAccessLogConfig { + CommonGrpcAccessLogConfig common_config = 1 [(validate.rules).message.required = true]; +} + +// Configuration for the built-in *envoy.http_grpc_access_log* type. This configuration will +// populate *StreamAccessLogsMessage.http_logs*. +// [#not-implemented-hide:] +// [#comment:TODO(mattklein123): Block type in non-http/router proxy cases?] +message HttpGrpcAccessLogConfig { + CommonGrpcAccessLogConfig common_config = 1 [(validate.rules).message.required = true]; + + // Additional request headers to log in *HTTPRequestProperties.request_headers*. + repeated string additional_request_headers_to_log = 2; + + // Additional response headers to log in *HTTPResponseProperties.response_headers*. + repeated string additional_response_headers_to_log = 3; +} + +// Common configuration for gRPC access logs. +// [#not-implemented-hide:] +message CommonGrpcAccessLogConfig { + // The friendly name of the access log to be returned in StreamAccessLogsMessage.Identifier. This + // allows the access log server to differentiate between different access logs coming from the + // same Envoy. + string log_name = 1 [(validate.rules).string.min_bytes = 1]; + + // The gRPC service for the access log service. + envoy.api.v2.GrpcService grpc_service = 2 [(validate.rules).message.required = true]; +} From 5a8b24e1b2b4c84d6fbfa71c9835ac3e3a932adb Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 13:41:11 -0800 Subject: [PATCH 22/47] add ratelimit Signed-off-by: Kuat Yessenov --- envoy/BUILD | 1 + envoy/api/v2/auth/auth.proto | 1 + envoy/api/v2/bootstrap/BUILD | 4 +- envoy/api/v2/bootstrap/bootstrap.proto | 4 +- envoy/api/v2/filter/network/BUILD | 2 +- envoy/api/v2/filter/network/rate_limit.proto | 2 +- envoy/api/v2/ratelimit/BUILD | 25 ++------ envoy/api/v2/ratelimit/ratelimit.proto | 62 ++++++++++++++++++ envoy/service/ratelimit/BUILD | 7 ++ envoy/service/ratelimit/v2/BUILD | 22 +++++++ .../ratelimit/v2}/rls.proto | 64 ++----------------- 11 files changed, 109 insertions(+), 85 deletions(-) create mode 100644 envoy/api/v2/ratelimit/ratelimit.proto create mode 100644 envoy/service/ratelimit/BUILD create mode 100644 envoy/service/ratelimit/v2/BUILD rename envoy/{api/v2/ratelimit => service/ratelimit/v2}/rls.proto (62%) diff --git a/envoy/BUILD b/envoy/BUILD index 9becc8002..c40b6d33a 100644 --- a/envoy/BUILD +++ b/envoy/BUILD @@ -16,6 +16,7 @@ proto_library( "//envoy/api/v2/filter/network", "//envoy/api/v2/listener", "//envoy/service/load_stats", + "//envoy/service/ratelimit", "//envoy/api/v2/monitoring:metrics", "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", diff --git a/envoy/api/v2/auth/auth.proto b/envoy/api/v2/auth/auth.proto index ef44e27ec..e97c670ac 100644 --- a/envoy/api/v2/auth/auth.proto +++ b/envoy/api/v2/auth/auth.proto @@ -3,6 +3,7 @@ syntax = "proto3"; // [#proto-status: draft] package envoy.api.v2.auth; +option go_package = "auth"; import "envoy/api/v2/auth/cert.proto"; diff --git a/envoy/api/v2/bootstrap/BUILD b/envoy/api/v2/bootstrap/BUILD index 513091a85..6db291714 100644 --- a/envoy/api/v2/bootstrap/BUILD +++ b/envoy/api/v2/bootstrap/BUILD @@ -15,7 +15,7 @@ api_proto_library( "//envoy/api/v2/listener", "//envoy/api/v2/monitoring:stats", "//envoy/api/v2/monitoring:trace", - "//envoy/api/v2/ratelimit:rls", + "//envoy/service/ratelimit/v2:rls", ], ) @@ -32,6 +32,6 @@ api_go_proto_library( "//envoy/api/v2/listener:listener_go_proto", "//envoy/api/v2/monitoring:stats_go_proto", "//envoy/api/v2/monitoring:trace_go_proto", - "//envoy/api/v2/ratelimit:rls_go_grpc", + "//envoy/service/ratelimit/v2:rls_go_grpc", ], ) diff --git a/envoy/api/v2/bootstrap/bootstrap.proto b/envoy/api/v2/bootstrap/bootstrap.proto index 719d503db..a33c1449b 100644 --- a/envoy/api/v2/bootstrap/bootstrap.proto +++ b/envoy/api/v2/bootstrap/bootstrap.proto @@ -17,7 +17,7 @@ import "envoy/api/v2/grpc_service.proto"; import "envoy/api/v2/listener/listener.proto"; import "envoy/api/v2/monitoring/stats.proto"; import "envoy/api/v2/monitoring/trace.proto"; -import "envoy/api/v2/ratelimit/rls.proto"; +import "envoy/service/ratelimit/v2/rls.proto"; import "google/protobuf/duration.proto"; @@ -109,7 +109,7 @@ message Bootstrap { // Configuration for an external rate limit service provider. If not // specified, any calls to the rate limit service will immediately return // success. - ratelimit.RateLimitServiceConfig rate_limit_service = 10; + envoy.service.ratelimit.v2.RateLimitServiceConfig rate_limit_service = 10; // Configuration for the runtime configuration provider. If not specified, a // “null” provider will be used which will result in all defaults being used. diff --git a/envoy/api/v2/filter/network/BUILD b/envoy/api/v2/filter/network/BUILD index 63e419980..7530df952 100644 --- a/envoy/api/v2/filter/network/BUILD +++ b/envoy/api/v2/filter/network/BUILD @@ -43,7 +43,7 @@ api_proto_library( api_proto_library( name = "rate_limit", srcs = ["rate_limit.proto"], - deps = ["//envoy/api/v2/ratelimit:rls"], + deps = ["//envoy/api/v2/ratelimit"], ) api_proto_library( diff --git a/envoy/api/v2/filter/network/rate_limit.proto b/envoy/api/v2/filter/network/rate_limit.proto index e1322dfde..0d3f5f6ad 100644 --- a/envoy/api/v2/filter/network/rate_limit.proto +++ b/envoy/api/v2/filter/network/rate_limit.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package envoy.api.v2.filter.network; -import "envoy/api/v2/ratelimit/rls.proto"; +import "envoy/api/v2/ratelimit/ratelimit.proto"; import "google/protobuf/duration.proto"; import "validate/validate.proto"; diff --git a/envoy/api/v2/ratelimit/BUILD b/envoy/api/v2/ratelimit/BUILD index 4a5e55872..76db38adb 100644 --- a/envoy/api/v2/ratelimit/BUILD +++ b/envoy/api/v2/ratelimit/BUILD @@ -1,28 +1,13 @@ -load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_grpc_library") +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") licenses(["notice"]) # Apache 2 api_proto_library( - name = "rls", - srcs = ["rls.proto"], - has_services = 1, - deps = [ - "//envoy/api/v2:grpc_service", - ], -) - -api_go_grpc_library( - name = "rls", - proto = ":rls", - deps = [ - "//envoy/api/v2:grpc_service_go_proto", - ], + name = "ratelimit", + srcs = ["ratelimit.proto"], ) -proto_library( +api_go_proto_library( name = "ratelimit", - visibility = ["//envoy:__pkg__"], - deps = [ - ":rls", - ], + proto = ":ratelimit", ) diff --git a/envoy/api/v2/ratelimit/ratelimit.proto b/envoy/api/v2/ratelimit/ratelimit.proto new file mode 100644 index 000000000..47818cdc3 --- /dev/null +++ b/envoy/api/v2/ratelimit/ratelimit.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; + +package envoy.api.v2.ratelimit; +option go_package = "ratelimit"; + +import "validate/validate.proto"; + +// [#protodoc-title: Common rate limit components] + +// A RateLimitDescriptor is a list of hierarchical entries that are used by the service to +// determine the final rate limit key and overall allowed limit. Here are some examples of how +// they might be used for the domain "envoy". +// +// .. code-block:: cpp +// +// ["authenticated": "false"], ["remote_address": "10.0.0.1"] +// +// What it does: Limits all unauthenticated traffic for the IP address 10.0.0.1. The +// configuration supplies a default limit for the *remote_address* key. If there is a desire to +// raise the limit for 10.0.0.1 or block it entirely it can be specified directly in the +// configuration. +// +// .. code-block:: cpp +// +// ["authenticated": "false"], ["path": "/foo/bar"] +// +// What it does: Limits all unauthenticated traffic globally for a specific path (or prefix if +// configured that way in the service). +// +// .. code-block:: cpp +// +// ["authenticated": "false"], ["path": "/foo/bar"], ["remote_address": "10.0.0.1"] +// +// What it does: Limits unauthenticated traffic to a specific path for a specific IP address. +// Like (1) we can raise/block specific IP addresses if we want with an override configuration. +// +// .. code-block:: cpp +// +// ["authenticated": "true"], ["client_id": "foo"] +// +// What it does: Limits all traffic for an authenticated client "foo" +// +// .. code-block:: cpp +// +// ["authenticated": "true"], ["client_id": "foo"], ["path": "/foo/bar"] +// +// What it does: Limits traffic to a specific path for an authenticated client "foo" +// +// The idea behind the API is that (1)/(2)/(3) and (4)/(5) can be sent in 1 request if desired. +// This enables building complex application scenarios with a generic backend. +message RateLimitDescriptor { + message Entry { + // Descriptor key. + string key = 1 [(validate.rules).string.min_bytes = 1]; + + // Descriptor value. + string value = 2 [(validate.rules).string.min_bytes = 1]; + } + + // Descriptor entries. + repeated Entry entries = 1 [(validate.rules).repeated .min_items = 1]; +} diff --git a/envoy/service/ratelimit/BUILD b/envoy/service/ratelimit/BUILD new file mode 100644 index 000000000..5948cff9f --- /dev/null +++ b/envoy/service/ratelimit/BUILD @@ -0,0 +1,7 @@ +proto_library( + name = "ratelimit", + visibility = ["//envoy:__pkg__"], + deps = [ + "//envoy/service/ratelimit/v2:rls", + ], +) diff --git a/envoy/service/ratelimit/v2/BUILD b/envoy/service/ratelimit/v2/BUILD new file mode 100644 index 000000000..1b6db360e --- /dev/null +++ b/envoy/service/ratelimit/v2/BUILD @@ -0,0 +1,22 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_grpc_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "rls", + srcs = ["rls.proto"], + has_services = 1, + deps = [ + "//envoy/api/v2:grpc_service", + "//envoy/api/v2/ratelimit", + ], +) + +api_go_grpc_library( + name = "rls", + proto = ":rls", + deps = [ + "//envoy/api/v2:grpc_service_go_proto", + "//envoy/api/v2/ratelimit:ratelimit_go_proto", + ], +) diff --git a/envoy/api/v2/ratelimit/rls.proto b/envoy/service/ratelimit/v2/rls.proto similarity index 62% rename from envoy/api/v2/ratelimit/rls.proto rename to envoy/service/ratelimit/v2/rls.proto index 3c4fdcfbd..60c8b5cc4 100644 --- a/envoy/api/v2/ratelimit/rls.proto +++ b/envoy/service/ratelimit/v2/rls.proto @@ -1,13 +1,13 @@ syntax = "proto3"; -package envoy.api.v2.ratelimit; +package envoy.service.ratelimit.v2; +option go_package = "ratelimit"; import "envoy/api/v2/grpc_service.proto"; +import "envoy/api/v2/ratelimit/ratelimit.proto"; import "validate/validate.proto"; -// [#protodoc-title: Common rate limit components] - service RateLimitService { // Determine whether rate limiting should take place. rpc ShouldRateLimit(RateLimitRequest) returns (RateLimitResponse) { @@ -30,67 +30,13 @@ message RateLimitRequest { // All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is // processed by the service (see below). If any of the descriptors are over limit, the entire // request is considered to be over limit. - repeated RateLimitDescriptor descriptors = 2; + repeated envoy.api.v2.ratelimit.RateLimitDescriptor descriptors = 2; // Rate limit requests can optionally specify the number of hits a request adds to the matched // limit. If the value is not set in the message, a request increases the matched limit by 1. uint32 hits_addend = 3; } -// A RateLimitDescriptor is a list of hierarchical entries that are used by the service to -// determine the final rate limit key and overall allowed limit. Here are some examples of how -// they might be used for the domain "envoy". -// -// .. code-block:: cpp -// -// ["authenticated": "false"], ["remote_address": "10.0.0.1"] -// -// What it does: Limits all unauthenticated traffic for the IP address 10.0.0.1. The -// configuration supplies a default limit for the *remote_address* key. If there is a desire to -// raise the limit for 10.0.0.1 or block it entirely it can be specified directly in the -// configuration. -// -// .. code-block:: cpp -// -// ["authenticated": "false"], ["path": "/foo/bar"] -// -// What it does: Limits all unauthenticated traffic globally for a specific path (or prefix if -// configured that way in the service). -// -// .. code-block:: cpp -// -// ["authenticated": "false"], ["path": "/foo/bar"], ["remote_address": "10.0.0.1"] -// -// What it does: Limits unauthenticated traffic to a specific path for a specific IP address. -// Like (1) we can raise/block specific IP addresses if we want with an override configuration. -// -// .. code-block:: cpp -// -// ["authenticated": "true"], ["client_id": "foo"] -// -// What it does: Limits all traffic for an authenticated client "foo" -// -// .. code-block:: cpp -// -// ["authenticated": "true"], ["client_id": "foo"], ["path": "/foo/bar"] -// -// What it does: Limits traffic to a specific path for an authenticated client "foo" -// -// The idea behind the API is that (1)/(2)/(3) and (4)/(5) can be sent in 1 request if desired. -// This enables building complex application scenarios with a generic backend. -message RateLimitDescriptor { - message Entry { - // Descriptor key. - string key = 1 [(validate.rules).string.min_bytes = 1]; - - // Descriptor value. - string value = 2 [(validate.rules).string.min_bytes = 1]; - } - - // Descriptor entries. - repeated Entry entries = 1 [(validate.rules).repeated .min_items = 1]; -} - // A response from a ShouldRateLimit call. // [#not-implemented-hide:] Hiding API for now. message RateLimitResponse { @@ -148,6 +94,6 @@ message RateLimitServiceConfig { // Specifies the gRPC service that hosts the rate limit service. The client // will connect to this cluster when it needs to make rate limit service // requests. - GrpcService grpc_service = 2; + envoy.api.v2.GrpcService grpc_service = 2; } } From efbe8e1d4d5298d75933aee0e44459e4be9b00a3 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 13:42:54 -0800 Subject: [PATCH 23/47] format Signed-off-by: Kuat Yessenov --- envoy/BUILD | 6 +++--- envoy/service/accesslog/v2/als.proto | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/envoy/BUILD b/envoy/BUILD index c40b6d33a..054b713dc 100644 --- a/envoy/BUILD +++ b/envoy/BUILD @@ -10,15 +10,15 @@ proto_library( "//envoy/api/v2/cluster", "//envoy/api/v2/cluster:circuit_breaker", "//envoy/api/v2/cluster:outlier_detection", - "//envoy/service/discovery", "//envoy/api/v2/filter/accesslog", "//envoy/api/v2/filter/http", "//envoy/api/v2/filter/network", "//envoy/api/v2/listener", - "//envoy/service/load_stats", - "//envoy/service/ratelimit", "//envoy/api/v2/monitoring:metrics", "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", + "//envoy/service/discovery", + "//envoy/service/load_stats", + "//envoy/service/ratelimit", ], ) diff --git a/envoy/service/accesslog/v2/als.proto b/envoy/service/accesslog/v2/als.proto index 48210ebbb..b0083f4e4 100644 --- a/envoy/service/accesslog/v2/als.proto +++ b/envoy/service/accesslog/v2/als.proto @@ -45,12 +45,14 @@ message StreamAccessLogsMessage { // Wrapper for batches of HTTP access log entries. message HTTPAccessLogEntries { - repeated envoy.api.v2.filter.accesslog.HTTPAccessLogEntry log_entry = 1 [(validate.rules).repeated .min_items = 1]; + repeated envoy.api.v2.filter.accesslog.HTTPAccessLogEntry log_entry = 1 + [(validate.rules).repeated .min_items = 1]; } // Wrapper for batches of TCP access log entries. message TCPAccessLogEntries { - repeated envoy.api.v2.filter.accesslog.TCPAccessLogEntry log_entry = 1 [(validate.rules).repeated .min_items = 1]; + repeated envoy.api.v2.filter.accesslog.TCPAccessLogEntry log_entry = 1 + [(validate.rules).repeated .min_items = 1]; } // Batches of log entries of a single type. Generally speaking, a given stream should only From f0fe9381e159078d2ec10ed0a39b3a43acd77068 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 13:46:33 -0800 Subject: [PATCH 24/47] fix go_package Signed-off-by: Kuat Yessenov --- envoy/api/v2/filter/http/router.proto | 1 + envoy/api/v2/filter/network/tcp_proxy.proto | 1 - envoy/api/v2/monitoring/stats.proto | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/envoy/api/v2/filter/http/router.proto b/envoy/api/v2/filter/http/router.proto index 7ab387099..e75b76aba 100644 --- a/envoy/api/v2/filter/http/router.proto +++ b/envoy/api/v2/filter/http/router.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package envoy.api.v2.filter.http; +option go_package = "http"; import "envoy/api/v2/filter/accesslog/accesslog.proto"; diff --git a/envoy/api/v2/filter/network/tcp_proxy.proto b/envoy/api/v2/filter/network/tcp_proxy.proto index 189dbcd13..8febffaa9 100644 --- a/envoy/api/v2/filter/network/tcp_proxy.proto +++ b/envoy/api/v2/filter/network/tcp_proxy.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package envoy.api.v2.filter.network; -option go_package = "network"; import "envoy/api/v2/filter/accesslog/accesslog.proto"; import "envoy/api/v2/address.proto"; diff --git a/envoy/api/v2/monitoring/stats.proto b/envoy/api/v2/monitoring/stats.proto index 0de620480..701ba8da6 100644 --- a/envoy/api/v2/monitoring/stats.proto +++ b/envoy/api/v2/monitoring/stats.proto @@ -4,6 +4,7 @@ syntax = "proto3"; package envoy.api.v2.monitoring; +option go_package = "monitoring"; import "envoy/api/v2/address.proto"; From 09b971582dbc71cd66ea23ed71c083f1963c2788 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 13:51:38 -0800 Subject: [PATCH 25/47] fix tests Signed-off-by: Kuat Yessenov --- test/build/BUILD | 34 +++++++++++++++++----------------- test/build/build_test.cc | 26 +++++++++++++------------- test/validate/BUILD | 8 ++++---- test/validate/pgv_test.cc | 2 +- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/test/build/BUILD b/test/build/BUILD index 162a257cc..25f4ee4fd 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -6,15 +6,15 @@ api_cc_test( name = "build_test", srcs = ["build_test.cc"], proto_deps = [ - "//envoy/api/v2/discovery:ads", - "//envoy/api/v2/discovery:cds", - "//envoy/api/v2/discovery:eds", - "//envoy/api/v2/discovery:hds", - "//envoy/api/v2/discovery:lds", - "//envoy/api/v2/discovery:rds", - "//envoy/api/v2/filter/accesslog", "//envoy/api/v2/monitoring:metrics", - "//envoy/api/v2/ratelimit:rls", + "//envoy/service/accesslog/v2:als", + "//envoy/service/discovery/v2:ads", + "//envoy/service/discovery/v2:cds", + "//envoy/service/discovery/v2:eds", + "//envoy/service/discovery/v2:hds", + "//envoy/service/discovery/v2:lds", + "//envoy/service/discovery/v2:rds", + "//envoy/service/ratelimit/v2:rls", ], ) @@ -24,15 +24,15 @@ api_go_test( srcs = ["go_build_test.go"], importpath = "go_build_test", deps = [ + "//envoy/api/v2/auth:cert_go_proto", "//envoy/api/v2/bootstrap:bootstrap_go_proto", - "//envoy/api/v2/cert:cert_go_proto", - "//envoy/api/v2/discovery:ads_go_grpc", - "//envoy/api/v2/discovery:cds_go_grpc", - "//envoy/api/v2/discovery:eds_go_grpc", - "//envoy/api/v2/discovery:hds_go_grpc", - "//envoy/api/v2/discovery:lds_go_grpc", - "//envoy/api/v2/discovery:rds_go_grpc", - "//envoy/api/v2/discovery:sds_go_grpc", - "//envoy/api/v2/ratelimit:rls_go_grpc", + "//envoy/service/discovery/v2:ads_go_grpc", + "//envoy/service/discovery/v2:cds_go_grpc", + "//envoy/service/discovery/v2:eds_go_grpc", + "//envoy/service/discovery/v2:hds_go_grpc", + "//envoy/service/discovery/v2:lds_go_grpc", + "//envoy/service/discovery/v2:rds_go_grpc", + "//envoy/service/discovery/v2:sds_go_grpc", + "//envoy/service/ratelimit/v2:rls_go_grpc", ], ) diff --git a/test/build/build_test.cc b/test/build/build_test.cc index c94389125..7db3aef73 100644 --- a/test/build/build_test.cc +++ b/test/build/build_test.cc @@ -6,20 +6,20 @@ // Basic C++ build/link validation for the v2 xDS APIs. int main(int argc, char* argv[]) { const auto methods = { - "envoy.api.v2.discovery.AggregatedDiscoveryService.StreamAggregatedResources", - "envoy.api.v2.discovery.ClusterDiscoveryService.FetchClusters", - "envoy.api.v2.discovery.ClusterDiscoveryService.StreamClusters", - "envoy.api.v2.discovery.EndpointDiscoveryService.FetchEndpoints", - "envoy.api.v2.discovery.EndpointDiscoveryService.StreamEndpoints", - "envoy.api.v2.discovery.HealthDiscoveryService.FetchHealthCheck", - "envoy.api.v2.discovery.HealthDiscoveryService.StreamHealthCheck", - "envoy.api.v2.discovery.ListenerDiscoveryService.FetchListeners", - "envoy.api.v2.discovery.ListenerDiscoveryService.StreamListeners", - "envoy.api.v2.discovery.RouteDiscoveryService.FetchRoutes", - "envoy.api.v2.discovery.RouteDiscoveryService.StreamRoutes", - "envoy.api.v2.filter.accesslog.AccessLogService.StreamAccessLogs", + "envoy.service.discovery.v2.AggregatedDiscoveryService.StreamAggregatedResources", + "envoy.service.discovery.v2.ClusterDiscoveryService.FetchClusters", + "envoy.service.discovery.v2.ClusterDiscoveryService.StreamClusters", + "envoy.service.discovery.v2.EndpointDiscoveryService.FetchEndpoints", + "envoy.service.discovery.v2.EndpointDiscoveryService.StreamEndpoints", + "envoy.service.discovery.v2.HealthDiscoveryService.FetchHealthCheck", + "envoy.service.discovery.v2.HealthDiscoveryService.StreamHealthCheck", + "envoy.service.discovery.v2.ListenerDiscoveryService.FetchListeners", + "envoy.service.discovery.v2.ListenerDiscoveryService.StreamListeners", + "envoy.service.discovery.v2.RouteDiscoveryService.FetchRoutes", + "envoy.service.discovery.v2.RouteDiscoveryService.StreamRoutes", + "envoy.service.accesslog.v2.AccessLogService.StreamAccessLogs", "envoy.api.v2.monitoring.MetricsService.StreamMetrics", - "envoy.api.v2.ratelimit.RateLimitService.ShouldRateLimit", + "envoy.service.ratelimit.v2.RateLimitService.ShouldRateLimit", }; for (const auto& method : methods) { diff --git a/test/validate/BUILD b/test/validate/BUILD index 2ced8a390..068015c31 100644 --- a/test/validate/BUILD +++ b/test/validate/BUILD @@ -8,10 +8,6 @@ api_cc_test( proto_deps = [ "//envoy/api/v2:protocol", "//envoy/api/v2/bootstrap", - "//envoy/api/v2/discovery:cds", - "//envoy/api/v2/discovery:eds", - "//envoy/api/v2/discovery:lds", - "//envoy/api/v2/discovery:rds", "//envoy/api/v2/filter/accesslog", "//envoy/api/v2/filter/http:buffer", "//envoy/api/v2/filter/http:fault", @@ -24,5 +20,9 @@ api_cc_test( "//envoy/api/v2/filter/network:mongo_proxy", "//envoy/api/v2/filter/network:redis_proxy", "//envoy/api/v2/filter/network:tcp_proxy", + "//envoy/service/discovery/v2:cds", + "//envoy/service/discovery/v2:eds", + "//envoy/service/discovery/v2:lds", + "//envoy/service/discovery/v2:rds", ], ) diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index cbf49f03f..ed2731c63 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -6,7 +6,6 @@ #include "envoy/api/v2/protocol.pb.validate.h" #include "envoy/api/v2/bootstrap/bootstrap.pb.validate.h" #include "envoy/api/v2/cluster/cluster.pb.validate.h" -#include "envoy/api/v2/discovery/eds.pb.validate.h" #include "envoy/api/v2/filter/accesslog/accesslog.pb.validate.h" #include "envoy/api/v2/filter/http/buffer.pb.validate.h" #include "envoy/api/v2/filter/http/fault.pb.validate.h" @@ -21,6 +20,7 @@ #include "envoy/api/v2/filter/network/tcp_proxy.pb.validate.h" #include "envoy/api/v2/listener/listener.pb.validate.h" #include "envoy/api/v2/route/route.pb.validate.h" +#include "envoy/service/discovery/v2/eds.pb.validate.h" #include "google/protobuf/text_format.h" From a48a7829c41207d10e0ea8870c89d6adc59e711e Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 14:51:26 -0800 Subject: [PATCH 26/47] move bootstrap out of core Signed-off-by: Kuat Yessenov --- ci/do_ci.sh | 2 +- envoy/BUILD | 2 +- .../{api/v2/bootstrap => bootstrap/v2}/BUILD | 2 -- .../v2}/bootstrap.proto | 32 +++++++++---------- test/build/BUILD | 2 +- test/validate/BUILD | 2 +- test/validate/pgv_test.cc | 8 ++--- 7 files changed, 24 insertions(+), 26 deletions(-) rename envoy/{api/v2/bootstrap => bootstrap/v2}/BUILD (92%) rename envoy/{api/v2/bootstrap => bootstrap/v2}/bootstrap.proto (91%) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index cadeb639a..61d6194dd 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -15,7 +15,7 @@ echo "building using ${NUM_CPUS} CPUs" if [[ "$1" == "bazel.test" ]]; then echo "bazel building and testing..." - bazel --batch build ${BAZEL_BUILD_OPTIONS} //envoy/api/... + bazel --batch build ${BAZEL_BUILD_OPTIONS} //envoy/... bazel --batch test ${BAZEL_TEST_OPTIONS} //test/... //tools/... exit 0 elif [[ "$1" == "bazel.docs" ]]; then diff --git a/envoy/BUILD b/envoy/BUILD index 054b713dc..031d3f568 100644 --- a/envoy/BUILD +++ b/envoy/BUILD @@ -6,7 +6,6 @@ proto_library( name = "envoy", deps = [ "//envoy/api/v2", - "//envoy/api/v2/bootstrap", "//envoy/api/v2/cluster", "//envoy/api/v2/cluster:circuit_breaker", "//envoy/api/v2/cluster:outlier_detection", @@ -17,6 +16,7 @@ proto_library( "//envoy/api/v2/monitoring:metrics", "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", + "//envoy/bootstrap/v2:bootstrap", "//envoy/service/discovery", "//envoy/service/load_stats", "//envoy/service/ratelimit", diff --git a/envoy/api/v2/bootstrap/BUILD b/envoy/bootstrap/v2/BUILD similarity index 92% rename from envoy/api/v2/bootstrap/BUILD rename to envoy/bootstrap/v2/BUILD index 6db291714..6b5c6f427 100644 --- a/envoy/api/v2/bootstrap/BUILD +++ b/envoy/bootstrap/v2/BUILD @@ -9,7 +9,6 @@ api_proto_library( "//envoy/api/v2:address", "//envoy/api/v2:base", "//envoy/api/v2:config_source", - "//envoy/api/v2:grpc_service", "//envoy/api/v2/auth:cert", "//envoy/api/v2/cluster", "//envoy/api/v2/listener", @@ -26,7 +25,6 @@ api_go_proto_library( "//envoy/api/v2:address_go_proto", "//envoy/api/v2:base_go_proto", "//envoy/api/v2:config_source_go_proto", - "//envoy/api/v2:grpc_service_go_proto", "//envoy/api/v2/auth:cert_go_proto", "//envoy/api/v2/cluster:cluster_go_proto", "//envoy/api/v2/listener:listener_go_proto", diff --git a/envoy/api/v2/bootstrap/bootstrap.proto b/envoy/bootstrap/v2/bootstrap.proto similarity index 91% rename from envoy/api/v2/bootstrap/bootstrap.proto rename to envoy/bootstrap/v2/bootstrap.proto index a33c1449b..0c4f37185 100644 --- a/envoy/api/v2/bootstrap/bootstrap.proto +++ b/envoy/bootstrap/v2/bootstrap.proto @@ -5,7 +5,7 @@ syntax = "proto3"; -package envoy.api.v2.bootstrap; +package envoy.bootstrap.v2; option go_package = "bootstrap"; import "envoy/api/v2/address.proto"; @@ -13,7 +13,6 @@ import "envoy/api/v2/base.proto"; import "envoy/api/v2/auth/cert.proto"; import "envoy/api/v2/config_source.proto"; import "envoy/api/v2/cluster/cluster.proto"; -import "envoy/api/v2/grpc_service.proto"; import "envoy/api/v2/listener/listener.proto"; import "envoy/api/v2/monitoring/stats.proto"; import "envoy/api/v2/monitoring/trace.proto"; @@ -28,12 +27,12 @@ import "gogoproto/gogo.proto"; message Bootstrap { // Node identity to present to the management server and for instance // identification purposes (e.g. in generated headers). - Node node = 1; + envoy.api.v2.Node node = 1; message StaticResources { // Static :ref:`Listeners `. These listeners are // available regardless of LDS configuration. - repeated listener.Listener listeners = 1; + repeated envoy.api.v2.listener.Listener listeners = 1; // If a network based configuration source is specified for :ref:`cds_config // `, it's necessary @@ -41,10 +40,10 @@ message Bootstrap { // how to speak to the management server. These cluster definitions may not // use :ref:`EDS ` (i.e. they should be static // IP or DNS-based). - repeated cluster.Cluster clusters = 2; + repeated envoy.api.v2.cluster.Cluster clusters = 2; // [#not-implemented-hide:] - repeated auth.Secret secrets = 3; + repeated envoy.api.v2.auth.Secret secrets = 3; } // Statically specified resources. StaticResources static_resources = 2; @@ -52,12 +51,12 @@ message Bootstrap { message DynamicResources { // All :ref:`Listeners ` are provided by a single // :ref:`LDS ` configuration source. - ConfigSource lds_config = 1; + envoy.api.v2.ConfigSource lds_config = 1; // All post-bootstrap :ref:`Cluster ` definitions are // provided by a single :ref:`CDS ` // configuration source. - ConfigSource cds_config = 2; + envoy.api.v2.ConfigSource cds_config = 2; // A single :ref:`ADS ` source may be optionally // specified. This must have :ref:`api_type @@ -66,14 +65,14 @@ message Bootstrap { // :ref:`ConfigSources ` that have // the :ref:`ads ` field set will be // streamed on the ADS channel. - ApiConfigSource ads_config = 3; + envoy.api.v2.ApiConfigSource ads_config = 3; message DeprecatedV1 { // This is the global :ref:`SDS ` config // when using v1 REST for :ref:`CDS // `/:ref:`EDS // `. - ConfigSource sds_config = 1; + envoy.api.v2.ConfigSource sds_config = 1; } DeprecatedV1 deprecated_v1 = 4; } @@ -88,10 +87,10 @@ message Bootstrap { string flags_path = 5; // Optional set of stats sinks. - repeated monitoring.StatsSink stats_sinks = 6; + repeated envoy.api.v2.monitoring.StatsSink stats_sinks = 6; // Configuration for internal processing of stats. - monitoring.StatsConfig stats_config = 13; + envoy.api.v2.monitoring.StatsConfig stats_config = 13; // Optional duration between flushes to configured stats sinks. For // performance reasons Envoy latches counters and only flushes counters and @@ -104,7 +103,7 @@ message Bootstrap { // Configuration for an external tracing provider. If not specified, no // tracing will be performed. - monitoring.Tracing tracing = 9; + envoy.api.v2.monitoring.Tracing tracing = 9; // Configuration for an external rate limit service provider. If not // specified, any calls to the rate limit service will immediately return @@ -131,7 +130,8 @@ message Admin { string profile_path = 2; // The TCP address that the administration server will listen on. - Address address = 3 [(validate.rules).message.required = true, (gogoproto.nullable) = false]; + envoy.api.v2.Address address = 3 + [(validate.rules).message.required = true, (gogoproto.nullable) = false]; } // Cluster manager :ref:`architecture overview `. @@ -156,12 +156,12 @@ message ClusterManager { // Optional configuration used to bind newly established upstream connections. // This may be overridden on a per-cluster basis by upstream_bind_config in the cds_config. - BindConfig upstream_bind_config = 3; + envoy.api.v2.BindConfig upstream_bind_config = 3; // A management server endpoint to stream load stats to via // *StreamLoadStats*. This must have :ref:`api_type ` // :ref:`GRPC `. - ApiConfigSource load_stats_config = 4; + envoy.api.v2.ApiConfigSource load_stats_config = 4; } // Envoy process watchdog configuration. When configured, this monitors for diff --git a/test/build/BUILD b/test/build/BUILD index 25f4ee4fd..59590ae32 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -25,7 +25,7 @@ api_go_test( importpath = "go_build_test", deps = [ "//envoy/api/v2/auth:cert_go_proto", - "//envoy/api/v2/bootstrap:bootstrap_go_proto", + "//envoy/bootstrap/v2:bootstrap_go_proto", "//envoy/service/discovery/v2:ads_go_grpc", "//envoy/service/discovery/v2:cds_go_grpc", "//envoy/service/discovery/v2:eds_go_grpc", diff --git a/test/validate/BUILD b/test/validate/BUILD index 068015c31..0a8731929 100644 --- a/test/validate/BUILD +++ b/test/validate/BUILD @@ -7,7 +7,6 @@ api_cc_test( srcs = ["pgv_test.cc"], proto_deps = [ "//envoy/api/v2:protocol", - "//envoy/api/v2/bootstrap", "//envoy/api/v2/filter/accesslog", "//envoy/api/v2/filter/http:buffer", "//envoy/api/v2/filter/http:fault", @@ -20,6 +19,7 @@ api_cc_test( "//envoy/api/v2/filter/network:mongo_proxy", "//envoy/api/v2/filter/network:redis_proxy", "//envoy/api/v2/filter/network:tcp_proxy", + "//envoy/bootstrap/v2:bootstrap", "//envoy/service/discovery/v2:cds", "//envoy/service/discovery/v2:eds", "//envoy/service/discovery/v2:lds", diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index ed2731c63..a20d4a658 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -4,7 +4,6 @@ // We don't use all the headers in the test below, but including them anyway as // a cheap way to get some C++ compiler sanity checking. #include "envoy/api/v2/protocol.pb.validate.h" -#include "envoy/api/v2/bootstrap/bootstrap.pb.validate.h" #include "envoy/api/v2/cluster/cluster.pb.validate.h" #include "envoy/api/v2/filter/accesslog/accesslog.pb.validate.h" #include "envoy/api/v2/filter/http/buffer.pb.validate.h" @@ -20,6 +19,7 @@ #include "envoy/api/v2/filter/network/tcp_proxy.pb.validate.h" #include "envoy/api/v2/listener/listener.pb.validate.h" #include "envoy/api/v2/route/route.pb.validate.h" +#include "envoy/bootstrap/v2/bootstrap.pb.validate.h" #include "envoy/service/discovery/v2/eds.pb.validate.h" #include "google/protobuf/text_format.h" @@ -46,7 +46,7 @@ template struct TestCase { // Basic protoc-gen-validate C++ validation header inclusion and Validate calls // from data-plane-api. int main(int argc, char* argv[]) { - envoy::api::v2::bootstrap::Bootstrap invalid_bootstrap; + envoy::bootstrap::v2::Bootstrap invalid_bootstrap; // This is a baseline test of the validation features we care about. It's // probably not worth adding in every filter and field that we want to valid // in the API upfront, but as regressions occur, this is the place to add the @@ -59,12 +59,12 @@ int main(int argc, char* argv[]) { address {} } )EOF"; - envoy::api::v2::bootstrap::Bootstrap valid_bootstrap; + envoy::bootstrap::v2::Bootstrap valid_bootstrap; if (!google::protobuf::TextFormat::ParseFromString(valid_bootstrap_text, &valid_bootstrap)) { std::cerr << "Unable to parse text proto: " << valid_bootstrap_text << std::endl; exit(EXIT_FAILURE); } - TestCase{invalid_bootstrap, valid_bootstrap}.run(); + TestCase{invalid_bootstrap, valid_bootstrap}.run(); exit(EXIT_SUCCESS); } From 970da792d56318fed4e66e5fa921dc674644da48 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 15:46:04 -0800 Subject: [PATCH 27/47] fix docs Signed-off-by: Kuat Yessenov --- docs/build.sh | 17 ++++---- docs/root/api-v2/api.rst | 41 ++++++++++--------- .../api-v2/{ => api/v2}/filter/filter.rst | 0 .../api-v2/{ => api/v2}/filter/http/http.rst | 0 .../{ => api/v2}/filter/network/network.rst | 0 .../cluster_manager/cluster_manager.rst | 2 +- .../configuration/http_conn_man/headers.rst | 2 +- .../configuration/overview/v2_overview.rst | 36 ++++++++-------- docs/root/configuration/rate_limit.rst | 2 +- docs/root/configuration/runtime.rst | 2 +- .../arch_overview/dynamic_configuration.rst | 2 +- .../intro/arch_overview/load_balancing.rst | 2 +- docs/root/intro/arch_overview/ssl.rst | 4 +- docs/root/intro/arch_overview/statistics.rst | 2 +- docs/root/intro/version_history.rst | 6 +-- docs/root/operations/admin.rst | 2 +- docs/root/operations/cli.rst | 6 +-- envoy/api/v2/auth/cert.proto | 8 ++-- envoy/api/v2/base.proto | 1 - .../network/http_connection_manager.proto | 1 - envoy/api/v2/monitoring/trace.proto | 6 +-- envoy/bootstrap/v2/bootstrap.proto | 4 +- envoy/service/ratelimit/v2/rls.proto | 2 + 23 files changed, 75 insertions(+), 73 deletions(-) rename docs/root/api-v2/{ => api/v2}/filter/filter.rst (100%) rename docs/root/api-v2/{ => api/v2}/filter/http/http.rst (100%) rename docs/root/api-v2/{ => api/v2}/filter/network/network.rst (100%) diff --git a/docs/build.sh b/docs/build.sh index 4c900986f..f1f2504ac 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -20,7 +20,7 @@ fi source "${BUILD_DIR}"/venv/bin/activate -bazel --batch build ${BAZEL_BUILD_OPTIONS} //envoy/api/v2:api --aspects \ +bazel --batch build ${BAZEL_BUILD_OPTIONS} //envoy --aspects \ tools/protodoc/protodoc.bzl%proto_doc_aspect --output_groups=rst --action_env=CPROFILE_ENABLED # These are the protos we want to put in docs, this list will grow. @@ -28,19 +28,21 @@ bazel --batch build ${BAZEL_BUILD_OPTIONS} //envoy/api/v2:api --aspects \ PROTO_RST=" /envoy/api/v2/address/envoy/api/v2/address.proto.rst /envoy/api/v2/base/envoy/api/v2/base.proto.rst - /envoy/api/v2/bootstrap/bootstrap/envoy/api/v2/bootstrap/bootstrap.proto.rst - /envoy/api/v2/cert/cert/envoy/api/v2/cert/cert.proto.rst + /envoy/api/v2/auth/cert/envoy/api/v2/auth/cert.proto.rst /envoy/api/v2/cluster/cluster/envoy/api/v2/cluster/cluster.proto.rst /envoy/api/v2/cluster/outlier_detection/envoy/api/v2/cluster/outlier_detection.proto.rst /envoy/api/v2/cluster/circuit_breaker/envoy/api/v2/cluster/circuit_breaker.proto.rst /envoy/api/v2/route/route/envoy/api/v2/route/route.proto.rst /envoy/api/v2/listener/listener/envoy/api/v2/listener/listener.proto.rst /envoy/api/v2/config_source/envoy/api/v2/config_source.proto.rst - /envoy/api/v2/discovery/common/envoy/api/v2/discovery/common.proto.rst - /envoy/api/v2/discovery/eds/envoy/api/v2/discovery/eds.proto.rst /envoy/api/v2/grpc_service/envoy/api/v2/grpc_service.proto.rst /envoy/api/v2/health_check/envoy/api/v2/health_check.proto.rst - /envoy/api/v2/ratelimit/rls/envoy/api/v2/ratelimit/rls.proto.rst + /envoy/api/v2/protocol/envoy/api/v2/protocol.proto.rst + /envoy/api/v2/ratelimit/ratelimit/envoy/api/v2/ratelimit/ratelimit.proto.rst + /envoy/bootstrap/v2/bootstrap/envoy/bootstrap/v2/bootstrap.proto.rst + /envoy/service/discovery/v2/common/envoy/service/discovery/v2/common.proto.rst + /envoy/service/discovery/v2/eds/envoy/service/discovery/v2/eds.proto.rst + /envoy/service/ratelimit/v2/rls/envoy/service/ratelimit/v2/rls.proto.rst /envoy/api/v2/monitoring/metrics/envoy/api/v2/monitoring/metrics_service.proto.rst /envoy/api/v2/monitoring/stats/envoy/api/v2/monitoring/stats.proto.rst /envoy/api/v2/monitoring/trace/envoy/api/v2/monitoring/trace.proto.rst @@ -60,7 +62,6 @@ PROTO_RST=" /envoy/api/v2/filter/network/rate_limit/envoy/api/v2/filter/network/rate_limit.proto.rst /envoy/api/v2/filter/network/redis_proxy/envoy/api/v2/filter/network/redis_proxy.proto.rst /envoy/api/v2/filter/network/tcp_proxy/envoy/api/v2/filter/network/tcp_proxy.proto.rst - /envoy/api/v2/protocol/envoy/api/v2/protocol.proto.rst " # Dump all the generated RST so they can be added to PROTO_RST easily. @@ -69,7 +70,7 @@ find -L bazel-bin -name "*.proto.rst" # Only copy in the protos we care about and know how to deal with in protodoc. for p in $PROTO_RST do - DEST="${GENERATED_RST_DIR}/api-v2/$(sed -e 's#/envoy\/api\/v2.*/envoy\/api\/v2/##' <<< "$p")" + DEST="${GENERATED_RST_DIR}/api-v2/$(sed -e 's#/envoy\/.*/envoy/##' <<< "$p")" mkdir -p "$(dirname "${DEST}")" cp -f bazel-bin/"${p}" "$(dirname "${DEST}")" [ -n "${CPROFILE_ENABLED}" ] && cp -f bazel-bin/"${p}".profile "$(dirname "${DEST}")" diff --git a/docs/root/api-v2/api.rst b/docs/root/api-v2/api.rst index 2e4756a2f..e35e39022 100644 --- a/docs/root/api-v2/api.rst +++ b/docs/root/api-v2/api.rst @@ -7,23 +7,24 @@ v2 API reference :glob: :maxdepth: 2 - bootstrap/bootstrap.proto - config_source.proto - grpc_service.proto - listener/listener.proto - cluster/cluster.proto - cluster/outlier_detection.proto - cluster/circuit_breaker.proto - discovery/eds.proto - health_check.proto - route/route.proto - cert/cert.proto - monitoring/stats.proto - monitoring/metrics_service.proto - monitoring/trace.proto - base.proto - address.proto - protocol.proto - discovery/common.proto - ratelimit/rls.proto - filter/filter + bootstrap/v2/bootstrap.proto + api/v2/config_source.proto + api/v2/grpc_service.proto + api/v2/listener/listener.proto + api/v2/cluster/cluster.proto + api/v2/cluster/outlier_detection.proto + api/v2/cluster/circuit_breaker.proto + service/discovery/v2/eds.proto + api/v2/health_check.proto + api/v2/route/route.proto + api/v2/auth/cert.proto + api/v2/monitoring/stats.proto + api/v2/monitoring/metrics_service.proto + api/v2/monitoring/trace.proto + api/v2/base.proto + api/v2/address.proto + api/v2/protocol.proto + service/discovery/v2/common.proto + api/v2/ratelimit/ratelimit.proto + service/ratelimit/v2/rls.proto + api/v2/filter/filter diff --git a/docs/root/api-v2/filter/filter.rst b/docs/root/api-v2/api/v2/filter/filter.rst similarity index 100% rename from docs/root/api-v2/filter/filter.rst rename to docs/root/api-v2/api/v2/filter/filter.rst diff --git a/docs/root/api-v2/filter/http/http.rst b/docs/root/api-v2/api/v2/filter/http/http.rst similarity index 100% rename from docs/root/api-v2/filter/http/http.rst rename to docs/root/api-v2/api/v2/filter/http/http.rst diff --git a/docs/root/api-v2/filter/network/network.rst b/docs/root/api-v2/api/v2/filter/network/network.rst similarity index 100% rename from docs/root/api-v2/filter/network/network.rst rename to docs/root/api-v2/api/v2/filter/network/network.rst diff --git a/docs/root/configuration/cluster_manager/cluster_manager.rst b/docs/root/configuration/cluster_manager/cluster_manager.rst index f7ca59217..6be8a1e88 100644 --- a/docs/root/configuration/cluster_manager/cluster_manager.rst +++ b/docs/root/configuration/cluster_manager/cluster_manager.rst @@ -14,4 +14,4 @@ Cluster manager * Cluster manager :ref:`architecture overview ` * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` diff --git a/docs/root/configuration/http_conn_man/headers.rst b/docs/root/configuration/http_conn_man/headers.rst index 2e4591364..45388a2b5 100644 --- a/docs/root/configuration/http_conn_man/headers.rst +++ b/docs/root/configuration/http_conn_man/headers.rst @@ -315,7 +315,7 @@ Supported dynamic values are: :ref:`x-forwarded-proto ` request header. %UPSTREAM_METADATA(["namespace", "key", ...])% - Populates the header with ref:`EDS endpoint metadata ` from the + Populates the header with ref:`EDS endpoint metadata ` from the upstream host selected by the router. Metadata may be selected from any namespace. In general, metadata values may be strings, numbers, booleans, lists, nested structures, or null. Upstream metadata values may be selected from nested structs by specifying multiple keys. Otherwise, diff --git a/docs/root/configuration/overview/v2_overview.rst b/docs/root/configuration/overview/v2_overview.rst index 7279ddd54..1fc1ba1c3 100644 --- a/docs/root/configuration/overview/v2_overview.rst +++ b/docs/root/configuration/overview/v2_overview.rst @@ -44,15 +44,15 @@ where the extension reflects the underlying v2 config representation. The to autodetect the config file version, but this option provides an enhanced debug experience when configuration parsing fails. -The :ref:`Bootstrap ` message is the root of the -configuration. A key concept in the :ref:`Bootstrap ` +The :ref:`Bootstrap ` message is the root of the +configuration. A key concept in the :ref:`Bootstrap ` message is the distinction between static and dynamic resouces. Resources such as a :ref:`Listener ` or :ref:`Cluster ` may be supplied either statically in -:ref:`static_resources ` or have +:ref:`static_resources ` or have an xDS service such as :ref:`LDS ` or :ref:`CDS ` configured in -:ref:`dynamic_resources `. +:ref:`dynamic_resources `. Example ------- @@ -105,7 +105,7 @@ Mostly static with dynamic EDS A bootstrap config that continues from the above example with :ref:`dynamic endpoint discovery ` via an -:ref:`EDS` gRPC management server listening +:ref:`EDS` gRPC management server listening on 127.0.0.3:5678 is provided below: .. code-block:: yaml @@ -158,7 +158,7 @@ an otherwise completely dynamic configurations, some static resources need to be defined to point Envoy at its xDS management server(s). In the above example, the EDS management server could then return a proto encoding of a -:ref:`DiscoveryResponse `: +:ref:`DiscoveryResponse `: .. code-block:: yaml @@ -293,8 +293,8 @@ Management server A v2 xDS management server will implement the below endpoints as required for gRPC and/or REST serving. In both streaming gRPC and -REST-JSON cases, a :ref:`DiscoveryRequest ` is sent and a -:ref:`DiscoveryResponse ` received following the +REST-JSON cases, a :ref:`DiscoveryRequest ` is sent and a +:ref:`DiscoveryResponse ` received following the `xDS protocol `_. .. _v2_grpc_streaming_endpoints: @@ -316,8 +316,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /envoy.api.v2.EndpointDiscoveryService/StreamEndpoints @@ -350,8 +350,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /envoy.api.v2.RouteDiscoveryService/StreamRoutes @@ -388,8 +388,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /v2/discovery:endpoints @@ -422,8 +422,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /v2/discovery:routes @@ -488,8 +488,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_ads_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. When this is set, any of the configuration sources :ref:`above ` can be set to use the ADS channel. For example, a LDS config could be changed from diff --git a/docs/root/configuration/rate_limit.rst b/docs/root/configuration/rate_limit.rst index 56cb42ad8..322d64089 100644 --- a/docs/root/configuration/rate_limit.rst +++ b/docs/root/configuration/rate_limit.rst @@ -8,7 +8,7 @@ limit service Envoy should talk to when it needs to make global rate limit decis limit service is configured, a "null" service will be used which will always return OK if called. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` gRPC service IDL ---------------- diff --git a/docs/root/configuration/runtime.rst b/docs/root/configuration/runtime.rst index f9d779847..36c5f35c8 100644 --- a/docs/root/configuration/runtime.rst +++ b/docs/root/configuration/runtime.rst @@ -8,7 +8,7 @@ system tree that contains re-loadable configuration elements. If runtime is not provider is used which has the effect of using all defaults built into the code. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` File system layout ------------------ diff --git a/docs/root/intro/arch_overview/dynamic_configuration.rst b/docs/root/intro/arch_overview/dynamic_configuration.rst index fd67e7786..33648b652 100644 --- a/docs/root/intro/arch_overview/dynamic_configuration.rst +++ b/docs/root/intro/arch_overview/dynamic_configuration.rst @@ -34,7 +34,7 @@ SDS/EDS only The :ref:`service discovery service (SDS) API ` provides a more advanced mechanism by which Envoy can discover members of an upstream cluster. SDS has been renamed to :ref:`Endpoint -Discovery Service (EDS)` in the +Discovery Service (EDS)` in the :ref:`v2 API `. Layered on top of a static configuration, SDS allows an Envoy deployment to circumvent the limitations of DNS (maximum records in a response, etc.) as well as consume more information used in load balancing and routing (e.g., diff --git a/docs/root/intro/arch_overview/load_balancing.rst b/docs/root/intro/arch_overview/load_balancing.rst index 876049846..f82744ac4 100644 --- a/docs/root/intro/arch_overview/load_balancing.rst +++ b/docs/root/intro/arch_overview/load_balancing.rst @@ -97,7 +97,7 @@ Priority levels ------------------ During load balancing, Envoy will generally only consider hosts configured at the highest priority -level. For each EDS :ref:`LocalityLbEndpoints` an optional +level. For each EDS :ref:`LocalityLbEndpoints` an optional priority may also be specified. When endpoints at the highest priority level (P=0) are healthy, all traffic will land on endpoints in that priority level. As endpoints for the highest priority level become unhealthy, traffic will begin to trickle to lower priority levels. diff --git a/docs/root/intro/arch_overview/ssl.rst b/docs/root/intro/arch_overview/ssl.rst index c809e8157..234ccd4cf 100644 --- a/docs/root/intro/arch_overview/ssl.rst +++ b/docs/root/intro/arch_overview/ssl.rst @@ -78,8 +78,8 @@ standard Debian installations. Common paths for system CA bundles on Linux and B * /usr/local/etc/ssl/cert.pem (FreeBSD) * /etc/ssl/cert.pem (OpenBSD) -See the reference for :ref:`UpstreamTlsContexts ` and -:ref:`DownstreamTlsContexts ` for other TLS options. +See the reference for :ref:`UpstreamTlsContexts ` and +:ref:`DownstreamTlsContexts ` for other TLS options. .. _arch_overview_ssl_auth_filter: diff --git a/docs/root/intro/arch_overview/statistics.rst b/docs/root/intro/arch_overview/statistics.rst index dbe7dcd9e..46fcf66e2 100644 --- a/docs/root/intro/arch_overview/statistics.rst +++ b/docs/root/intro/arch_overview/statistics.rst @@ -23,4 +23,4 @@ received. Note: what were previously referred to as timers have become histogram difference between the two representations was the units. * :ref:`v1 API reference `. -* :ref:`v2 API reference `. +* :ref:`v2 API reference `. diff --git a/docs/root/intro/version_history.rst b/docs/root/intro/version_history.rst index c86ca8ced..8881ed2fc 100644 --- a/docs/root/intro/version_history.rst +++ b/docs/root/intro/version_history.rst @@ -60,10 +60,10 @@ Version history * tcp proxy: enable use of :ref:`outlier detector `. * tls: added :ref:`SNI support `. * tls: added support for specifying :ref:`TLS session ticket keys - `. + `. * tls: allow configuration of the :ref:`min - ` and :ref:`max - ` TLS protocol versions. + ` and :ref:`max + ` TLS protocol versions. * tracing: added :ref:`custom trace span decorators `. * Many small bug fixes and performance improvements not listed. diff --git a/docs/root/operations/admin.rst b/docs/root/operations/admin.rst index 59c36af83..85082fdb1 100644 --- a/docs/root/operations/admin.rst +++ b/docs/root/operations/admin.rst @@ -7,7 +7,7 @@ Envoy exposes a local administration interface that can be used to query and modify different aspects of the server: * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` .. http:get:: / diff --git a/docs/root/operations/cli.rst b/docs/root/operations/cli.rst index 1bc94daf0..5441b35fa 100644 --- a/docs/root/operations/cli.rst +++ b/docs/root/operations/cli.rst @@ -90,7 +90,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service cluster name where Envoy is running. The local service cluster name is first sourced from the :ref:`Bootstrap node - ` message's :ref:`cluster + ` message's :ref:`cluster ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if any of the following features are used: @@ -107,7 +107,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service node name where Envoy is running. The local service node name is first sourced from the :ref:`Bootstrap node - ` message's :ref:`id + ` message's :ref:`id ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if any of the following features are used: @@ -120,7 +120,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service zone where Envoy is running. The local service zone is first sourced from the :ref:`Bootstrap node - ` message's :ref:`locality.zone + ` message's :ref:`locality.zone ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if discovery service routing is diff --git a/envoy/api/v2/auth/cert.proto b/envoy/api/v2/auth/cert.proto index 16a250e35..5bfa35b08 100644 --- a/envoy/api/v2/auth/cert.proto +++ b/envoy/api/v2/auth/cert.proto @@ -91,7 +91,7 @@ message TlsSessionTicketKeys { // All keys are candidates for decrypting received tickets. This allows for easy rotation of keys // by, for example, putting the new key first, and the previous key second. // - // If :ref:`session_ticket_keys ` + // If :ref:`session_ticket_keys ` // is not specified, the TLS library will still support resuming sessions via tickets, but it will // use an internally-generated and managed key, so sessions cannot be resumed across hot restarts // or on different hosts. @@ -118,11 +118,11 @@ message CertificateValidationContext { // for listeners). If not specified and a peer certificate is presented it will not be // verified. By default, a client certificate is optional, unless one of the additional // options (:ref:`require_client_certificate - // `, + // `, // :ref:`verify_certificate_hash - // `, or + // `, or // :ref:`verify_subject_alt_name - // `) is also + // `) is also // specified. // // See :ref:`the TLS overview ` for a list of common diff --git a/envoy/api/v2/base.proto b/envoy/api/v2/base.proto index a719798f0..0046d929d 100644 --- a/envoy/api/v2/base.proto +++ b/envoy/api/v2/base.proto @@ -5,7 +5,6 @@ option go_package = "api"; import "envoy/api/v2/address.proto"; -import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; diff --git a/envoy/api/v2/filter/network/http_connection_manager.proto b/envoy/api/v2/filter/network/http_connection_manager.proto index 28671b1a7..5816a0893 100644 --- a/envoy/api/v2/filter/network/http_connection_manager.proto +++ b/envoy/api/v2/filter/network/http_connection_manager.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package envoy.api.v2.filter.network; option go_package = "network"; -import "envoy/api/v2/base.proto"; import "envoy/api/v2/config_source.proto"; import "envoy/api/v2/protocol.proto"; import "envoy/api/v2/filter/accesslog/accesslog.proto"; diff --git a/envoy/api/v2/monitoring/trace.proto b/envoy/api/v2/monitoring/trace.proto index 06f0c425f..0671eac13 100644 --- a/envoy/api/v2/monitoring/trace.proto +++ b/envoy/api/v2/monitoring/trace.proto @@ -11,8 +11,8 @@ import "validate/validate.proto"; // The tracing configuration specifies global // settings for the HTTP tracer used by Envoy. The configuration is defined by -// the :ref:`Bootstrap ` :ref:`tracing -// ` field. Envoy may support other tracers +// the :ref:`Bootstrap ` :ref:`tracing +// ` field. Envoy may support other tracers // in the future, but right now the HTTP tracer is the only one supported. message Tracing { message Http { @@ -44,7 +44,7 @@ message LightstepConfig { message ZipkinConfig { // The cluster manager cluster that hosts the Zipkin collectors. Note that the // Zipkin cluster must be defined in the :ref:`Bootstrap static cluster - // resources `. + // resources `. string collector_cluster = 1 [(validate.rules).string.min_bytes = 1]; // The API endpoint of the Zipkin service where the spans will be sent. When diff --git a/envoy/bootstrap/v2/bootstrap.proto b/envoy/bootstrap/v2/bootstrap.proto index 0c4f37185..bce4c7d14 100644 --- a/envoy/bootstrap/v2/bootstrap.proto +++ b/envoy/bootstrap/v2/bootstrap.proto @@ -35,7 +35,7 @@ message Bootstrap { repeated envoy.api.v2.listener.Listener listeners = 1; // If a network based configuration source is specified for :ref:`cds_config - // `, it's necessary + // `, it's necessary // to have some initial cluster definitions available to allow Envoy to know // how to speak to the management server. These cluster definitions may not // use :ref:`EDS ` (i.e. they should be static @@ -142,7 +142,7 @@ message ClusterManager { // If *local_cluster_name* is defined then :ref:`clusters // ` must be defined in the :ref:`Bootstrap // static cluster resources - // `. This is unrelated to + // `. This is unrelated to // the :option:`--service-cluster` option which does not `affect zone aware // routing `_. string local_cluster_name = 1; diff --git a/envoy/service/ratelimit/v2/rls.proto b/envoy/service/ratelimit/v2/rls.proto index 60c8b5cc4..86a09bb4a 100644 --- a/envoy/service/ratelimit/v2/rls.proto +++ b/envoy/service/ratelimit/v2/rls.proto @@ -8,6 +8,8 @@ import "envoy/api/v2/ratelimit/ratelimit.proto"; import "validate/validate.proto"; +// [#protodoc-title: Rate limit service configuration] + service RateLimitService { // Determine whether rate limiting should take place. rpc ShouldRateLimit(RateLimitRequest) returns (RateLimitResponse) { From b2b7e8f8ce95a8fa74891b132f47ffbe16168b88 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 16:03:40 -0800 Subject: [PATCH 28/47] add trace and metrics services Signed-off-by: Kuat Yessenov --- envoy/BUILD | 4 +++- envoy/api/v2/monitoring/BUILD | 22 ------------------- envoy/service/discovery/v2/eds.proto | 1 - envoy/service/metrics/BUILD | 7 ++++++ envoy/service/metrics/v2/BUILD | 15 +++++++++++++ .../metrics/v2}/metrics_service.proto | 7 +++--- envoy/service/trace/v2/BUILD | 15 +++++++++++++ .../service/trace/v2}/trace_service.proto | 11 +++++----- test/build/BUILD | 2 +- test/build/build_test.cc | 2 +- 10 files changed, 52 insertions(+), 34 deletions(-) create mode 100644 envoy/service/metrics/BUILD create mode 100644 envoy/service/metrics/v2/BUILD rename envoy/{api/v2/monitoring => service/metrics/v2}/metrics_service.proto (86%) create mode 100644 envoy/service/trace/v2/BUILD rename {api => envoy/service/trace/v2}/trace_service.proto (79%) diff --git a/envoy/BUILD b/envoy/BUILD index 031d3f568..1c08a8b08 100644 --- a/envoy/BUILD +++ b/envoy/BUILD @@ -13,12 +13,14 @@ proto_library( "//envoy/api/v2/filter/http", "//envoy/api/v2/filter/network", "//envoy/api/v2/listener", - "//envoy/api/v2/monitoring:metrics", + "//envoy/api/v2/monitoring:stats", + "//envoy/api/v2/monitoring:trace", "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", "//envoy/bootstrap/v2:bootstrap", "//envoy/service/discovery", "//envoy/service/load_stats", + "//envoy/service/metrics", "//envoy/service/ratelimit", ], ) diff --git a/envoy/api/v2/monitoring/BUILD b/envoy/api/v2/monitoring/BUILD index 0b57a47d3..e14e7098c 100644 --- a/envoy/api/v2/monitoring/BUILD +++ b/envoy/api/v2/monitoring/BUILD @@ -2,18 +2,6 @@ load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library" licenses(["notice"]) # Apache 2 -api_proto_library( - name = "metrics", - srcs = ["metrics_service.proto"], - has_services = 1, - require_py = 0, - deps = [ - "//envoy/api/v2:base", - "//envoy/api/v2:grpc_service", - "@promotheus_metrics_model//:client_model", - ], -) - api_proto_library( name = "stats", srcs = ["stats.proto"], @@ -39,13 +27,3 @@ api_go_proto_library( name = "trace", proto = ":trace", ) - -proto_library( - name = "monitoring", - visibility = ["//envoy/api/v2:__pkg__"], - deps = [ - ":metrics", - ":stats", - ":trace", - ], -) diff --git a/envoy/service/discovery/v2/eds.proto b/envoy/service/discovery/v2/eds.proto index 7829dc673..54fd76960 100644 --- a/envoy/service/discovery/v2/eds.proto +++ b/envoy/service/discovery/v2/eds.proto @@ -7,7 +7,6 @@ import "envoy/api/v2/base.proto"; import "envoy/api/v2/health_check.proto"; import "google/api/annotations.proto"; -import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; diff --git a/envoy/service/metrics/BUILD b/envoy/service/metrics/BUILD new file mode 100644 index 000000000..74ed81112 --- /dev/null +++ b/envoy/service/metrics/BUILD @@ -0,0 +1,7 @@ +proto_library( + name = "metrics", + visibility = ["//envoy:__pkg__"], + deps = [ + "//envoy/service/metrics/v2:metrics_service", + ], +) diff --git a/envoy/service/metrics/v2/BUILD b/envoy/service/metrics/v2/BUILD new file mode 100644 index 000000000..aac79fb18 --- /dev/null +++ b/envoy/service/metrics/v2/BUILD @@ -0,0 +1,15 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library", "api_go_grpc_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "metrics_service", + srcs = ["metrics_service.proto"], + has_services = 1, + require_py = 0, + deps = [ + "//envoy/api/v2:base", + "//envoy/api/v2:grpc_service", + "@promotheus_metrics_model//:client_model", + ], +) diff --git a/envoy/api/v2/monitoring/metrics_service.proto b/envoy/service/metrics/v2/metrics_service.proto similarity index 86% rename from envoy/api/v2/monitoring/metrics_service.proto rename to envoy/service/metrics/v2/metrics_service.proto index 42a06ac7e..c858f9873 100644 --- a/envoy/api/v2/monitoring/metrics_service.proto +++ b/envoy/service/metrics/v2/metrics_service.proto @@ -4,7 +4,8 @@ syntax = "proto3"; // [#protodoc-title: Metrics Service] -package envoy.api.v2.monitoring; +package envoy.service.metrics.v2; +option go_package = "metrics"; import "envoy/api/v2/base.proto"; import "envoy/api/v2/grpc_service.proto"; @@ -28,7 +29,7 @@ message StreamMetricsResponse { message StreamMetricsMessage { message Identifier { // The node sending metrics over the stream. - Node node = 1 [(validate.rules).message.required = true]; + envoy.api.v2.Node node = 1 [(validate.rules).message.required = true]; } // Identifier data effectively is a structured metadata. As a performance optimization this will @@ -44,5 +45,5 @@ message StreamMetricsMessage { // Service. message MetricsServiceConfig { // The upstream gRPC cluster that hosts the metrics service. - GrpcService grpc_service = 1 [(validate.rules).message.required = true]; + envoy.api.v2.GrpcService grpc_service = 1 [(validate.rules).message.required = true]; } diff --git a/envoy/service/trace/v2/BUILD b/envoy/service/trace/v2/BUILD new file mode 100644 index 000000000..fdf0ce419 --- /dev/null +++ b/envoy/service/trace/v2/BUILD @@ -0,0 +1,15 @@ +load("//bazel:api_build_system.bzl", "api_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "trace_service", + srcs = ["trace_service.proto"], + has_services = 1, + require_py = 0, + deps = [ + "//envoy/api/v2:base", + "//envoy/api/v2:grpc_service", + "@io_opencensus_trace//:trace_model", + ], +) diff --git a/api/trace_service.proto b/envoy/service/trace/v2/trace_service.proto similarity index 79% rename from api/trace_service.proto rename to envoy/service/trace/v2/trace_service.proto index 55fb9570c..b3257ff0b 100644 --- a/api/trace_service.proto +++ b/envoy/service/trace/v2/trace_service.proto @@ -2,10 +2,11 @@ syntax = "proto3"; // [#proto-status: draft] -package envoy.api.v2; +package envoy.service.trace.v2; +option go_package = "trace"; -import "api/base.proto"; -import "api/grpc_service.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/grpc_service.proto"; import "trace.proto"; import "google/api/annotations.proto"; @@ -28,7 +29,7 @@ message StreamTracesResponse { message StreamTracesMessage { message Identifier { // The node sending the access log messages over the stream. - Node node = 1 [(validate.rules).message.required = true]; + envoy.api.v2.Node node = 1 [(validate.rules).message.required = true]; } // Identifier data effectively is a structured metadata. @@ -43,5 +44,5 @@ message StreamTracesMessage { // Configuration structure. message TraceServiceConfig { // The upstream gRPC cluster that hosts the metrics service. - GrpcService grpc_service = 1 [(validate.rules).message.required = true]; + envoy.api.v2.GrpcService grpc_service = 1 [(validate.rules).message.required = true]; } diff --git a/test/build/BUILD b/test/build/BUILD index 59590ae32..42dd6123d 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -6,7 +6,6 @@ api_cc_test( name = "build_test", srcs = ["build_test.cc"], proto_deps = [ - "//envoy/api/v2/monitoring:metrics", "//envoy/service/accesslog/v2:als", "//envoy/service/discovery/v2:ads", "//envoy/service/discovery/v2:cds", @@ -14,6 +13,7 @@ api_cc_test( "//envoy/service/discovery/v2:hds", "//envoy/service/discovery/v2:lds", "//envoy/service/discovery/v2:rds", + "//envoy/service/metrics/v2:metrics_service", "//envoy/service/ratelimit/v2:rls", ], ) diff --git a/test/build/build_test.cc b/test/build/build_test.cc index 7db3aef73..3e790a31a 100644 --- a/test/build/build_test.cc +++ b/test/build/build_test.cc @@ -18,7 +18,7 @@ int main(int argc, char* argv[]) { "envoy.service.discovery.v2.RouteDiscoveryService.FetchRoutes", "envoy.service.discovery.v2.RouteDiscoveryService.StreamRoutes", "envoy.service.accesslog.v2.AccessLogService.StreamAccessLogs", - "envoy.api.v2.monitoring.MetricsService.StreamMetrics", + "envoy.service.metrics.v2.MetricsService.StreamMetrics", "envoy.service.ratelimit.v2.RateLimitService.ShouldRateLimit", }; From 2ffa2211eafc01a81697e77df1d41153aaf62a53 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 19 Jan 2018 16:10:56 -0800 Subject: [PATCH 29/47] fix docs Signed-off-by: Kuat Yessenov --- docs/build.sh | 2 +- docs/root/api-v2/api.rst | 2 +- envoy/api/v2/monitoring/stats.proto | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/build.sh b/docs/build.sh index f1f2504ac..053ba01e0 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -43,7 +43,7 @@ PROTO_RST=" /envoy/service/discovery/v2/common/envoy/service/discovery/v2/common.proto.rst /envoy/service/discovery/v2/eds/envoy/service/discovery/v2/eds.proto.rst /envoy/service/ratelimit/v2/rls/envoy/service/ratelimit/v2/rls.proto.rst - /envoy/api/v2/monitoring/metrics/envoy/api/v2/monitoring/metrics_service.proto.rst + /envoy/service/metrics/v2/metrics_service/envoy/service/metrics/v2/metrics_service.proto.rst /envoy/api/v2/monitoring/stats/envoy/api/v2/monitoring/stats.proto.rst /envoy/api/v2/monitoring/trace/envoy/api/v2/monitoring/trace.proto.rst /envoy/api/v2/filter/accesslog/accesslog/envoy/api/v2/filter/accesslog/accesslog.proto.rst diff --git a/docs/root/api-v2/api.rst b/docs/root/api-v2/api.rst index e35e39022..a14e42c4e 100644 --- a/docs/root/api-v2/api.rst +++ b/docs/root/api-v2/api.rst @@ -19,7 +19,7 @@ v2 API reference api/v2/route/route.proto api/v2/auth/cert.proto api/v2/monitoring/stats.proto - api/v2/monitoring/metrics_service.proto + service/metrics/v2/metrics_service.proto api/v2/monitoring/trace.proto api/v2/base.proto api/v2/address.proto diff --git a/envoy/api/v2/monitoring/stats.proto b/envoy/api/v2/monitoring/stats.proto index 701ba8da6..be07fb0a6 100644 --- a/envoy/api/v2/monitoring/stats.proto +++ b/envoy/api/v2/monitoring/stats.proto @@ -20,7 +20,7 @@ message StatsSink { // // * :ref:`envoy.statsd ` // * :ref:`envoy.dog_statsd ` - // * :ref:`envoy.metrics_service ` + // * :ref:`envoy.metrics_service ` string name = 1; // Stats sink specific configuration which depends on the sink being From 9d2823cc5abd7769e4d86eac2eed44392ffbab68 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Mon, 22 Jan 2018 13:37:51 -0800 Subject: [PATCH 30/47] make docs better Signed-off-by: Kuat Yessenov --- .../cluster_manager/cluster_manager.rst | 2 +- .../configuration/overview/v2_overview.rst | 34 +++++++++---------- docs/root/configuration/rate_limit.rst | 2 +- docs/root/configuration/runtime.rst | 2 +- .../intro/arch_overview/load_balancing.rst | 2 +- docs/root/intro/arch_overview/statistics.rst | 2 +- docs/root/operations/admin.rst | 2 +- docs/root/operations/cli.rst | 6 ++-- envoy/api/v2/monitoring/stats.proto | 2 +- envoy/api/v2/monitoring/trace.proto | 6 ++-- envoy/bootstrap/v2/bootstrap.proto | 4 +-- tools/protodoc/protodoc.py | 11 ++++-- 12 files changed, 40 insertions(+), 35 deletions(-) diff --git a/docs/root/configuration/cluster_manager/cluster_manager.rst b/docs/root/configuration/cluster_manager/cluster_manager.rst index 6be8a1e88..a780d991b 100644 --- a/docs/root/configuration/cluster_manager/cluster_manager.rst +++ b/docs/root/configuration/cluster_manager/cluster_manager.rst @@ -14,4 +14,4 @@ Cluster manager * Cluster manager :ref:`architecture overview ` * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` diff --git a/docs/root/configuration/overview/v2_overview.rst b/docs/root/configuration/overview/v2_overview.rst index 1fc1ba1c3..a51f8e5df 100644 --- a/docs/root/configuration/overview/v2_overview.rst +++ b/docs/root/configuration/overview/v2_overview.rst @@ -44,15 +44,15 @@ where the extension reflects the underlying v2 config representation. The to autodetect the config file version, but this option provides an enhanced debug experience when configuration parsing fails. -The :ref:`Bootstrap ` message is the root of the -configuration. A key concept in the :ref:`Bootstrap ` +The :ref:`Bootstrap ` message is the root of the +configuration. A key concept in the :ref:`Bootstrap ` message is the distinction between static and dynamic resouces. Resources such as a :ref:`Listener ` or :ref:`Cluster ` may be supplied either statically in -:ref:`static_resources ` or have +:ref:`static_resources ` or have an xDS service such as :ref:`LDS ` or :ref:`CDS ` configured in -:ref:`dynamic_resources `. +:ref:`dynamic_resources `. Example ------- @@ -158,7 +158,7 @@ an otherwise completely dynamic configurations, some static resources need to be defined to point Envoy at its xDS management server(s). In the above example, the EDS management server could then return a proto encoding of a -:ref:`DiscoveryResponse `: +:ref:`DiscoveryResponse `: .. code-block:: yaml @@ -293,8 +293,8 @@ Management server A v2 xDS management server will implement the below endpoints as required for gRPC and/or REST serving. In both streaming gRPC and -REST-JSON cases, a :ref:`DiscoveryRequest ` is sent and a -:ref:`DiscoveryResponse ` received following the +REST-JSON cases, a :ref:`DiscoveryRequest ` is sent and a +:ref:`DiscoveryResponse ` received following the `xDS protocol `_. .. _v2_grpc_streaming_endpoints: @@ -316,8 +316,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /envoy.api.v2.EndpointDiscoveryService/StreamEndpoints @@ -350,8 +350,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /envoy.api.v2.RouteDiscoveryService/StreamRoutes @@ -388,8 +388,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /v2/discovery:endpoints @@ -422,8 +422,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /v2/discovery:routes @@ -488,8 +488,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_ads_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. When this is set, any of the configuration sources :ref:`above ` can be set to use the ADS channel. For example, a LDS config could be changed from diff --git a/docs/root/configuration/rate_limit.rst b/docs/root/configuration/rate_limit.rst index 322d64089..041969022 100644 --- a/docs/root/configuration/rate_limit.rst +++ b/docs/root/configuration/rate_limit.rst @@ -8,7 +8,7 @@ limit service Envoy should talk to when it needs to make global rate limit decis limit service is configured, a "null" service will be used which will always return OK if called. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` gRPC service IDL ---------------- diff --git a/docs/root/configuration/runtime.rst b/docs/root/configuration/runtime.rst index 36c5f35c8..05174663d 100644 --- a/docs/root/configuration/runtime.rst +++ b/docs/root/configuration/runtime.rst @@ -8,7 +8,7 @@ system tree that contains re-loadable configuration elements. If runtime is not provider is used which has the effect of using all defaults built into the code. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` File system layout ------------------ diff --git a/docs/root/intro/arch_overview/load_balancing.rst b/docs/root/intro/arch_overview/load_balancing.rst index f82744ac4..d3ec53584 100644 --- a/docs/root/intro/arch_overview/load_balancing.rst +++ b/docs/root/intro/arch_overview/load_balancing.rst @@ -97,7 +97,7 @@ Priority levels ------------------ During load balancing, Envoy will generally only consider hosts configured at the highest priority -level. For each EDS :ref:`LocalityLbEndpoints` an optional +level. For each EDS :ref:`LocalityLbEndpoints` an optional priority may also be specified. When endpoints at the highest priority level (P=0) are healthy, all traffic will land on endpoints in that priority level. As endpoints for the highest priority level become unhealthy, traffic will begin to trickle to lower priority levels. diff --git a/docs/root/intro/arch_overview/statistics.rst b/docs/root/intro/arch_overview/statistics.rst index 46fcf66e2..7f41a2162 100644 --- a/docs/root/intro/arch_overview/statistics.rst +++ b/docs/root/intro/arch_overview/statistics.rst @@ -23,4 +23,4 @@ received. Note: what were previously referred to as timers have become histogram difference between the two representations was the units. * :ref:`v1 API reference `. -* :ref:`v2 API reference `. +* :ref:`v2 API reference `. diff --git a/docs/root/operations/admin.rst b/docs/root/operations/admin.rst index 85082fdb1..24b554aa8 100644 --- a/docs/root/operations/admin.rst +++ b/docs/root/operations/admin.rst @@ -7,7 +7,7 @@ Envoy exposes a local administration interface that can be used to query and modify different aspects of the server: * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` .. http:get:: / diff --git a/docs/root/operations/cli.rst b/docs/root/operations/cli.rst index 5441b35fa..da85a92cf 100644 --- a/docs/root/operations/cli.rst +++ b/docs/root/operations/cli.rst @@ -90,7 +90,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service cluster name where Envoy is running. The local service cluster name is first sourced from the :ref:`Bootstrap node - ` message's :ref:`cluster + ` message's :ref:`cluster ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if any of the following features are used: @@ -107,7 +107,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service node name where Envoy is running. The local service node name is first sourced from the :ref:`Bootstrap node - ` message's :ref:`id + ` message's :ref:`id ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if any of the following features are used: @@ -120,7 +120,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service zone where Envoy is running. The local service zone is first sourced from the :ref:`Bootstrap node - ` message's :ref:`locality.zone + ` message's :ref:`locality.zone ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if discovery service routing is diff --git a/envoy/api/v2/monitoring/stats.proto b/envoy/api/v2/monitoring/stats.proto index be07fb0a6..5dbc765bc 100644 --- a/envoy/api/v2/monitoring/stats.proto +++ b/envoy/api/v2/monitoring/stats.proto @@ -20,7 +20,7 @@ message StatsSink { // // * :ref:`envoy.statsd ` // * :ref:`envoy.dog_statsd ` - // * :ref:`envoy.metrics_service ` + // * :ref:`envoy.metrics_service ` string name = 1; // Stats sink specific configuration which depends on the sink being diff --git a/envoy/api/v2/monitoring/trace.proto b/envoy/api/v2/monitoring/trace.proto index 0671eac13..1f6af4704 100644 --- a/envoy/api/v2/monitoring/trace.proto +++ b/envoy/api/v2/monitoring/trace.proto @@ -11,8 +11,8 @@ import "validate/validate.proto"; // The tracing configuration specifies global // settings for the HTTP tracer used by Envoy. The configuration is defined by -// the :ref:`Bootstrap ` :ref:`tracing -// ` field. Envoy may support other tracers +// the :ref:`Bootstrap ` :ref:`tracing +// ` field. Envoy may support other tracers // in the future, but right now the HTTP tracer is the only one supported. message Tracing { message Http { @@ -44,7 +44,7 @@ message LightstepConfig { message ZipkinConfig { // The cluster manager cluster that hosts the Zipkin collectors. Note that the // Zipkin cluster must be defined in the :ref:`Bootstrap static cluster - // resources `. + // resources `. string collector_cluster = 1 [(validate.rules).string.min_bytes = 1]; // The API endpoint of the Zipkin service where the spans will be sent. When diff --git a/envoy/bootstrap/v2/bootstrap.proto b/envoy/bootstrap/v2/bootstrap.proto index bce4c7d14..1edf6109c 100644 --- a/envoy/bootstrap/v2/bootstrap.proto +++ b/envoy/bootstrap/v2/bootstrap.proto @@ -35,7 +35,7 @@ message Bootstrap { repeated envoy.api.v2.listener.Listener listeners = 1; // If a network based configuration source is specified for :ref:`cds_config - // `, it's necessary + // `, it's necessary // to have some initial cluster definitions available to allow Envoy to know // how to speak to the management server. These cluster definitions may not // use :ref:`EDS ` (i.e. they should be static @@ -142,7 +142,7 @@ message ClusterManager { // If *local_cluster_name* is defined then :ref:`clusters // ` must be defined in the :ref:`Bootstrap // static cluster resources - // `. This is unrelated to + // `. This is unrelated to // the :option:`--service-cluster` option which does not `affect zone aware // routing `_. string local_cluster_name = 1; diff --git a/tools/protodoc/protodoc.py b/tools/protodoc/protodoc.py index 0c083f01d..2ad03a7a0 100755 --- a/tools/protodoc/protodoc.py +++ b/tools/protodoc/protodoc.py @@ -15,9 +15,12 @@ from google.protobuf.compiler import plugin_pb2 from validate import validate_pb2 -# Namespace prefix for Envoy APIs. +# Namespace prefix for Envoy core APIs. ENVOY_API_NAMESPACE_PREFIX = '.envoy.api.v2.' +# Namespace prefix for Envoy top-level APIs. +ENVOY_PREFIX = '.envoy.' + # Namespace prefix for WKTs. WKT_NAMESPACE_PREFIX = '.google.protobuf.' @@ -385,7 +388,7 @@ def FormatMessageAsJson(type_context, msg): def NormalizeFQN(fqn): """Normalize a fully qualified field type name. - Strips leading ENVOY_API_NAMESPACE_PREFIX and makes pretty wrapped type names. + Strips leading ENVOY_API_NAMESPACE_PREFIX and ENVOY_PREFIX and makes pretty wrapped type names. Args: fqn: a fully qualified type name from FieldDescriptorProto.type_name. @@ -394,6 +397,8 @@ def NormalizeFQN(fqn): """ if fqn.startswith(ENVOY_API_NAMESPACE_PREFIX): return fqn[len(ENVOY_API_NAMESPACE_PREFIX):] + if fqn.startswith(ENVOY_PREFIX): + return fqn[len(ENVOY_PREFIX):] return fqn @@ -414,7 +419,7 @@ def FormatFieldType(type_context, field): Return: RST formatted field type. """ - if field.type_name.startswith(ENVOY_API_NAMESPACE_PREFIX): + if field.type_name.startswith(ENVOY_API_NAMESPACE_PREFIX) or field.type_name.startswith(ENVOY_PREFIX): type_name = NormalizeFQN(field.type_name) if field.type == field.TYPE_MESSAGE: if type_context.map_typenames and type_name in type_context.map_typenames: From 994235c031cbdb328ddbc65635af5b95e0a8875e Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 23 Jan 2018 13:37:23 -0800 Subject: [PATCH 31/47] add dummy messages Signed-off-by: Kuat Yessenov --- envoy/api/v2/route/route.proto | 15 ++++++++------- envoy/service/discovery/v2/ads.proto | 5 +++++ envoy/service/discovery/v2/cds.proto | 5 +++++ envoy/service/discovery/v2/eds.proto | 5 +++++ envoy/service/discovery/v2/hds.proto | 5 +++++ envoy/service/discovery/v2/lds.proto | 5 +++++ envoy/service/discovery/v2/rds.proto | 5 +++++ envoy/service/discovery/v2/sds.proto | 5 +++++ 8 files changed, 43 insertions(+), 7 deletions(-) diff --git a/envoy/api/v2/route/route.proto b/envoy/api/v2/route/route.proto index 88d7381b8..e3e3cdccc 100644 --- a/envoy/api/v2/route/route.proto +++ b/envoy/api/v2/route/route.proto @@ -122,16 +122,16 @@ message VirtualHost { // Specifies a list of HTTP headers that should be added to each request // handled by this virtual host. Headers specified at this level are applied // after headers from enclosed :ref:`envoy_api_msg_route.RouteAction` and before headers from the - // enclosing :ref:`envoy_api_msg_route.RouteConfiguration`. For more information, including details on - // header value syntax, see the documentation on :ref:`custom request headers + // enclosing :ref:`envoy_api_msg_route.RouteConfiguration`. For more information, including + // details on header value syntax, see the documentation on :ref:`custom request headers // `. repeated HeaderValueOption request_headers_to_add = 7; // Specifies a list of HTTP headers that should be added to each response // handled by this virtual host. Headers specified at this level are applied // after headers from enclosed :ref:`envoy_api_msg_route.RouteAction` and before headers from the - // enclosing :ref:`envoy_api_msg_route.RouteConfiguration`. For more information, including details on - // header value syntax, see the documentation on :ref:`custom request headers + // enclosing :ref:`envoy_api_msg_route.RouteConfiguration`. For more information, including + // details on header value syntax, see the documentation on :ref:`custom request headers // `. repeated HeaderValueOption response_headers_to_add = 10; @@ -436,9 +436,10 @@ message RouteAction { // Specifies a set of headers that will be added to requests matching this // route. Headers specified at this level are applied before headers from the - // enclosing :ref:`envoy_api_msg_route.VirtualHost` and :ref:`envoy_api_msg_route.RouteConfiguration`. - // For more information, including details on header value syntax, see the documentation on - // :ref:`custom request headers `. + // enclosing :ref:`envoy_api_msg_route.VirtualHost` and + // :ref:`envoy_api_msg_route.RouteConfiguration`. For more information, including details on + // header value syntax, see the documentation on :ref:`custom request headers + // `. repeated HeaderValueOption request_headers_to_add = 12; // Specifies a set of headers that will be added to responses to requests diff --git a/envoy/service/discovery/v2/ads.proto b/envoy/service/discovery/v2/ads.proto index 145a58203..7f545ee08 100644 --- a/envoy/service/discovery/v2/ads.proto +++ b/envoy/service/discovery/v2/ads.proto @@ -4,6 +4,11 @@ package envoy.service.discovery.v2; import "envoy/service/discovery/v2/common.proto"; +// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing +// services. +message AdsDummy { +} + // See https://github.com/lyft/envoy-api#apis for a description of the role of // ADS and how it is intended to be used by a management server. ADS requests // have the same structure as their singleton xDS counterparts, but can diff --git a/envoy/service/discovery/v2/cds.proto b/envoy/service/discovery/v2/cds.proto index 9b257bdbe..e1686c50b 100644 --- a/envoy/service/discovery/v2/cds.proto +++ b/envoy/service/discovery/v2/cds.proto @@ -6,6 +6,11 @@ import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; +// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing +// services. +message CdsDummy { +} + // Return list of all clusters this proxy will load balance to. service ClusterDiscoveryService { rpc StreamClusters(stream DiscoveryRequest) returns (stream DiscoveryResponse) { diff --git a/envoy/service/discovery/v2/eds.proto b/envoy/service/discovery/v2/eds.proto index 54fd76960..8af9b9672 100644 --- a/envoy/service/discovery/v2/eds.proto +++ b/envoy/service/discovery/v2/eds.proto @@ -13,6 +13,11 @@ import "validate/validate.proto"; // [#protodoc-title: Endpoints and EDS] +// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing +// services. +message EdsDummy { +} + service EndpointDiscoveryService { // The resource_names field in DiscoveryRequest specifies a list of clusters // to subscribe to updates for. diff --git a/envoy/service/discovery/v2/hds.proto b/envoy/service/discovery/v2/hds.proto index a02db4a8e..5d3375c51 100644 --- a/envoy/service/discovery/v2/hds.proto +++ b/envoy/service/discovery/v2/hds.proto @@ -8,6 +8,11 @@ import "envoy/api/v2/health_check.proto"; import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; +// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing +// services. +message HdsDummy { +} + // [#proto-status: experimental] // HDS is Health Discovery Service. It compliments Envoy’s health checking // service by designating this Envoy to be a healthchecker for a subset of hosts diff --git a/envoy/service/discovery/v2/lds.proto b/envoy/service/discovery/v2/lds.proto index 7af6d7a97..e722ebebf 100644 --- a/envoy/service/discovery/v2/lds.proto +++ b/envoy/service/discovery/v2/lds.proto @@ -6,6 +6,11 @@ import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; +// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing +// services. +message LdsDummy { +} + // The Envoy instance initiates an RPC at startup to discover a list of // listeners. Updates are delivered via streaming from the LDS server and // consist of a complete update of all listeners. Existing connections will be diff --git a/envoy/service/discovery/v2/rds.proto b/envoy/service/discovery/v2/rds.proto index 7a9df4425..7fb298f7e 100644 --- a/envoy/service/discovery/v2/rds.proto +++ b/envoy/service/discovery/v2/rds.proto @@ -6,6 +6,11 @@ import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; +// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing +// services. +message RdsDummy { +} + // The resource_names field in DiscoveryRequest specifies a route configuration. // This allows an Envoy configuration with multiple HTTP listeners (and // associated HTTP connection manager filters) to use different route diff --git a/envoy/service/discovery/v2/sds.proto b/envoy/service/discovery/v2/sds.proto index 8c7b975db..c29480f2e 100644 --- a/envoy/service/discovery/v2/sds.proto +++ b/envoy/service/discovery/v2/sds.proto @@ -6,6 +6,11 @@ import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; +// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing +// services. +message SdsDummy { +} + service SecretDiscoveryService { rpc StreamSecrets(stream DiscoveryRequest) returns (stream DiscoveryResponse) { } From 36ebf6aa365cfdbb43e5f453e25b94ca5245ed64 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 23 Jan 2018 13:45:31 -0800 Subject: [PATCH 32/47] fix format Signed-off-by: Kuat Yessenov --- envoy/api/v2/listener/listener.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/envoy/api/v2/listener/listener.proto b/envoy/api/v2/listener/listener.proto index 93097c032..e373b8fa2 100644 --- a/envoy/api/v2/listener/listener.proto +++ b/envoy/api/v2/listener/listener.proto @@ -54,12 +54,12 @@ message Listener { // .. attention:: // // This field is deprecated. Use :ref:`an original_dst ` - // :ref:`listener filter ` instead. + // :ref:`listener filter ` instead. // // Note that hand off to another listener is *NOT* performed without this flag. Once - // :ref:`FilterChainMatch ` is implemented this flag will be - // removed, as filter chain matching can be used to select a filter chain based on the restored - // destination address. + // :ref:`FilterChainMatch ` is implemented this flag + // will be removed, as filter chain matching can be used to select a filter chain based on the + // restored destination address. google.protobuf.BoolValue use_original_dst = 4 [deprecated = true]; // Soft limit on size of the listener’s new connection read and write buffers. From 65e15e6faa0a6f87ae6e7045ab543a761b3a98fe Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 23 Jan 2018 13:56:50 -0800 Subject: [PATCH 33/47] fix docs Signed-off-by: Kuat Yessenov --- .../root/configuration/listener_filters/original_dst_filter.rst | 2 +- envoy/api/v2/listener/listener.proto | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/root/configuration/listener_filters/original_dst_filter.rst b/docs/root/configuration/listener_filters/original_dst_filter.rst index bae339eb4..50aa7c1cc 100644 --- a/docs/root/configuration/listener_filters/original_dst_filter.rst +++ b/docs/root/configuration/listener_filters/original_dst_filter.rst @@ -10,4 +10,4 @@ listening at. Furthermore, :ref:`an original destination cluster ` may be used to forward HTTP requests or TCP connections to the restored destination address. -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` diff --git a/envoy/api/v2/listener/listener.proto b/envoy/api/v2/listener/listener.proto index e373b8fa2..26d82ecba 100644 --- a/envoy/api/v2/listener/listener.proto +++ b/envoy/api/v2/listener/listener.proto @@ -100,7 +100,7 @@ message Listener { // Listener filters have the opportunity to manipulate and augment the connection metadata that // is used in connection filter chain matching, for example. These filters are run before any in - // :ref:`filter_chains `. Order matters as the filters + // :ref:`filter_chains `. Order matters as the filters // are processed sequentially right after a socket has been accepted by the listener, and before // a connection is created. repeated ListenerFilter listener_filters = 9; From de8df65fc74caedacc3dfecc58c6ee7db1f10044 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 23 Jan 2018 14:12:47 -0800 Subject: [PATCH 34/47] fix format Signed-off-by: Kuat Yessenov --- envoy/api/v2/listener/listener.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/envoy/api/v2/listener/listener.proto b/envoy/api/v2/listener/listener.proto index 26d82ecba..20f165dd1 100644 --- a/envoy/api/v2/listener/listener.proto +++ b/envoy/api/v2/listener/listener.proto @@ -100,9 +100,9 @@ message Listener { // Listener filters have the opportunity to manipulate and augment the connection metadata that // is used in connection filter chain matching, for example. These filters are run before any in - // :ref:`filter_chains `. Order matters as the filters - // are processed sequentially right after a socket has been accepted by the listener, and before - // a connection is created. + // :ref:`filter_chains `. Order matters as the + // filters are processed sequentially right after a socket has been accepted by the listener, and + // before a connection is created. repeated ListenerFilter listener_filters = 9; } From 7a9d4d084c5fb9bde84747ce9d49dfd03b2b0eef Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 13:08:59 -0800 Subject: [PATCH 35/47] move bootstrap Signed-off-by: Kuat Yessenov --- envoy/BUILD | 2 +- envoy/{ => config}/bootstrap/v2/BUILD | 0 envoy/{ => config}/bootstrap/v2/bootstrap.proto | 2 +- test/build/BUILD | 2 +- test/validate/BUILD | 2 +- test/validate/pgv_test.cc | 8 ++++---- 6 files changed, 8 insertions(+), 8 deletions(-) rename envoy/{ => config}/bootstrap/v2/BUILD (100%) rename envoy/{ => config}/bootstrap/v2/bootstrap.proto (99%) diff --git a/envoy/BUILD b/envoy/BUILD index 1c08a8b08..bcafdb4eb 100644 --- a/envoy/BUILD +++ b/envoy/BUILD @@ -17,7 +17,7 @@ proto_library( "//envoy/api/v2/monitoring:trace", "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", - "//envoy/bootstrap/v2:bootstrap", + "//envoy/config/bootstrap/v2:bootstrap", "//envoy/service/discovery", "//envoy/service/load_stats", "//envoy/service/metrics", diff --git a/envoy/bootstrap/v2/BUILD b/envoy/config/bootstrap/v2/BUILD similarity index 100% rename from envoy/bootstrap/v2/BUILD rename to envoy/config/bootstrap/v2/BUILD diff --git a/envoy/bootstrap/v2/bootstrap.proto b/envoy/config/bootstrap/v2/bootstrap.proto similarity index 99% rename from envoy/bootstrap/v2/bootstrap.proto rename to envoy/config/bootstrap/v2/bootstrap.proto index 2b6613a69..8ee96c62c 100644 --- a/envoy/bootstrap/v2/bootstrap.proto +++ b/envoy/config/bootstrap/v2/bootstrap.proto @@ -5,7 +5,7 @@ syntax = "proto3"; -package envoy.bootstrap.v2; +package envoy.config.bootstrap.v2; option go_package = "bootstrap"; import "envoy/api/v2/address.proto"; diff --git a/test/build/BUILD b/test/build/BUILD index 42dd6123d..987cd6e1e 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -25,7 +25,7 @@ api_go_test( importpath = "go_build_test", deps = [ "//envoy/api/v2/auth:cert_go_proto", - "//envoy/bootstrap/v2:bootstrap_go_proto", + "//envoy/config/bootstrap/v2:bootstrap_go_proto", "//envoy/service/discovery/v2:ads_go_grpc", "//envoy/service/discovery/v2:cds_go_grpc", "//envoy/service/discovery/v2:eds_go_grpc", diff --git a/test/validate/BUILD b/test/validate/BUILD index 0a8731929..5ab381fe1 100644 --- a/test/validate/BUILD +++ b/test/validate/BUILD @@ -19,7 +19,7 @@ api_cc_test( "//envoy/api/v2/filter/network:mongo_proxy", "//envoy/api/v2/filter/network:redis_proxy", "//envoy/api/v2/filter/network:tcp_proxy", - "//envoy/bootstrap/v2:bootstrap", + "//envoy/config/bootstrap/v2:bootstrap", "//envoy/service/discovery/v2:cds", "//envoy/service/discovery/v2:eds", "//envoy/service/discovery/v2:lds", diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index a20d4a658..65f485d7e 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -19,7 +19,7 @@ #include "envoy/api/v2/filter/network/tcp_proxy.pb.validate.h" #include "envoy/api/v2/listener/listener.pb.validate.h" #include "envoy/api/v2/route/route.pb.validate.h" -#include "envoy/bootstrap/v2/bootstrap.pb.validate.h" +#include "envoy/config/bootstrap/v2/bootstrap.pb.validate.h" #include "envoy/service/discovery/v2/eds.pb.validate.h" #include "google/protobuf/text_format.h" @@ -46,7 +46,7 @@ template struct TestCase { // Basic protoc-gen-validate C++ validation header inclusion and Validate calls // from data-plane-api. int main(int argc, char* argv[]) { - envoy::bootstrap::v2::Bootstrap invalid_bootstrap; + envoy::config::bootstrap::v2::Bootstrap invalid_bootstrap; // This is a baseline test of the validation features we care about. It's // probably not worth adding in every filter and field that we want to valid // in the API upfront, but as regressions occur, this is the place to add the @@ -59,12 +59,12 @@ int main(int argc, char* argv[]) { address {} } )EOF"; - envoy::bootstrap::v2::Bootstrap valid_bootstrap; + envoy::config::bootstrap::v2::Bootstrap valid_bootstrap; if (!google::protobuf::TextFormat::ParseFromString(valid_bootstrap_text, &valid_bootstrap)) { std::cerr << "Unable to parse text proto: " << valid_bootstrap_text << std::endl; exit(EXIT_FAILURE); } - TestCase{invalid_bootstrap, valid_bootstrap}.run(); + TestCase{invalid_bootstrap, valid_bootstrap}.run(); exit(EXIT_SUCCESS); } From 41d75c5f47985f09a11eeac24a5733b6d35d6037 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 13:23:12 -0800 Subject: [PATCH 36/47] stats config Signed-off-by: Kuat Yessenov --- envoy/BUILD | 3 +- envoy/api/v2/monitoring/BUILD | 16 --------- envoy/config/bootstrap/v2/BUILD | 6 ++-- envoy/config/bootstrap/v2/bootstrap.proto | 7 ++-- envoy/config/metrics/v2/BUILD | 35 +++++++++++++++++++ envoy/config/metrics/v2/metrics_service.proto | 17 +++++++++ .../metrics/v2}/stats.proto | 8 ++--- .../service/metrics/v2/metrics_service.proto | 8 ----- 8 files changed, 66 insertions(+), 34 deletions(-) create mode 100644 envoy/config/metrics/v2/BUILD create mode 100644 envoy/config/metrics/v2/metrics_service.proto rename envoy/{api/v2/monitoring => config/metrics/v2}/stats.proto (98%) diff --git a/envoy/BUILD b/envoy/BUILD index bcafdb4eb..ef2c0748d 100644 --- a/envoy/BUILD +++ b/envoy/BUILD @@ -13,11 +13,12 @@ proto_library( "//envoy/api/v2/filter/http", "//envoy/api/v2/filter/network", "//envoy/api/v2/listener", - "//envoy/api/v2/monitoring:stats", "//envoy/api/v2/monitoring:trace", "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", "//envoy/config/bootstrap/v2:bootstrap", + "//envoy/config/metrics/v2:stats", + "//envoy/config/metrics/v2:metrics_service", "//envoy/service/discovery", "//envoy/service/load_stats", "//envoy/service/metrics", diff --git a/envoy/api/v2/monitoring/BUILD b/envoy/api/v2/monitoring/BUILD index e14e7098c..81fb19437 100644 --- a/envoy/api/v2/monitoring/BUILD +++ b/envoy/api/v2/monitoring/BUILD @@ -2,22 +2,6 @@ load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library" licenses(["notice"]) # Apache 2 -api_proto_library( - name = "stats", - srcs = ["stats.proto"], - deps = [ - "//envoy/api/v2:address", - ], -) - -api_go_proto_library( - name = "stats", - proto = ":stats", - deps = [ - "//envoy/api/v2:address_go_proto", - ], -) - api_proto_library( name = "trace", srcs = ["trace.proto"], diff --git a/envoy/config/bootstrap/v2/BUILD b/envoy/config/bootstrap/v2/BUILD index 6b5c6f427..3110d0152 100644 --- a/envoy/config/bootstrap/v2/BUILD +++ b/envoy/config/bootstrap/v2/BUILD @@ -12,7 +12,8 @@ api_proto_library( "//envoy/api/v2/auth:cert", "//envoy/api/v2/cluster", "//envoy/api/v2/listener", - "//envoy/api/v2/monitoring:stats", + "//envoy/config/metrics/v2:stats", + "//envoy/config/metrics/v2:metrics_service", "//envoy/api/v2/monitoring:trace", "//envoy/service/ratelimit/v2:rls", ], @@ -28,7 +29,8 @@ api_go_proto_library( "//envoy/api/v2/auth:cert_go_proto", "//envoy/api/v2/cluster:cluster_go_proto", "//envoy/api/v2/listener:listener_go_proto", - "//envoy/api/v2/monitoring:stats_go_proto", + "//envoy/config/metrics/v2:stats_go_proto", + "//envoy/config/metrics/v2:metrics_service_go_proto", "//envoy/api/v2/monitoring:trace_go_proto", "//envoy/service/ratelimit/v2:rls_go_grpc", ], diff --git a/envoy/config/bootstrap/v2/bootstrap.proto b/envoy/config/bootstrap/v2/bootstrap.proto index 8ee96c62c..0bb854f56 100644 --- a/envoy/config/bootstrap/v2/bootstrap.proto +++ b/envoy/config/bootstrap/v2/bootstrap.proto @@ -14,8 +14,9 @@ import "envoy/api/v2/auth/cert.proto"; import "envoy/api/v2/config_source.proto"; import "envoy/api/v2/cluster/cluster.proto"; import "envoy/api/v2/listener/listener.proto"; -import "envoy/api/v2/monitoring/stats.proto"; import "envoy/api/v2/monitoring/trace.proto"; +import "envoy/config/metrics/v2/stats.proto"; +import "envoy/config/metrics/v2/metrics_service.proto"; import "envoy/service/ratelimit/v2/rls.proto"; import "google/protobuf/duration.proto"; @@ -89,10 +90,10 @@ message Bootstrap { string flags_path = 5; // Optional set of stats sinks. - repeated envoy.api.v2.monitoring.StatsSink stats_sinks = 6; + repeated envoy.config.metrics.v2.StatsSink stats_sinks = 6; // Configuration for internal processing of stats. - envoy.api.v2.monitoring.StatsConfig stats_config = 13; + envoy.config.metrics.v2.StatsConfig stats_config = 13; // Optional duration between flushes to configured stats sinks. For // performance reasons Envoy latches counters and only flushes counters and diff --git a/envoy/config/metrics/v2/BUILD b/envoy/config/metrics/v2/BUILD new file mode 100644 index 000000000..1e73614d0 --- /dev/null +++ b/envoy/config/metrics/v2/BUILD @@ -0,0 +1,35 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library", "api_go_grpc_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "metrics_service", + srcs = ["metrics_service.proto"], + deps = [ + "//envoy/api/v2:grpc_service", + ], +) + +api_go_proto_library( + name = "metrics_service", + proto = ":metrics_service", + deps = [ + "//envoy/api/v2:grpc_service_go_proto", + ], +) + +api_proto_library( + name = "stats", + srcs = ["stats.proto"], + deps = [ + "//envoy/api/v2:address", + ], +) + +api_go_proto_library( + name = "stats", + proto = ":stats", + deps = [ + "//envoy/api/v2:address_go_proto", + ], +) diff --git a/envoy/config/metrics/v2/metrics_service.proto b/envoy/config/metrics/v2/metrics_service.proto new file mode 100644 index 000000000..cb1ec2350 --- /dev/null +++ b/envoy/config/metrics/v2/metrics_service.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +// [#proto-status: draft] + +package envoy.config.metrics.v2; + +import "envoy/api/v2/grpc_service.proto"; + +import "validate/validate.proto"; + +// Metrics Service is configured as a built-in *envoy.metrics_service* :ref:`StatsSink +// `. This opaque configuration will be used to create Metrics +// Service. +message MetricsServiceConfig { + // The upstream gRPC cluster that hosts the metrics service. + envoy.api.v2.GrpcService grpc_service = 1 [(validate.rules).message.required = true]; +} diff --git a/envoy/api/v2/monitoring/stats.proto b/envoy/config/metrics/v2/stats.proto similarity index 98% rename from envoy/api/v2/monitoring/stats.proto rename to envoy/config/metrics/v2/stats.proto index 5dbc765bc..7b7f64923 100644 --- a/envoy/api/v2/monitoring/stats.proto +++ b/envoy/config/metrics/v2/stats.proto @@ -3,8 +3,8 @@ syntax = "proto3"; -package envoy.api.v2.monitoring; -option go_package = "monitoring"; +package envoy.config.metrics.v2; +option go_package = "metrics"; import "envoy/api/v2/address.proto"; @@ -145,7 +145,7 @@ message StatsdSink { // The UDP address of a running `statsd `_ // compliant listener. If specified, statistics will be flushed to this // address. - Address address = 1; + envoy.api.v2.Address address = 1; // The name of a cluster that is running a TCP `statsd // `_ compliant listener. If specified, @@ -164,7 +164,7 @@ message DogStatsdSink { // The UDP address of a running DogStatsD compliant listener. If specified, // statistics will be flushed to this address. - Address address = 1; + envoy.api.v2.Address address = 1; // The name of a cluster that is DogStatsD compliant TCP listener. If specified, // Envoy will connect to this cluster to flush statistics. diff --git a/envoy/service/metrics/v2/metrics_service.proto b/envoy/service/metrics/v2/metrics_service.proto index c858f9873..8adcdbda2 100644 --- a/envoy/service/metrics/v2/metrics_service.proto +++ b/envoy/service/metrics/v2/metrics_service.proto @@ -39,11 +39,3 @@ message StreamMetricsMessage { // A list of metric entries repeated io.prometheus.client.MetricFamily envoy_metrics = 2; } - -// Metrics Service is configured as a built-in *envoy.metrics_service* :ref:`StatsSink -// `. This opaque configuration will be used to create Metrics -// Service. -message MetricsServiceConfig { - // The upstream gRPC cluster that hosts the metrics service. - envoy.api.v2.GrpcService grpc_service = 1 [(validate.rules).message.required = true]; -} From b477d998dd8d723e98a4e46813ec6fe45aac5d5c Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 13:26:48 -0800 Subject: [PATCH 37/47] accesslog config Signed-off-by: Kuat Yessenov --- envoy/config/accesslog/v2/als.proto | 42 ++++++++++++++++++++++++++++ envoy/service/accesslog/v2/als.proto | 35 ----------------------- 2 files changed, 42 insertions(+), 35 deletions(-) create mode 100644 envoy/config/accesslog/v2/als.proto diff --git a/envoy/config/accesslog/v2/als.proto b/envoy/config/accesslog/v2/als.proto new file mode 100644 index 000000000..1bd2425fe --- /dev/null +++ b/envoy/config/accesslog/v2/als.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package envoy.config.accesslog.v2; +option go_package = "accesslog"; + +import "envoy/api/v2/grpc_service.proto"; + +import "validate/validate.proto"; + +// Configuration for the built-in *envoy.tcp_grpc_access_log* type. This configuration will +// populate *StreamAccessLogsMessage.tcp_logs*. +// [#not-implemented-hide:] +// [#comment:TODO(mattklein123): Block type in non-tcp proxy cases?] +message TcpGrpcAccessLogConfig { + CommonGrpcAccessLogConfig common_config = 1 [(validate.rules).message.required = true]; +} + +// Configuration for the built-in *envoy.http_grpc_access_log* type. This configuration will +// populate *StreamAccessLogsMessage.http_logs*. +// [#not-implemented-hide:] +// [#comment:TODO(mattklein123): Block type in non-http/router proxy cases?] +message HttpGrpcAccessLogConfig { + CommonGrpcAccessLogConfig common_config = 1 [(validate.rules).message.required = true]; + + // Additional request headers to log in *HTTPRequestProperties.request_headers*. + repeated string additional_request_headers_to_log = 2; + + // Additional response headers to log in *HTTPResponseProperties.response_headers*. + repeated string additional_response_headers_to_log = 3; +} + +// Common configuration for gRPC access logs. +// [#not-implemented-hide:] +message CommonGrpcAccessLogConfig { + // The friendly name of the access log to be returned in StreamAccessLogsMessage.Identifier. This + // allows the access log server to differentiate between different access logs coming from the + // same Envoy. + string log_name = 1 [(validate.rules).string.min_bytes = 1]; + + // The gRPC service for the access log service. + envoy.api.v2.GrpcService grpc_service = 2 [(validate.rules).message.required = true]; +} diff --git a/envoy/service/accesslog/v2/als.proto b/envoy/service/accesslog/v2/als.proto index b0083f4e4..9efed4098 100644 --- a/envoy/service/accesslog/v2/als.proto +++ b/envoy/service/accesslog/v2/als.proto @@ -4,7 +4,6 @@ package envoy.service.accesslog.v2; option go_package = "accesslog"; import "envoy/api/v2/base.proto"; -import "envoy/api/v2/grpc_service.proto"; import "envoy/api/v2/filter/accesslog/accesslog.proto"; import "validate/validate.proto"; @@ -64,37 +63,3 @@ message StreamAccessLogsMessage { TCPAccessLogEntries tcp_logs = 3; } } - -// Configuration for the built-in *envoy.tcp_grpc_access_log* type. This configuration will -// populate *StreamAccessLogsMessage.tcp_logs*. -// [#not-implemented-hide:] -// [#comment:TODO(mattklein123): Block type in non-tcp proxy cases?] -message TcpGrpcAccessLogConfig { - CommonGrpcAccessLogConfig common_config = 1 [(validate.rules).message.required = true]; -} - -// Configuration for the built-in *envoy.http_grpc_access_log* type. This configuration will -// populate *StreamAccessLogsMessage.http_logs*. -// [#not-implemented-hide:] -// [#comment:TODO(mattklein123): Block type in non-http/router proxy cases?] -message HttpGrpcAccessLogConfig { - CommonGrpcAccessLogConfig common_config = 1 [(validate.rules).message.required = true]; - - // Additional request headers to log in *HTTPRequestProperties.request_headers*. - repeated string additional_request_headers_to_log = 2; - - // Additional response headers to log in *HTTPResponseProperties.response_headers*. - repeated string additional_response_headers_to_log = 3; -} - -// Common configuration for gRPC access logs. -// [#not-implemented-hide:] -message CommonGrpcAccessLogConfig { - // The friendly name of the access log to be returned in StreamAccessLogsMessage.Identifier. This - // allows the access log server to differentiate between different access logs coming from the - // same Envoy. - string log_name = 1 [(validate.rules).string.min_bytes = 1]; - - // The gRPC service for the access log service. - envoy.api.v2.GrpcService grpc_service = 2 [(validate.rules).message.required = true]; -} From 1ee8679c1847adcbca0092d41926f9257b074a86 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 13:38:43 -0800 Subject: [PATCH 38/47] add ratelimit config Signed-off-by: Kuat Yessenov --- envoy/config/bootstrap/v2/BUILD | 4 ++-- envoy/config/bootstrap/v2/bootstrap.proto | 4 ++-- envoy/service/ratelimit/v2/rls.proto | 23 ----------------------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/envoy/config/bootstrap/v2/BUILD b/envoy/config/bootstrap/v2/BUILD index 3110d0152..bee3ab24c 100644 --- a/envoy/config/bootstrap/v2/BUILD +++ b/envoy/config/bootstrap/v2/BUILD @@ -15,7 +15,7 @@ api_proto_library( "//envoy/config/metrics/v2:stats", "//envoy/config/metrics/v2:metrics_service", "//envoy/api/v2/monitoring:trace", - "//envoy/service/ratelimit/v2:rls", + "//envoy/config/ratelimit/v2:rls", ], ) @@ -32,6 +32,6 @@ api_go_proto_library( "//envoy/config/metrics/v2:stats_go_proto", "//envoy/config/metrics/v2:metrics_service_go_proto", "//envoy/api/v2/monitoring:trace_go_proto", - "//envoy/service/ratelimit/v2:rls_go_grpc", + "//envoy/config/ratelimit/v2:rls_go_grpc", ], ) diff --git a/envoy/config/bootstrap/v2/bootstrap.proto b/envoy/config/bootstrap/v2/bootstrap.proto index 0bb854f56..a59946989 100644 --- a/envoy/config/bootstrap/v2/bootstrap.proto +++ b/envoy/config/bootstrap/v2/bootstrap.proto @@ -17,7 +17,7 @@ import "envoy/api/v2/listener/listener.proto"; import "envoy/api/v2/monitoring/trace.proto"; import "envoy/config/metrics/v2/stats.proto"; import "envoy/config/metrics/v2/metrics_service.proto"; -import "envoy/service/ratelimit/v2/rls.proto"; +import "envoy/config/ratelimit/v2/rls.proto"; import "google/protobuf/duration.proto"; @@ -111,7 +111,7 @@ message Bootstrap { // Configuration for an external rate limit service provider. If not // specified, any calls to the rate limit service will immediately return // success. - envoy.service.ratelimit.v2.RateLimitServiceConfig rate_limit_service = 10; + envoy.config.ratelimit.v2.RateLimitServiceConfig rate_limit_service = 10; // Configuration for the runtime configuration provider. If not specified, a // “null” provider will be used which will result in all defaults being used. diff --git a/envoy/service/ratelimit/v2/rls.proto b/envoy/service/ratelimit/v2/rls.proto index 86a09bb4a..4719087f6 100644 --- a/envoy/service/ratelimit/v2/rls.proto +++ b/envoy/service/ratelimit/v2/rls.proto @@ -3,13 +3,10 @@ syntax = "proto3"; package envoy.service.ratelimit.v2; option go_package = "ratelimit"; -import "envoy/api/v2/grpc_service.proto"; import "envoy/api/v2/ratelimit/ratelimit.proto"; import "validate/validate.proto"; -// [#protodoc-title: Rate limit service configuration] - service RateLimitService { // Determine whether rate limiting should take place. rpc ShouldRateLimit(RateLimitRequest) returns (RateLimitResponse) { @@ -79,23 +76,3 @@ message RateLimitResponse { // descriptors failed and/or what the currently configured limits are for all of them. repeated DescriptorStatus statuses = 2; } - -// Rate limit :ref:`configuration overview `. -message RateLimitServiceConfig { - oneof service_specifier { - option (validate.required) = true; - - // Specifies the cluster manager cluster name that hosts the rate limit - // service. The client will connect to this cluster when it needs to make - // rate limit service requests. This field is deprecated and `grpc_service` - // should be used instead. The :ref:`Envoy gRPC client - // ` will be used when this field is - // specified. - string cluster_name = 1 [(validate.rules).string.min_bytes = 1, deprecated = true]; - - // Specifies the gRPC service that hosts the rate limit service. The client - // will connect to this cluster when it needs to make rate limit service - // requests. - envoy.api.v2.GrpcService grpc_service = 2; - } -} From dc5e55fbcb7b46fe3e1c0f2f2006f7053012b9e5 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 13:38:55 -0800 Subject: [PATCH 39/47] missing files Signed-off-by: Kuat Yessenov --- envoy/config/accesslog/v2/BUILD | 9 +++++++++ envoy/config/ratelimit/v2/BUILD | 19 ++++++++++++++++++ envoy/config/ratelimit/v2/rls.proto | 30 +++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 envoy/config/accesslog/v2/BUILD create mode 100644 envoy/config/ratelimit/v2/BUILD create mode 100644 envoy/config/ratelimit/v2/rls.proto diff --git a/envoy/config/accesslog/v2/BUILD b/envoy/config/accesslog/v2/BUILD new file mode 100644 index 000000000..52b740d5a --- /dev/null +++ b/envoy/config/accesslog/v2/BUILD @@ -0,0 +1,9 @@ +load("//bazel:api_build_system.bzl", "api_proto_library") + +api_proto_library( + name = "als", + srcs = ["als.proto"], + deps = [ + "//envoy/api/v2:grpc_service", + ], +) diff --git a/envoy/config/ratelimit/v2/BUILD b/envoy/config/ratelimit/v2/BUILD new file mode 100644 index 000000000..0a7bafa3e --- /dev/null +++ b/envoy/config/ratelimit/v2/BUILD @@ -0,0 +1,19 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_grpc_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "rls", + srcs = ["rls.proto"], + deps = [ + "//envoy/api/v2:grpc_service", + ], +) + +api_go_grpc_library( + name = "rls", + proto = ":rls", + deps = [ + "//envoy/api/v2:grpc_service_go_proto", + ], +) diff --git a/envoy/config/ratelimit/v2/rls.proto b/envoy/config/ratelimit/v2/rls.proto new file mode 100644 index 000000000..5ecd3635c --- /dev/null +++ b/envoy/config/ratelimit/v2/rls.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package envoy.config.ratelimit.v2; +option go_package = "ratelimit"; + +import "envoy/api/v2/grpc_service.proto"; + +import "validate/validate.proto"; + +// [#protodoc-title: Rate limit service configuration] + +// Rate limit :ref:`configuration overview `. +message RateLimitServiceConfig { + oneof service_specifier { + option (validate.required) = true; + + // Specifies the cluster manager cluster name that hosts the rate limit + // service. The client will connect to this cluster when it needs to make + // rate limit service requests. This field is deprecated and `grpc_service` + // should be used instead. The :ref:`Envoy gRPC client + // ` will be used when this field is + // specified. + string cluster_name = 1 [(validate.rules).string.min_bytes = 1, deprecated = true]; + + // Specifies the gRPC service that hosts the rate limit service. The client + // will connect to this cluster when it needs to make rate limit service + // requests. + envoy.api.v2.GrpcService grpc_service = 2; + } +} From 2d30be2c61471b8d1219b4c4d838124d1229e0ea Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 13:47:34 -0800 Subject: [PATCH 40/47] trace config Signed-off-by: Kuat Yessenov --- envoy/BUILD | 4 ++-- envoy/config/bootstrap/v2/BUILD | 4 ++-- envoy/config/bootstrap/v2/bootstrap.proto | 5 ++--- envoy/{api/v2/monitoring => config/trace/v2}/BUILD | 0 envoy/{api/v2/monitoring => config/trace/v2}/trace.proto | 9 ++++++++- envoy/service/trace/v2/trace_service.proto | 6 ------ 6 files changed, 14 insertions(+), 14 deletions(-) rename envoy/{api/v2/monitoring => config/trace/v2}/BUILD (100%) rename envoy/{api/v2/monitoring => config/trace/v2}/trace.proto (91%) diff --git a/envoy/BUILD b/envoy/BUILD index ef2c0748d..35b193dbc 100644 --- a/envoy/BUILD +++ b/envoy/BUILD @@ -13,15 +13,15 @@ proto_library( "//envoy/api/v2/filter/http", "//envoy/api/v2/filter/network", "//envoy/api/v2/listener", - "//envoy/api/v2/monitoring:trace", "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", "//envoy/config/bootstrap/v2:bootstrap", "//envoy/config/metrics/v2:stats", "//envoy/config/metrics/v2:metrics_service", + "//envoy/config/ratelimit/v2:rls", + "//envoy/config/trace/v2:trace", "//envoy/service/discovery", "//envoy/service/load_stats", "//envoy/service/metrics", - "//envoy/service/ratelimit", ], ) diff --git a/envoy/config/bootstrap/v2/BUILD b/envoy/config/bootstrap/v2/BUILD index bee3ab24c..8a1446a86 100644 --- a/envoy/config/bootstrap/v2/BUILD +++ b/envoy/config/bootstrap/v2/BUILD @@ -14,7 +14,7 @@ api_proto_library( "//envoy/api/v2/listener", "//envoy/config/metrics/v2:stats", "//envoy/config/metrics/v2:metrics_service", - "//envoy/api/v2/monitoring:trace", + "//envoy/config/trace/v2:trace", "//envoy/config/ratelimit/v2:rls", ], ) @@ -31,7 +31,7 @@ api_go_proto_library( "//envoy/api/v2/listener:listener_go_proto", "//envoy/config/metrics/v2:stats_go_proto", "//envoy/config/metrics/v2:metrics_service_go_proto", - "//envoy/api/v2/monitoring:trace_go_proto", + "//envoy/config/trace/v2:trace_go_proto", "//envoy/config/ratelimit/v2:rls_go_grpc", ], ) diff --git a/envoy/config/bootstrap/v2/bootstrap.proto b/envoy/config/bootstrap/v2/bootstrap.proto index a59946989..494950037 100644 --- a/envoy/config/bootstrap/v2/bootstrap.proto +++ b/envoy/config/bootstrap/v2/bootstrap.proto @@ -14,9 +14,8 @@ import "envoy/api/v2/auth/cert.proto"; import "envoy/api/v2/config_source.proto"; import "envoy/api/v2/cluster/cluster.proto"; import "envoy/api/v2/listener/listener.proto"; -import "envoy/api/v2/monitoring/trace.proto"; +import "envoy/config/trace/v2/trace.proto"; import "envoy/config/metrics/v2/stats.proto"; -import "envoy/config/metrics/v2/metrics_service.proto"; import "envoy/config/ratelimit/v2/rls.proto"; import "google/protobuf/duration.proto"; @@ -106,7 +105,7 @@ message Bootstrap { // Configuration for an external tracing provider. If not specified, no // tracing will be performed. - envoy.api.v2.monitoring.Tracing tracing = 9; + envoy.config.trace.v2.Tracing tracing = 9; // Configuration for an external rate limit service provider. If not // specified, any calls to the rate limit service will immediately return diff --git a/envoy/api/v2/monitoring/BUILD b/envoy/config/trace/v2/BUILD similarity index 100% rename from envoy/api/v2/monitoring/BUILD rename to envoy/config/trace/v2/BUILD diff --git a/envoy/api/v2/monitoring/trace.proto b/envoy/config/trace/v2/trace.proto similarity index 91% rename from envoy/api/v2/monitoring/trace.proto rename to envoy/config/trace/v2/trace.proto index a7421e48a..af2763dea 100644 --- a/envoy/api/v2/monitoring/trace.proto +++ b/envoy/config/trace/v2/trace.proto @@ -3,7 +3,8 @@ syntax = "proto3"; -package envoy.api.v2.monitoring; +package envoy.config.trace.v2; +option go_package = "trace"; import "google/protobuf/struct.proto"; @@ -66,3 +67,9 @@ message DynamicOtConfig { // library. google.protobuf.Struct config = 2; } + +// Configuration structure. +message TraceServiceConfig { + // The upstream gRPC cluster that hosts the metrics service. + envoy.api.v2.GrpcService grpc_service = 1 [(validate.rules).message.required = true]; +} diff --git a/envoy/service/trace/v2/trace_service.proto b/envoy/service/trace/v2/trace_service.proto index b3257ff0b..6cd2394ba 100644 --- a/envoy/service/trace/v2/trace_service.proto +++ b/envoy/service/trace/v2/trace_service.proto @@ -40,9 +40,3 @@ message StreamTracesMessage { // A list of Span entries repeated opencensus.proto.trace.Span spans = 2; } - -// Configuration structure. -message TraceServiceConfig { - // The upstream gRPC cluster that hosts the metrics service. - envoy.api.v2.GrpcService grpc_service = 1 [(validate.rules).message.required = true]; -} From 8163206ec5e66864df13de8626b515b8f4bab028 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 13:49:30 -0800 Subject: [PATCH 41/47] fix imports Signed-off-by: Kuat Yessenov --- envoy/config/trace/v2/BUILD | 6 ++++++ envoy/config/trace/v2/trace.proto | 2 ++ envoy/service/trace/v2/BUILD | 1 - envoy/service/trace/v2/trace_service.proto | 1 - 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/envoy/config/trace/v2/BUILD b/envoy/config/trace/v2/BUILD index 81fb19437..08e36b14d 100644 --- a/envoy/config/trace/v2/BUILD +++ b/envoy/config/trace/v2/BUILD @@ -5,9 +5,15 @@ licenses(["notice"]) # Apache 2 api_proto_library( name = "trace", srcs = ["trace.proto"], + deps = [ + "//envoy/api/v2:grpc_service", + ], ) api_go_proto_library( name = "trace", proto = ":trace", + deps = [ + "//envoy/api/v2:grpc_service_go_proto", + ], ) diff --git a/envoy/config/trace/v2/trace.proto b/envoy/config/trace/v2/trace.proto index af2763dea..2e3d74611 100644 --- a/envoy/config/trace/v2/trace.proto +++ b/envoy/config/trace/v2/trace.proto @@ -6,6 +6,8 @@ syntax = "proto3"; package envoy.config.trace.v2; option go_package = "trace"; +import "envoy/api/v2/grpc_service.proto"; + import "google/protobuf/struct.proto"; import "validate/validate.proto"; diff --git a/envoy/service/trace/v2/BUILD b/envoy/service/trace/v2/BUILD index fdf0ce419..10b3de2fa 100644 --- a/envoy/service/trace/v2/BUILD +++ b/envoy/service/trace/v2/BUILD @@ -9,7 +9,6 @@ api_proto_library( require_py = 0, deps = [ "//envoy/api/v2:base", - "//envoy/api/v2:grpc_service", "@io_opencensus_trace//:trace_model", ], ) diff --git a/envoy/service/trace/v2/trace_service.proto b/envoy/service/trace/v2/trace_service.proto index 6cd2394ba..142afb7e0 100644 --- a/envoy/service/trace/v2/trace_service.proto +++ b/envoy/service/trace/v2/trace_service.proto @@ -6,7 +6,6 @@ package envoy.service.trace.v2; option go_package = "trace"; import "envoy/api/v2/base.proto"; -import "envoy/api/v2/grpc_service.proto"; import "trace.proto"; import "google/api/annotations.proto"; From cd734a5f503f3f3b1280900d046e0f6ba308424b Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 13:50:17 -0800 Subject: [PATCH 42/47] fix format Signed-off-by: Kuat Yessenov --- envoy/BUILD | 2 +- envoy/config/bootstrap/v2/BUILD | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/envoy/BUILD b/envoy/BUILD index 35b193dbc..486701bc8 100644 --- a/envoy/BUILD +++ b/envoy/BUILD @@ -16,8 +16,8 @@ proto_library( "//envoy/api/v2/ratelimit", "//envoy/api/v2/route", "//envoy/config/bootstrap/v2:bootstrap", - "//envoy/config/metrics/v2:stats", "//envoy/config/metrics/v2:metrics_service", + "//envoy/config/metrics/v2:stats", "//envoy/config/ratelimit/v2:rls", "//envoy/config/trace/v2:trace", "//envoy/service/discovery", diff --git a/envoy/config/bootstrap/v2/BUILD b/envoy/config/bootstrap/v2/BUILD index 8a1446a86..d089ce077 100644 --- a/envoy/config/bootstrap/v2/BUILD +++ b/envoy/config/bootstrap/v2/BUILD @@ -12,10 +12,10 @@ api_proto_library( "//envoy/api/v2/auth:cert", "//envoy/api/v2/cluster", "//envoy/api/v2/listener", - "//envoy/config/metrics/v2:stats", "//envoy/config/metrics/v2:metrics_service", - "//envoy/config/trace/v2:trace", + "//envoy/config/metrics/v2:stats", "//envoy/config/ratelimit/v2:rls", + "//envoy/config/trace/v2:trace", ], ) @@ -29,9 +29,9 @@ api_go_proto_library( "//envoy/api/v2/auth:cert_go_proto", "//envoy/api/v2/cluster:cluster_go_proto", "//envoy/api/v2/listener:listener_go_proto", - "//envoy/config/metrics/v2:stats_go_proto", "//envoy/config/metrics/v2:metrics_service_go_proto", - "//envoy/config/trace/v2:trace_go_proto", + "//envoy/config/metrics/v2:stats_go_proto", "//envoy/config/ratelimit/v2:rls_go_grpc", + "//envoy/config/trace/v2:trace_go_proto", ], ) From a1bf2ad61ad48915b0efe9a9a0acf5963a56fd39 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 14:37:14 -0800 Subject: [PATCH 43/47] fix docs Signed-off-by: Kuat Yessenov --- docs/build.sh | 10 +++---- docs/root/api-v2/api.rst | 10 +++---- .../cluster_manager/cluster_manager.rst | 2 +- .../configuration/overview/v2_overview.rst | 28 +++++++++---------- docs/root/configuration/rate_limit.rst | 2 +- docs/root/configuration/runtime.rst | 2 +- docs/root/intro/arch_overview/statistics.rst | 2 +- docs/root/intro/arch_overview/tracing.rst | 2 +- docs/root/operations/admin.rst | 2 +- docs/root/operations/cli.rst | 6 ++-- .../network/http_connection_manager.proto | 2 +- envoy/config/bootstrap/v2/bootstrap.proto | 4 +-- envoy/config/metrics/v2/metrics_service.proto | 6 ++-- envoy/config/metrics/v2/stats.proto | 20 ++++++------- envoy/config/trace/v2/trace.proto | 12 ++++---- .../service/metrics/v2/metrics_service.proto | 2 -- 16 files changed, 56 insertions(+), 56 deletions(-) diff --git a/docs/build.sh b/docs/build.sh index 053ba01e0..491c3224b 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -39,13 +39,13 @@ PROTO_RST=" /envoy/api/v2/health_check/envoy/api/v2/health_check.proto.rst /envoy/api/v2/protocol/envoy/api/v2/protocol.proto.rst /envoy/api/v2/ratelimit/ratelimit/envoy/api/v2/ratelimit/ratelimit.proto.rst - /envoy/bootstrap/v2/bootstrap/envoy/bootstrap/v2/bootstrap.proto.rst + /envoy/config/bootstrap/v2/bootstrap/envoy/config/bootstrap/v2/bootstrap.proto.rst /envoy/service/discovery/v2/common/envoy/service/discovery/v2/common.proto.rst /envoy/service/discovery/v2/eds/envoy/service/discovery/v2/eds.proto.rst - /envoy/service/ratelimit/v2/rls/envoy/service/ratelimit/v2/rls.proto.rst - /envoy/service/metrics/v2/metrics_service/envoy/service/metrics/v2/metrics_service.proto.rst - /envoy/api/v2/monitoring/stats/envoy/api/v2/monitoring/stats.proto.rst - /envoy/api/v2/monitoring/trace/envoy/api/v2/monitoring/trace.proto.rst + /envoy/config/ratelimit/v2/rls/envoy/config/ratelimit/v2/rls.proto.rst + /envoy/config/metrics/v2/metrics_service/envoy/config/metrics/v2/metrics_service.proto.rst + /envoy/config/metrics/v2/stats/envoy/config/metrics/v2/stats.proto.rst + /envoy/config/trace/v2/trace/envoy/config/trace/v2/trace.proto.rst /envoy/api/v2/filter/accesslog/accesslog/envoy/api/v2/filter/accesslog/accesslog.proto.rst /envoy/api/v2/filter/fault/envoy/api/v2/filter/fault.proto.rst /envoy/api/v2/filter/http/buffer/envoy/api/v2/filter/http/buffer.proto.rst diff --git a/docs/root/api-v2/api.rst b/docs/root/api-v2/api.rst index a14e42c4e..45041b3f7 100644 --- a/docs/root/api-v2/api.rst +++ b/docs/root/api-v2/api.rst @@ -7,7 +7,7 @@ v2 API reference :glob: :maxdepth: 2 - bootstrap/v2/bootstrap.proto + config/bootstrap/v2/bootstrap.proto api/v2/config_source.proto api/v2/grpc_service.proto api/v2/listener/listener.proto @@ -18,13 +18,13 @@ v2 API reference api/v2/health_check.proto api/v2/route/route.proto api/v2/auth/cert.proto - api/v2/monitoring/stats.proto - service/metrics/v2/metrics_service.proto - api/v2/monitoring/trace.proto + config/metrics/v2/stats.proto + config/metrics/v2/metrics_service.proto + config/trace/v2/trace.proto api/v2/base.proto api/v2/address.proto api/v2/protocol.proto service/discovery/v2/common.proto api/v2/ratelimit/ratelimit.proto - service/ratelimit/v2/rls.proto + config/ratelimit/v2/rls.proto api/v2/filter/filter diff --git a/docs/root/configuration/cluster_manager/cluster_manager.rst b/docs/root/configuration/cluster_manager/cluster_manager.rst index a780d991b..d8fa69736 100644 --- a/docs/root/configuration/cluster_manager/cluster_manager.rst +++ b/docs/root/configuration/cluster_manager/cluster_manager.rst @@ -14,4 +14,4 @@ Cluster manager * Cluster manager :ref:`architecture overview ` * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` diff --git a/docs/root/configuration/overview/v2_overview.rst b/docs/root/configuration/overview/v2_overview.rst index a51f8e5df..92fcce510 100644 --- a/docs/root/configuration/overview/v2_overview.rst +++ b/docs/root/configuration/overview/v2_overview.rst @@ -44,15 +44,15 @@ where the extension reflects the underlying v2 config representation. The to autodetect the config file version, but this option provides an enhanced debug experience when configuration parsing fails. -The :ref:`Bootstrap ` message is the root of the -configuration. A key concept in the :ref:`Bootstrap ` +The :ref:`Bootstrap ` message is the root of the +configuration. A key concept in the :ref:`Bootstrap ` message is the distinction between static and dynamic resouces. Resources such as a :ref:`Listener ` or :ref:`Cluster ` may be supplied either statically in -:ref:`static_resources ` or have +:ref:`static_resources ` or have an xDS service such as :ref:`LDS ` or :ref:`CDS ` configured in -:ref:`dynamic_resources `. +:ref:`dynamic_resources `. Example ------- @@ -316,8 +316,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /envoy.api.v2.EndpointDiscoveryService/StreamEndpoints @@ -350,8 +350,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /envoy.api.v2.RouteDiscoveryService/StreamRoutes @@ -388,8 +388,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /v2/discovery:endpoints @@ -422,8 +422,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_xds_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. .. http:post:: /v2/discovery:routes @@ -488,8 +488,8 @@ for the service definition. This is used by Envoy as a client when cluster_names: [some_ads_cluster] is set in the :ref:`dynamic_resources -` of the :ref:`Bootstrap -` config. +` of the :ref:`Bootstrap +` config. When this is set, any of the configuration sources :ref:`above ` can be set to use the ADS channel. For example, a LDS config could be changed from diff --git a/docs/root/configuration/rate_limit.rst b/docs/root/configuration/rate_limit.rst index 041969022..8dc5638a2 100644 --- a/docs/root/configuration/rate_limit.rst +++ b/docs/root/configuration/rate_limit.rst @@ -8,7 +8,7 @@ limit service Envoy should talk to when it needs to make global rate limit decis limit service is configured, a "null" service will be used which will always return OK if called. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` gRPC service IDL ---------------- diff --git a/docs/root/configuration/runtime.rst b/docs/root/configuration/runtime.rst index e929030ef..1d1458c47 100644 --- a/docs/root/configuration/runtime.rst +++ b/docs/root/configuration/runtime.rst @@ -8,7 +8,7 @@ system tree that contains re-loadable configuration elements. If runtime is not provider is used which has the effect of using all defaults built into the code. * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` File system layout ------------------ diff --git a/docs/root/intro/arch_overview/statistics.rst b/docs/root/intro/arch_overview/statistics.rst index 7f41a2162..9c4d1ba69 100644 --- a/docs/root/intro/arch_overview/statistics.rst +++ b/docs/root/intro/arch_overview/statistics.rst @@ -23,4 +23,4 @@ received. Note: what were previously referred to as timers have become histogram difference between the two representations was the units. * :ref:`v1 API reference `. -* :ref:`v2 API reference `. +* :ref:`v2 API reference `. diff --git a/docs/root/intro/arch_overview/tracing.rst b/docs/root/intro/arch_overview/tracing.rst index b9dbee1d9..a5294a56f 100644 --- a/docs/root/intro/arch_overview/tracing.rst +++ b/docs/root/intro/arch_overview/tracing.rst @@ -102,6 +102,6 @@ request ID :ref:`config_http_conn_man_headers_x-request-id` (LightStep) or the trace ID configuration (Zipkin). See * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` for more information on how to setup tracing in Envoy. diff --git a/docs/root/operations/admin.rst b/docs/root/operations/admin.rst index 24b554aa8..4b967c5fe 100644 --- a/docs/root/operations/admin.rst +++ b/docs/root/operations/admin.rst @@ -7,7 +7,7 @@ Envoy exposes a local administration interface that can be used to query and modify different aspects of the server: * :ref:`v1 API reference ` -* :ref:`v2 API reference ` +* :ref:`v2 API reference ` .. http:get:: / diff --git a/docs/root/operations/cli.rst b/docs/root/operations/cli.rst index da85a92cf..a50bbcc4d 100644 --- a/docs/root/operations/cli.rst +++ b/docs/root/operations/cli.rst @@ -90,7 +90,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service cluster name where Envoy is running. The local service cluster name is first sourced from the :ref:`Bootstrap node - ` message's :ref:`cluster + ` message's :ref:`cluster ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if any of the following features are used: @@ -107,7 +107,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service node name where Envoy is running. The local service node name is first sourced from the :ref:`Bootstrap node - ` message's :ref:`id + ` message's :ref:`id ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if any of the following features are used: @@ -120,7 +120,7 @@ following are the command line options that Envoy supports. *(optional)* Defines the local service zone where Envoy is running. The local service zone is first sourced from the :ref:`Bootstrap node - ` message's :ref:`locality.zone + ` message's :ref:`locality.zone ` field. This CLI option provides an alternative method for specifying this value and will override any value set in bootstrap configuration. It should be set if discovery service routing is diff --git a/envoy/api/v2/filter/network/http_connection_manager.proto b/envoy/api/v2/filter/network/http_connection_manager.proto index 665b301f2..4eb867ad8 100644 --- a/envoy/api/v2/filter/network/http_connection_manager.proto +++ b/envoy/api/v2/filter/network/http_connection_manager.proto @@ -84,7 +84,7 @@ message HttpConnectionManager { // Presence of the object defines whether the connection manager // emits :ref:`tracing ` data to the :ref:`configured tracing provider - // `. + // `. Tracing tracing = 7; // Additional HTTP/1 settings that are passed to the HTTP/1 codec. diff --git a/envoy/config/bootstrap/v2/bootstrap.proto b/envoy/config/bootstrap/v2/bootstrap.proto index 494950037..b044e46c6 100644 --- a/envoy/config/bootstrap/v2/bootstrap.proto +++ b/envoy/config/bootstrap/v2/bootstrap.proto @@ -35,7 +35,7 @@ message Bootstrap { repeated envoy.api.v2.listener.Listener listeners = 1; // If a network based configuration source is specified for :ref:`cds_config - // `, it's necessary + // `, it's necessary // to have some initial cluster definitions available to allow Envoy to know // how to speak to the management server. These cluster definitions may not // use :ref:`EDS ` (i.e. they should be static @@ -144,7 +144,7 @@ message ClusterManager { // If *local_cluster_name* is defined then :ref:`clusters // ` must be defined in the :ref:`Bootstrap // static cluster resources - // `. This is unrelated to + // `. This is unrelated to // the :option:`--service-cluster` option which does not `affect zone aware // routing `_. string local_cluster_name = 1; diff --git a/envoy/config/metrics/v2/metrics_service.proto b/envoy/config/metrics/v2/metrics_service.proto index cb1ec2350..9faa7306c 100644 --- a/envoy/config/metrics/v2/metrics_service.proto +++ b/envoy/config/metrics/v2/metrics_service.proto @@ -2,6 +2,8 @@ syntax = "proto3"; // [#proto-status: draft] +// [#protodoc-title: Metrics Service] + package envoy.config.metrics.v2; import "envoy/api/v2/grpc_service.proto"; @@ -9,8 +11,8 @@ import "envoy/api/v2/grpc_service.proto"; import "validate/validate.proto"; // Metrics Service is configured as a built-in *envoy.metrics_service* :ref:`StatsSink -// `. This opaque configuration will be used to create Metrics -// Service. +// `. This opaque configuration will be used to create +// Metrics Service. message MetricsServiceConfig { // The upstream gRPC cluster that hosts the metrics service. envoy.api.v2.GrpcService grpc_service = 1 [(validate.rules).message.required = true]; diff --git a/envoy/config/metrics/v2/stats.proto b/envoy/config/metrics/v2/stats.proto index 7b7f64923..6e31fb42b 100644 --- a/envoy/config/metrics/v2/stats.proto +++ b/envoy/config/metrics/v2/stats.proto @@ -18,13 +18,13 @@ message StatsSink { // The name of the stats sink to instantiate. The name must match a supported // stats sink. The built-in stats sinks are: // - // * :ref:`envoy.statsd ` - // * :ref:`envoy.dog_statsd ` - // * :ref:`envoy.metrics_service ` + // * :ref:`envoy.statsd ` + // * :ref:`envoy.dog_statsd ` + // * :ref:`envoy.metrics_service ` string name = 1; // Stats sink specific configuration which depends on the sink being - // instantiated. See :ref:`StatsdSink ` for an + // instantiated. See :ref:`StatsdSink ` for an // example. google.protobuf.Struct config = 2; } @@ -33,13 +33,13 @@ message StatsSink { message StatsConfig { // Each stat name is iteratively processed through these tag specifiers. // When a tag is matched, the first capture group is removed from the name so - // later :ref:`TagSpecifiers ` cannot match that + // later :ref:`TagSpecifiers ` cannot match that // same portion of the match. repeated TagSpecifier stats_tags = 1; // Use all default tag regexes specified in Envoy. These can be combined with // custom tags specified in :ref:`stats_tags - // `. They will be processed before + // `. They will be processed before // the custom tags. // // .. note:: @@ -65,9 +65,9 @@ message TagSpecifier { // portions of existing stats, which can be found in `well_known_names.h // `_ // in the Envoy repository. If a :ref:`tag_name - // ` is provided in the config and neither - // :ref:`regex ` or - // :ref:`fixed_value ` were specified, + // ` is provided in the config and + // neither :ref:`regex ` or + // :ref:`fixed_value ` were specified, // Envoy will attempt to find that name in its set of defaults and use the accompanying regex. // // .. note:: @@ -157,7 +157,7 @@ message StatsdSink { // Stats configuration proto schema for built-in *envoy.dog_statsd* sink. // The sink emits stats with `DogStatsD `_ // compatible tags. Tags are configurable via :ref:`StatsConfig -// `. +// `. message DogStatsdSink { oneof dog_statsd_specifier { option (validate.required) = true; diff --git a/envoy/config/trace/v2/trace.proto b/envoy/config/trace/v2/trace.proto index 2e3d74611..219d73b06 100644 --- a/envoy/config/trace/v2/trace.proto +++ b/envoy/config/trace/v2/trace.proto @@ -14,8 +14,8 @@ import "validate/validate.proto"; // The tracing configuration specifies global // settings for the HTTP tracer used by Envoy. The configuration is defined by -// the :ref:`Bootstrap ` :ref:`tracing -// ` field. Envoy may support other tracers +// the :ref:`Bootstrap ` :ref:`tracing +// ` field. Envoy may support other tracers // in the future, but right now the HTTP tracer is the only one supported. message Tracing { message Http { @@ -26,9 +26,9 @@ message Tracing { // Trace driver specific configuration which depends on the driver being // instantiated. See the :ref:`LightstepConfig - // `, :ref:`ZipkinConfig - // `, and :ref:`DynamicOtConfig - // ` trace drivers for examples. + // `, :ref:`ZipkinConfig + // `, and :ref:`DynamicOtConfig + // ` trace drivers for examples. google.protobuf.Struct config = 2; } // Provides configuration for the HTTP tracer. @@ -48,7 +48,7 @@ message LightstepConfig { message ZipkinConfig { // The cluster manager cluster that hosts the Zipkin collectors. Note that the // Zipkin cluster must be defined in the :ref:`Bootstrap static cluster - // resources `. + // resources `. string collector_cluster = 1 [(validate.rules).string.min_bytes = 1]; // The API endpoint of the Zipkin service where the spans will be sent. When diff --git a/envoy/service/metrics/v2/metrics_service.proto b/envoy/service/metrics/v2/metrics_service.proto index 8adcdbda2..127944727 100644 --- a/envoy/service/metrics/v2/metrics_service.proto +++ b/envoy/service/metrics/v2/metrics_service.proto @@ -2,8 +2,6 @@ syntax = "proto3"; // [#proto-status: draft] -// [#protodoc-title: Metrics Service] - package envoy.service.metrics.v2; option go_package = "metrics"; From f0106d3d668ba18810d68385416870532c9cd801 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 15:28:46 -0800 Subject: [PATCH 44/47] create endpoint package Signed-off-by: Kuat Yessenov --- envoy/api/v2/base.proto | 5 - envoy/api/v2/endpoint/BUILD | 45 +++++++++ envoy/api/v2/endpoint/endpoint.proto | 98 +++++++++++++++++++ envoy/api/v2/endpoint/load_report.proto | 96 ++++++++++++++++++ envoy/service/discovery/v2/BUILD | 4 + envoy/service/discovery/v2/eds.proto | 83 +--------------- envoy/service/discovery/v2/hds.proto | 5 +- envoy/service/load_stats/v2/BUILD | 4 +- envoy/service/load_stats/v2/lrs.proto | 92 +---------------- .../service/metrics/v2/metrics_service.proto | 1 - 10 files changed, 252 insertions(+), 181 deletions(-) create mode 100644 envoy/api/v2/endpoint/BUILD create mode 100644 envoy/api/v2/endpoint/endpoint.proto create mode 100644 envoy/api/v2/endpoint/load_report.proto diff --git a/envoy/api/v2/base.proto b/envoy/api/v2/base.proto index 0046d929d..4abeb3406 100644 --- a/envoy/api/v2/base.proto +++ b/envoy/api/v2/base.proto @@ -76,11 +76,6 @@ message Node { string build_version = 5; } -// Upstream host identifier. -message Endpoint { - Address address = 1; -} - // Metadata provides additional inputs to filters based on matched listeners, // filter chains, routes and endpoints. It is structured as a map from filter // name (in reverse DNS format) to metadata specific to the filter. Metadata diff --git a/envoy/api/v2/endpoint/BUILD b/envoy/api/v2/endpoint/BUILD new file mode 100644 index 000000000..07e1c750c --- /dev/null +++ b/envoy/api/v2/endpoint/BUILD @@ -0,0 +1,45 @@ +load("//bazel:api_build_system.bzl", "api_proto_library", "api_go_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "endpoint", + srcs = ["endpoint.proto"], + deps = [ + "//envoy/api/v2:address", + "//envoy/api/v2:base", + "//envoy/api/v2:config_source", + "//envoy/api/v2:health_check", + "//envoy/api/v2:protocol", + "//envoy/api/v2/auth:cert", + ], +) + +api_go_proto_library( + name = "endpoint", + proto = ":endpoint", + deps = [ + "//envoy/api/v2:address_go_proto", + "//envoy/api/v2:base_go_proto", + "//envoy/api/v2:config_source_go_proto", + "//envoy/api/v2:health_check_go_proto", + "//envoy/api/v2:protocol_go_proto", + "//envoy/api/v2/auth:cert_go_proto", + ], +) + +api_proto_library( + name = "load_report", + srcs = ["load_report.proto"], + deps = [ + "//envoy/api/v2:base", + ], +) + +api_go_proto_library( + name = "load_report", + proto = ":load_report", + deps = [ + "//envoy/api/v2:base_go_proto", + ], +) diff --git a/envoy/api/v2/endpoint/endpoint.proto b/envoy/api/v2/endpoint/endpoint.proto new file mode 100644 index 000000000..900417195 --- /dev/null +++ b/envoy/api/v2/endpoint/endpoint.proto @@ -0,0 +1,98 @@ +syntax = "proto3"; + +package envoy.api.v2.endpoint; +option go_package = "endpoint"; + +import "envoy/api/v2/address.proto"; +import "envoy/api/v2/base.proto"; +import "envoy/api/v2/health_check.proto"; + +import "google/protobuf/wrappers.proto"; + +import "validate/validate.proto"; +import "gogoproto/gogo.proto"; + +// [#protodoc-title: Endpoints] + +// Upstream host identifier. +message Endpoint { + Address address = 1; +} + +// An Endpoint that Envoy can route traffic to. +message LbEndpoint { + // Upstream host identifier + Endpoint endpoint = 1; + + // [#not-implemented-hide:] Optional health status when known and supplied by + // EDS server. + HealthStatus health_status = 2; + + // The endpoint metadata specifies values that may be used by the load + // balancer to select endpoints in a cluster for a given request. The filter + // name should be specified as *envoy.lb*. An example boolean key-value pair + // is *canary*, providing the optional canary status of the upstream host. + // This may be matched against in a route's ForwardAction metadata_match field + // to subset the endpoints considered in cluster load balancing. + Metadata metadata = 3; + + // The optional load balancing weight of the upstream host, in the range 1 - + // 128. Envoy uses the load balancing weight in some of the built in load + // balancers. The load balancing weight for an endpoint is divided by the sum + // of the weights of all endpoints in the endpoint's locality to produce a + // percentage of traffic for the endpoint. This percentage is then further + // weighted by the endpoint's locality's load balancing weight from + // LocalityLbEndpoints. If unspecified, each host is presumed to have equal + // weight in a locality. + // + // .. attention:: + // + // The limit of 128 is somewhat arbitrary, but is applied due to performance + // concerns with the current implementation and can be removed when + // `this issue `_ is fixed. + google.protobuf.UInt32Value load_balancing_weight = 4 + [(validate.rules).uint32 = {gte: 1, lte: 128}]; +} + +// A group of endpoints belonging to a Locality. +// One can have multiple LocalityLbEndpoints for a locality, but this is +// generally only done if the different groups need to have different load +// balancing weights or different priorities. +message LocalityLbEndpoints { + // Identifies location of where the upstream hosts run. + Locality locality = 1; + + // The group of endpoints belonging to the locality specified. + repeated LbEndpoint lb_endpoints = 2; + + // Optional: Per priority/region/zone/sub_zone weight - range 1-128. The load + // balancing weight for a locality is divided by the sum of the weights of all + // localities at the same priority level to produce the effective percentage + // of traffic for the locality. + // + // Weights must be specified for either all localities in a given priority + // level or none. + // + // If unspecified, each locality is presumed to have equal weight in a + // cluster. + // + // .. attention:: + // + // The limit of 128 is somewhat arbitrary, but is applied due to performance + // concerns with the current implementation and can be removed when + // `this issue `_ is fixed. + google.protobuf.UInt32Value load_balancing_weight = 3 + [(validate.rules).uint32 = {gte: 1, lte: 128}]; + + // Optional: the priority for this LocalityLbEndpoints. If unspecified this will + // default to the highest priority (0). + // + // Under usual circumstances, Envoy will only select endpoints for the highest + // priority (0). In the event all endpoints for a particular priority are + // unavailable/unhealthy, Envoy will fail over to selecting endpoints for the + // next highest priority group. + // + // Priorities should range from 0 (highest) to N (lowest) without skipping. + uint32 priority = 5; +} + diff --git a/envoy/api/v2/endpoint/load_report.proto b/envoy/api/v2/endpoint/load_report.proto new file mode 100644 index 000000000..2c2106c7c --- /dev/null +++ b/envoy/api/v2/endpoint/load_report.proto @@ -0,0 +1,96 @@ +syntax = "proto3"; + +package envoy.api.v2.endpoint; + +import "envoy/api/v2/base.proto"; + +import "validate/validate.proto"; +import "gogoproto/gogo.proto"; + +// These are stats Envoy reports to GLB every so often. Report frequency is +// defined by +// :ref:`LoadStatsResponse.load_reporting_interval`. +// Stats per upstream region/zone and optionally per subzone. +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message UpstreamLocalityStats { + // Name of zone, region and optionally endpoint group these metrics were + // collected from. Zone and region names could be empty if unknown. + envoy.api.v2.Locality locality = 1; + + // The total number of requests sent by this Envoy since the last report. A + // single HTTP or gRPC request or stream is counted as one request. A TCP + // connection is also treated as one request. There is no explicit + // total_requests field below for a locality, but it may be inferred from: + // + // .. code-block:: none + // + // total_requests = total_successful_requests + total_requests_in_progress + + // total_error_requests + // + // The total number of requests successfully completed by the endpoints in the + // locality. These include non-5xx responses for HTTP, where errors + // originate at the client and the endpoint responded successfuly. For gRPC, + // the grpc-status values are those not covered by total_error_requests below. + uint64 total_successful_requests = 2; + + // The total number of unfinished requests + uint64 total_requests_in_progress = 3; + + // The total number of requests that failed due to errors at the endpoint. + // For HTTP these are responses with 5xx status codes and for gRPC the + // grpc-status values: + // + // - DeadlineExceeded + // - Unimplemented + // - Internal + // - Unavailable + // - Unknown + // - DataLoss + uint64 total_error_requests = 4; + + // Stats for multi-dimensional load balancing. + repeated EndpointLoadMetricStats load_metric_stats = 5; + + // [#not-implemented-hide:] The priority of the endpoint group these metrics + // were collected from. + uint32 priority = 6; +} + +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message EndpointLoadMetricStats { + // Name of the metric; may be empty. + string metric_name = 1; + + // Number of calls that finished and included this metric. + uint64 num_requests_finished_with_metric = 2; + + // Sum of metric values across all calls that finished with this metric for + // load_reporting_interval. + double total_metric_value = 3; +} + +// Per cluster load stats. Envoy reports these stats a management server in a +// :ref:`LoadStatsRequest` +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message ClusterStats { + // The name of the cluster. + string cluster_name = 1 [(validate.rules).string.min_bytes = 1]; + + // Need at least one. + repeated UpstreamLocalityStats upstream_locality_stats = 2 + [(validate.rules).repeated .min_items = 1]; + + // Cluster-level stats such as total_successful_requests may be computed by + // summing upstream_locality_stats. In addition, below there are additional + // cluster-wide stats. The following total_requests equality holds at the + // cluster-level: + // + // .. code-block:: none + // + // sum_locality(total_successful_requests) + sum_locality(total_requests_in_progress) + + // sum_locality(total_error_requests) + total_dropped_requests` + // + // The total number of dropped requests. This covers requests + // deliberately dropped by the drop_overload policy and circuit breaking. + uint64 total_dropped_requests = 3; +} diff --git a/envoy/service/discovery/v2/BUILD b/envoy/service/discovery/v2/BUILD index 22b7e53f7..924df0560 100644 --- a/envoy/service/discovery/v2/BUILD +++ b/envoy/service/discovery/v2/BUILD @@ -40,6 +40,7 @@ api_proto_library( "//envoy/api/v2:address", "//envoy/api/v2:base", "//envoy/api/v2:health_check", + "//envoy/api/v2/endpoint:endpoint", ], ) @@ -51,6 +52,7 @@ api_go_grpc_library( "//envoy/api/v2:address_go_proto", "//envoy/api/v2:base_go_proto", "//envoy/api/v2:health_check_go_proto", + "//envoy/api/v2/endpoint:endpoint_go_proto", ], ) @@ -95,6 +97,7 @@ api_proto_library( deps = [ "//envoy/api/v2:base", "//envoy/api/v2:health_check", + "//envoy/api/v2/endpoint:endpoint", ], ) @@ -104,6 +107,7 @@ api_go_grpc_library( deps = [ "//envoy/api/v2:base_go_proto", "//envoy/api/v2:health_check_go_proto", + "//envoy/api/v2/endpoint:endpoint_go_proto", ], ) diff --git a/envoy/service/discovery/v2/eds.proto b/envoy/service/discovery/v2/eds.proto index 8af9b9672..1ab930130 100644 --- a/envoy/service/discovery/v2/eds.proto +++ b/envoy/service/discovery/v2/eds.proto @@ -3,11 +3,9 @@ syntax = "proto3"; package envoy.service.discovery.v2; import "envoy/service/discovery/v2/common.proto"; -import "envoy/api/v2/base.proto"; -import "envoy/api/v2/health_check.proto"; +import "envoy/api/v2/endpoint/endpoint.proto"; import "google/api/annotations.proto"; -import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; @@ -32,83 +30,6 @@ service EndpointDiscoveryService { } } -// An Endpoint that Envoy can route traffic to. -message LbEndpoint { - // Upstream host identifier - envoy.api.v2.Endpoint endpoint = 1; - - // [#not-implemented-hide:] Optional health status when known and supplied by - // EDS server. - envoy.api.v2.HealthStatus health_status = 2; - - // The endpoint metadata specifies values that may be used by the load - // balancer to select endpoints in a cluster for a given request. The filter - // name should be specified as *envoy.lb*. An example boolean key-value pair - // is *canary*, providing the optional canary status of the upstream host. - // This may be matched against in a route's ForwardAction metadata_match field - // to subset the endpoints considered in cluster load balancing. - envoy.api.v2.Metadata metadata = 3; - - // The optional load balancing weight of the upstream host, in the range 1 - - // 128. Envoy uses the load balancing weight in some of the built in load - // balancers. The load balancing weight for an endpoint is divided by the sum - // of the weights of all endpoints in the endpoint's locality to produce a - // percentage of traffic for the endpoint. This percentage is then further - // weighted by the endpoint's locality's load balancing weight from - // LocalityLbEndpoints. If unspecified, each host is presumed to have equal - // weight in a locality. - // - // .. attention:: - // - // The limit of 128 is somewhat arbitrary, but is applied due to performance - // concerns with the current implementation and can be removed when - // `this issue `_ is fixed. - google.protobuf.UInt32Value load_balancing_weight = 4 - [(validate.rules).uint32 = {gte: 1, lte: 128}]; -} - -// A group of endpoints belonging to a Locality. -// One can have multiple LocalityLbEndpoints for a locality, but this is -// generally only done if the different groups need to have different load -// balancing weights or different priorities. -message LocalityLbEndpoints { - // Identifies location of where the upstream hosts run. - envoy.api.v2.Locality locality = 1; - - // The group of endpoints belonging to the locality specified. - repeated LbEndpoint lb_endpoints = 2; - - // Optional: Per priority/region/zone/sub_zone weight - range 1-128. The load - // balancing weight for a locality is divided by the sum of the weights of all - // localities at the same priority level to produce the effective percentage - // of traffic for the locality. - // - // Weights must be specified for either all localities in a given priority - // level or none. - // - // If unspecified, each locality is presumed to have equal weight in a - // cluster. - // - // .. attention:: - // - // The limit of 128 is somewhat arbitrary, but is applied due to performance - // concerns with the current implementation and can be removed when - // `this issue `_ is fixed. - google.protobuf.UInt32Value load_balancing_weight = 3 - [(validate.rules).uint32 = {gte: 1, lte: 128}]; - - // Optional: the priority for this LocalityLbEndpoints. If unspecified this will - // default to the highest priority (0). - // - // Under usual circumstances, Envoy will only select endpoints for the highest - // priority (0). In the event all endpoints for a particular priority are - // unavailable/unhealthy, Envoy will fail over to selecting endpoints for the - // next highest priority group. - // - // Priorities should range from 0 (highest) to N (lowest) without skipping. - uint32 priority = 5; -} - // Each route from RDS will map to a single cluster or traffic split across // clusters using weights expressed in the RDS WeightedCluster. // @@ -125,7 +46,7 @@ message ClusterLoadAssignment { string cluster_name = 1 [(validate.rules).string.min_bytes = 1]; // List of endpoints to load balance to. - repeated LocalityLbEndpoints endpoints = 2; + repeated envoy.api.v2.endpoint.LocalityLbEndpoints endpoints = 2; // Load balancing policy settings. message Policy { diff --git a/envoy/service/discovery/v2/hds.proto b/envoy/service/discovery/v2/hds.proto index 5d3375c51..eef6964a2 100644 --- a/envoy/service/discovery/v2/hds.proto +++ b/envoy/service/discovery/v2/hds.proto @@ -4,6 +4,7 @@ package envoy.service.discovery.v2; import "envoy/api/v2/base.proto"; import "envoy/api/v2/health_check.proto"; +import "envoy/api/v2/endpoint/endpoint.proto"; import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; @@ -88,7 +89,7 @@ message HealthCheckRequest { } message EndpointHealth { - envoy.api.v2.Endpoint endpoint = 1; + envoy.api.v2.endpoint.Endpoint endpoint = 1; envoy.api.v2.HealthStatus health_status = 2; } @@ -105,7 +106,7 @@ message HealthCheckRequestOrEndpointHealthResponse { message LocalityEndpoints { envoy.api.v2.Locality locality = 1; - repeated envoy.api.v2.Endpoint endpoints = 2; + repeated envoy.api.v2.endpoint.Endpoint endpoints = 2; } // The cluster name and locality is provided to Envoy for the endpoints that it diff --git a/envoy/service/load_stats/v2/BUILD b/envoy/service/load_stats/v2/BUILD index dde1edeb8..318bbd5d0 100644 --- a/envoy/service/load_stats/v2/BUILD +++ b/envoy/service/load_stats/v2/BUILD @@ -7,8 +7,8 @@ api_proto_library( srcs = ["lrs.proto"], has_services = 1, deps = [ - "//envoy/api/v2:address", "//envoy/api/v2:base", + "//envoy/api/v2/endpoint:load_report", ], ) @@ -16,7 +16,7 @@ api_go_grpc_library( name = "lrs", proto = ":lrs", deps = [ - "//envoy/api/v2:address_go_proto", "//envoy/api/v2:base_go_proto", + "//envoy/api/v2/endpoint:load_report_go_proto", ], ) diff --git a/envoy/service/load_stats/v2/lrs.proto b/envoy/service/load_stats/v2/lrs.proto index 87b0a5ba4..e5d5ba3a6 100644 --- a/envoy/service/load_stats/v2/lrs.proto +++ b/envoy/service/load_stats/v2/lrs.proto @@ -4,8 +4,8 @@ package envoy.service.load_stats.v2; option go_package = "load_stats"; import "envoy/api/v2/base.proto"; +import "envoy/api/v2/endpoint/load_report.proto"; -import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; import "validate/validate.proto"; @@ -45,94 +45,6 @@ service LoadReportingService { } } -// These are stats Envoy reports to GLB every so often. Report frequency is -// defined by -// :ref:`LoadStatsResponse.load_reporting_interval`. -// Stats per upstream region/zone and optionally per subzone. -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message UpstreamLocalityStats { - // Name of zone, region and optionally endpoint group these metrics were - // collected from. Zone and region names could be empty if unknown. - envoy.api.v2.Locality locality = 1; - - // The total number of requests sent by this Envoy since the last report. A - // single HTTP or gRPC request or stream is counted as one request. A TCP - // connection is also treated as one request. There is no explicit - // total_requests field below for a locality, but it may be inferred from: - // - // .. code-block:: none - // - // total_requests = total_successful_requests + total_requests_in_progress + - // total_error_requests - // - // The total number of requests successfully completed by the endpoints in the - // locality. These include non-5xx responses for HTTP, where errors - // originate at the client and the endpoint responded successfuly. For gRPC, - // the grpc-status values are those not covered by total_error_requests below. - uint64 total_successful_requests = 2; - - // The total number of unfinished requests - uint64 total_requests_in_progress = 3; - - // The total number of requests that failed due to errors at the endpoint. - // For HTTP these are responses with 5xx status codes and for gRPC the - // grpc-status values: - // - // - DeadlineExceeded - // - Unimplemented - // - Internal - // - Unavailable - // - Unknown - // - DataLoss - uint64 total_error_requests = 4; - - // Stats for multi-dimensional load balancing. - repeated EndpointLoadMetricStats load_metric_stats = 5; - - // [#not-implemented-hide:] The priority of the endpoint group these metrics - // were collected from. - uint32 priority = 6; -} - -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message EndpointLoadMetricStats { - // Name of the metric; may be empty. - string metric_name = 1; - - // Number of calls that finished and included this metric. - uint64 num_requests_finished_with_metric = 2; - - // Sum of metric values across all calls that finished with this metric for - // load_reporting_interval. - double total_metric_value = 3; -} - -// Per cluster load stats. Envoy reports these stats a management server in a -// :ref:`LoadStatsRequest` -// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. -message ClusterStats { - // The name of the cluster. - string cluster_name = 1 [(validate.rules).string.min_bytes = 1]; - - // Need at least one. - repeated UpstreamLocalityStats upstream_locality_stats = 2 - [(validate.rules).repeated .min_items = 1]; - - // Cluster-level stats such as total_successful_requests may be computed by - // summing upstream_locality_stats. In addition, below there are additional - // cluster-wide stats. The following total_requests equality holds at the - // cluster-level: - // - // .. code-block:: none - // - // sum_locality(total_successful_requests) + sum_locality(total_requests_in_progress) + - // sum_locality(total_error_requests) + total_dropped_requests` - // - // The total number of dropped requests. This covers requests - // deliberately dropped by the drop_overload policy and circuit breaking. - uint64 total_dropped_requests = 3; -} - // A load report Envoy sends to the management server. // [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. message LoadStatsRequest { @@ -140,7 +52,7 @@ message LoadStatsRequest { envoy.api.v2.Node node = 1; // A list of load stats to report. - repeated ClusterStats cluster_stats = 2; + repeated envoy.api.v2.endpoint.ClusterStats cluster_stats = 2; } // The management server sends envoy a LoadStatsResponse with all clusters it diff --git a/envoy/service/metrics/v2/metrics_service.proto b/envoy/service/metrics/v2/metrics_service.proto index 127944727..c70af05da 100644 --- a/envoy/service/metrics/v2/metrics_service.proto +++ b/envoy/service/metrics/v2/metrics_service.proto @@ -6,7 +6,6 @@ package envoy.service.metrics.v2; option go_package = "metrics"; import "envoy/api/v2/base.proto"; -import "envoy/api/v2/grpc_service.proto"; import "metrics.proto"; From fff0ab5efe0f5210ed466857b2d343d9941ee79e Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 15:36:02 -0800 Subject: [PATCH 45/47] fix format Signed-off-by: Kuat Yessenov --- docs/build.sh | 1 + docs/root/api-v2/api.rst | 1 + docs/root/intro/arch_overview/load_balancing.rst | 2 +- envoy/api/v2/endpoint/endpoint.proto | 1 - envoy/service/discovery/v2/BUILD | 4 ++-- envoy/service/discovery/v2/eds.proto | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/build.sh b/docs/build.sh index 491c3224b..1e686f6f8 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -29,6 +29,7 @@ PROTO_RST=" /envoy/api/v2/address/envoy/api/v2/address.proto.rst /envoy/api/v2/base/envoy/api/v2/base.proto.rst /envoy/api/v2/auth/cert/envoy/api/v2/auth/cert.proto.rst + /envoy/api/v2/endpoint/endpoint/envoy/api/v2/endpoint/endpoint.proto.rst /envoy/api/v2/cluster/cluster/envoy/api/v2/cluster/cluster.proto.rst /envoy/api/v2/cluster/outlier_detection/envoy/api/v2/cluster/outlier_detection.proto.rst /envoy/api/v2/cluster/circuit_breaker/envoy/api/v2/cluster/circuit_breaker.proto.rst diff --git a/docs/root/api-v2/api.rst b/docs/root/api-v2/api.rst index 45041b3f7..98f1b5d3d 100644 --- a/docs/root/api-v2/api.rst +++ b/docs/root/api-v2/api.rst @@ -14,6 +14,7 @@ v2 API reference api/v2/cluster/cluster.proto api/v2/cluster/outlier_detection.proto api/v2/cluster/circuit_breaker.proto + api/v2/endpoint/endpoint.proto service/discovery/v2/eds.proto api/v2/health_check.proto api/v2/route/route.proto diff --git a/docs/root/intro/arch_overview/load_balancing.rst b/docs/root/intro/arch_overview/load_balancing.rst index d3ec53584..9a5933412 100644 --- a/docs/root/intro/arch_overview/load_balancing.rst +++ b/docs/root/intro/arch_overview/load_balancing.rst @@ -97,7 +97,7 @@ Priority levels ------------------ During load balancing, Envoy will generally only consider hosts configured at the highest priority -level. For each EDS :ref:`LocalityLbEndpoints` an optional +level. For each EDS :ref:`LocalityLbEndpoints` an optional priority may also be specified. When endpoints at the highest priority level (P=0) are healthy, all traffic will land on endpoints in that priority level. As endpoints for the highest priority level become unhealthy, traffic will begin to trickle to lower priority levels. diff --git a/envoy/api/v2/endpoint/endpoint.proto b/envoy/api/v2/endpoint/endpoint.proto index 900417195..ecb8ca2e2 100644 --- a/envoy/api/v2/endpoint/endpoint.proto +++ b/envoy/api/v2/endpoint/endpoint.proto @@ -95,4 +95,3 @@ message LocalityLbEndpoints { // Priorities should range from 0 (highest) to N (lowest) without skipping. uint32 priority = 5; } - diff --git a/envoy/service/discovery/v2/BUILD b/envoy/service/discovery/v2/BUILD index 924df0560..f911cc4bb 100644 --- a/envoy/service/discovery/v2/BUILD +++ b/envoy/service/discovery/v2/BUILD @@ -40,7 +40,7 @@ api_proto_library( "//envoy/api/v2:address", "//envoy/api/v2:base", "//envoy/api/v2:health_check", - "//envoy/api/v2/endpoint:endpoint", + "//envoy/api/v2/endpoint", ], ) @@ -97,7 +97,7 @@ api_proto_library( deps = [ "//envoy/api/v2:base", "//envoy/api/v2:health_check", - "//envoy/api/v2/endpoint:endpoint", + "//envoy/api/v2/endpoint", ], ) diff --git a/envoy/service/discovery/v2/eds.proto b/envoy/service/discovery/v2/eds.proto index 1ab930130..30a55312c 100644 --- a/envoy/service/discovery/v2/eds.proto +++ b/envoy/service/discovery/v2/eds.proto @@ -9,7 +9,7 @@ import "google/api/annotations.proto"; import "validate/validate.proto"; -// [#protodoc-title: Endpoints and EDS] +// [#protodoc-title: EDS] // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing // services. From b649d10097dcd708f766a1058a5f63b96b24ab6e Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Wed, 24 Jan 2018 15:42:49 -0800 Subject: [PATCH 46/47] add github bug reference Signed-off-by: Kuat Yessenov --- envoy/service/discovery/v2/ads.proto | 2 +- envoy/service/discovery/v2/cds.proto | 2 +- envoy/service/discovery/v2/eds.proto | 2 +- envoy/service/discovery/v2/hds.proto | 2 +- envoy/service/discovery/v2/lds.proto | 2 +- envoy/service/discovery/v2/rds.proto | 2 +- envoy/service/discovery/v2/sds.proto | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/envoy/service/discovery/v2/ads.proto b/envoy/service/discovery/v2/ads.proto index 7f545ee08..7c71182b1 100644 --- a/envoy/service/discovery/v2/ads.proto +++ b/envoy/service/discovery/v2/ads.proto @@ -5,7 +5,7 @@ package envoy.service.discovery.v2; import "envoy/service/discovery/v2/common.proto"; // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing -// services. +// services: https://github.com/google/protobuf/issues/4221 message AdsDummy { } diff --git a/envoy/service/discovery/v2/cds.proto b/envoy/service/discovery/v2/cds.proto index e1686c50b..9125d189b 100644 --- a/envoy/service/discovery/v2/cds.proto +++ b/envoy/service/discovery/v2/cds.proto @@ -7,7 +7,7 @@ import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing -// services. +// services: https://github.com/google/protobuf/issues/4221 message CdsDummy { } diff --git a/envoy/service/discovery/v2/eds.proto b/envoy/service/discovery/v2/eds.proto index 30a55312c..783036dc1 100644 --- a/envoy/service/discovery/v2/eds.proto +++ b/envoy/service/discovery/v2/eds.proto @@ -12,7 +12,7 @@ import "validate/validate.proto"; // [#protodoc-title: EDS] // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing -// services. +// services: https://github.com/google/protobuf/issues/4221 message EdsDummy { } diff --git a/envoy/service/discovery/v2/hds.proto b/envoy/service/discovery/v2/hds.proto index eef6964a2..957f8a47a 100644 --- a/envoy/service/discovery/v2/hds.proto +++ b/envoy/service/discovery/v2/hds.proto @@ -10,7 +10,7 @@ import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing -// services. +// services: https://github.com/google/protobuf/issues/4221 message HdsDummy { } diff --git a/envoy/service/discovery/v2/lds.proto b/envoy/service/discovery/v2/lds.proto index e722ebebf..78712bd32 100644 --- a/envoy/service/discovery/v2/lds.proto +++ b/envoy/service/discovery/v2/lds.proto @@ -7,7 +7,7 @@ import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing -// services. +// services: https://github.com/google/protobuf/issues/4221 message LdsDummy { } diff --git a/envoy/service/discovery/v2/rds.proto b/envoy/service/discovery/v2/rds.proto index 7fb298f7e..6bdb86637 100644 --- a/envoy/service/discovery/v2/rds.proto +++ b/envoy/service/discovery/v2/rds.proto @@ -7,7 +7,7 @@ import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing -// services. +// services: https://github.com/google/protobuf/issues/4221 message RdsDummy { } diff --git a/envoy/service/discovery/v2/sds.proto b/envoy/service/discovery/v2/sds.proto index c29480f2e..e0dd74316 100644 --- a/envoy/service/discovery/v2/sds.proto +++ b/envoy/service/discovery/v2/sds.proto @@ -7,7 +7,7 @@ import "envoy/service/discovery/v2/common.proto"; import "google/api/annotations.proto"; // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing -// services. +// services: https://github.com/google/protobuf/issues/4221 message SdsDummy { } From bd258d0b4cc8473ccfc6bc889cff3160fe8cfae5 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Thu, 25 Jan 2018 10:36:09 -0800 Subject: [PATCH 47/47] merge fix Signed-off-by: Kuat Yessenov --- envoy/api/v2/filter/http/BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/envoy/api/v2/filter/http/BUILD b/envoy/api/v2/filter/http/BUILD index 1d54b2744..24bacf1b7 100644 --- a/envoy/api/v2/filter/http/BUILD +++ b/envoy/api/v2/filter/http/BUILD @@ -74,6 +74,7 @@ proto_library( ":buffer", ":ext_authz", ":fault", + ":gzip", ":health_check", ":lua", ":rate_limit",