From ed9e1a11f286eed0b69650e626f8f84d9d5c3dbd Mon Sep 17 00:00:00 2001 From: James Sedgwick Date: Thu, 15 Mar 2018 16:56:25 -0400 Subject: [PATCH] [envoy/admin] Scaffolding for structured admin and config_dump endpoint (#532) See envoyproxy/envoy#2771 for context I will add documentation once the interfaces and placement of these things is settled. Current location (new admin package) was agreed upon as a good start with @htuch but i don't feel strongly about that or naming. Signed-off-by: James Sedgwick --- envoy/admin/v2/BUILD | 12 +++++++++++ envoy/admin/v2/config_dump.proto | 35 ++++++++++++++++++++++++++++++++ envoy/api/v2/BUILD | 1 + 3 files changed, 48 insertions(+) create mode 100644 envoy/admin/v2/BUILD create mode 100644 envoy/admin/v2/config_dump.proto diff --git a/envoy/admin/v2/BUILD b/envoy/admin/v2/BUILD new file mode 100644 index 00000000..0e1ab5f2 --- /dev/null +++ b/envoy/admin/v2/BUILD @@ -0,0 +1,12 @@ +load("//bazel:api_build_system.bzl", "api_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "config_dump", + srcs = ["config_dump.proto"], + visibility = ["//visibility:public"], + deps = [ + "//envoy/api/v2:rds", + ], +) diff --git a/envoy/admin/v2/config_dump.proto b/envoy/admin/v2/config_dump.proto new file mode 100644 index 00000000..5ed8ee0b --- /dev/null +++ b/envoy/admin/v2/config_dump.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package envoy.admin.v2; + +import "google/protobuf/any.proto"; +import "envoy/api/v2/rds.proto"; + +import "gogoproto/gogo.proto"; + +// [#protodoc-title: ConfigDump] +// [#proto-status: draft] + +// The /config_dump admin endpoint uses this wrapper message to maintain and serve arbitrary +// configuration information from any component in Envoy. +// TODO(jsedgwick) In the future, we may want to formalize this further with an RPC for config_dump, +// and perhaps even with an RPC per config type. That strategy across all endpoints will allow for +// more flexibility w.r.t. protocol, serialization, parameters, etc. +message ConfigDump { + // This map is serialized and dumped in its entirety at the /config_dump endpoint. + // + // Keys should be a short descriptor of the config object they map to. For example, envoy's HTTP + // routing subsystem might use "routes" as the key for its config, for which it uses the message + // RouteConfigDump as defined below. In the future, the key will also be used to filter the output + // of the /config_dump endpoint. + map configs = 1 [(gogoproto.nullable) = false]; +} + +// Envoy's RDS implementation fills this message with all currently loaded routes, as described by +// their RouteConnfiguration objects. Static routes configured in the bootstrap configuration are +// separated from those configured dynamically via RDS. This message is available at the +// /config_dump admin endpoint. +message RouteConfigDump { + repeated envoy.api.v2.RouteConfiguration static_route_configs = 1 [(gogoproto.nullable) = false]; + repeated envoy.api.v2.RouteConfiguration dynamic_route_configs = 2 [(gogoproto.nullable) = false]; +} diff --git a/envoy/api/v2/BUILD b/envoy/api/v2/BUILD index 10d8ddc2..42a89c91 100644 --- a/envoy/api/v2/BUILD +++ b/envoy/api/v2/BUILD @@ -8,6 +8,7 @@ licenses(["notice"]) # Apache 2 package_group( name = "friends", packages = [ + "//envoy/admin/...", "//envoy/api/v2", "//envoy/config/...", "//envoy/service/...",