Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: add handler for dumping out eds #11577

Merged
merged 32 commits into from
Jun 25, 2020
Merged
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
50d00dd
admin: add handler for dumping out eds
Rainton Jun 12, 2020
3e2771a
admin: add exist check before dumping out eds
Rainton Jun 15, 2020
f3acc0f
admin: update cluster_name in eds dump handler
Rainton Jun 15, 2020
821c3a8
server: complete eds dump handler in config dump
Rainton Jun 17, 2020
9092bc4
api: fix [#not-implemented-hide:] in /config_dump
Rainton Jun 17, 2020
69c3406
test: fix unit test and integration test of config dump
Rainton Jun 17, 2020
b0adffe
test: fix integration test for config_dump with eds
Rainton Jun 17, 2020
2a1e441
Merge branch 'feature' of https://github.com/Rainton/envoy into feature
Rainton Jun 17, 2020
2d434b0
server: fix format issue
Rainton Jun 17, 2020
385c4d6
Revert "server: fix format issue"
Rainton Jun 17, 2020
2a86785
server: fix format issue in BUILD
Rainton Jun 17, 2020
725c5e2
server: add pointer check to eds dump handler
Rainton Jun 17, 2020
4011428
server: add pointer check and unit test for eds config dump
Rainton Jun 18, 2020
5d17439
Kick CI
Rainton Jun 18, 2020
06ca891
server: fix admin test
Rainton Jun 18, 2020
5fa118a
test
Rainton Jun 19, 2020
f7833ed
test: add test ConfigDumpWithEndpointFiltersByResource
Rainton Jun 19, 2020
b731ac4
Kick CI
Rainton Jun 19, 2020
b8b5438
Revert "server: fix admin test"
Rainton Jun 20, 2020
139650c
fix test
Rainton Jun 20, 2020
148e66f
update param 'include_eds' and add docs
Rainton Jun 22, 2020
34a6604
fix std::move and index_eds in integration test
Rainton Jun 22, 2020
285f31f
add comment to test case
Rainton Jun 22, 2020
cf459e5
add helper method addHostInfo() to admin_test
Rainton Jun 23, 2020
37876f5
fix spelling problem in comment
Rainton Jun 23, 2020
c2f46f9
fix admin test
Rainton Jun 23, 2020
adfffa4
update docs, invert logic in dumpEndpointConfigs(), remove const on bool
Rainton Jun 24, 2020
db4e23a
Merge branch 'master' into feature
Rainton Jun 24, 2020
3723189
fix logic
Rainton Jun 24, 2020
6d31bcc
Kick CI
Rainton Jun 24, 2020
3a39461
flip the logic and drop the const
Rainton Jun 24, 2020
14938c8
Kick CI
Rainton Jun 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions api/envoy/admin/v3/config_dump.proto
Original file line number Diff line number Diff line change
@@ -30,9 +30,11 @@ message ConfigDump {
//
// * *bootstrap*: :ref:`BootstrapConfigDump <envoy_api_msg_admin.v3.BootstrapConfigDump>`
// * *clusters*: :ref:`ClustersConfigDump <envoy_api_msg_admin.v3.ClustersConfigDump>`
// * *endpoints*: :ref:`EndpointsConfigDump <envoy_api_msg_admin.v3.EndpointsConfigDump>`
// * *listeners*: :ref:`ListenersConfigDump <envoy_api_msg_admin.v3.ListenersConfigDump>`
// * *routes*: :ref:`RoutesConfigDump <envoy_api_msg_admin.v3.RoutesConfigDump>`
// [#not-implemented-hide:] * *endpoints*: :ref:`EndpointsConfigDump <envoy_api_msg_admin.v3.EndpointsConfigDump>`
//
// EDS Configuration will only be dumped by using parameter `?include_eds`
//
// You can filter output with the resource and mask query parameters.
// See :ref:`/config_dump?resource={} <operations_admin_interface_config_dump_by_resource>`,
@@ -348,29 +350,28 @@ message SecretsConfigDump {
repeated DynamicSecret dynamic_warming_secrets = 3;
}

// [#not-implemented-hide:]
// Envoy's EDS implementation *will* fill this message with all currently known endpoints. Endpoint
// Envoy's admin fill this message with all currently known endpoints. Endpoint
// configuration information can be used to recreate an Envoy configuration by populating all
// endpoints as static endpoints or by returning them in an EDS response.
message EndpointsConfigDump {
message StaticEndpointConfig {
// The endpoint config.
google.protobuf.Any endpoint_config = 1;

// The timestamp when the Endpoint was last updated.
// [#not-implemented-hide:] The timestamp when the Endpoint was last updated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think you should add support for these fields (version, last update), by adding additional tracking state to cluster manager. I think it's fine to do that as a next PR though, the existing PR is a good size for review.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about endpoint_stale_after?
I think this value is used once and then dropped when EDS is initialized. Should I add additional tracking state to it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting; I think the useful thing to track there would be how much time is remaining from when the config dump happens until the endpoint becomes stale. If it's really difficult to do, it's fine to leave as a TODO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I would like to add these support in next PR. For TTL, I'll try to add it, however, if it is difficult to achieve for now, maybe I'll leave it as a TODO and will try to solve it if there's still some time after I finish other milestones?

google.protobuf.Timestamp last_updated = 2;
}

message DynamicEndpointConfig {
// This is the per-resource version information. This version is currently taken from the
// [#not-implemented-hide:] This is the per-resource version information. This version is currently taken from the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is not implemented, probably the second sentence can be removed?

// :ref:`version_info <envoy_api_field_service.discovery.v3.DiscoveryResponse.version_info>` field at the time that
// the endpoint configuration was loaded.
string version_info = 1;

// The endpoint config.
google.protobuf.Any endpoint_config = 2;

// The timestamp when the Endpoint was last updated.
// [#not-implemented-hide:] The timestamp when the Endpoint was last updated.
google.protobuf.Timestamp last_updated = 3;
}

13 changes: 7 additions & 6 deletions api/envoy/admin/v4alpha/config_dump.proto
Original file line number Diff line number Diff line change
@@ -30,9 +30,11 @@ message ConfigDump {
//
// * *bootstrap*: :ref:`BootstrapConfigDump <envoy_api_msg_admin.v4alpha.BootstrapConfigDump>`
// * *clusters*: :ref:`ClustersConfigDump <envoy_api_msg_admin.v4alpha.ClustersConfigDump>`
// * *endpoints*: :ref:`EndpointsConfigDump <envoy_api_msg_admin.v4alpha.EndpointsConfigDump>`
// * *listeners*: :ref:`ListenersConfigDump <envoy_api_msg_admin.v4alpha.ListenersConfigDump>`
// * *routes*: :ref:`RoutesConfigDump <envoy_api_msg_admin.v4alpha.RoutesConfigDump>`
// [#not-implemented-hide:] * *endpoints*: :ref:`EndpointsConfigDump <envoy_api_msg_admin.v4alpha.EndpointsConfigDump>`
//
// EDS Configuration will only be dumped by using parameter `?include_eds`
//
// You can filter output with the resource and mask query parameters.
// See :ref:`/config_dump?resource={} <operations_admin_interface_config_dump_by_resource>`,
@@ -342,8 +344,7 @@ message SecretsConfigDump {
repeated DynamicSecret dynamic_warming_secrets = 3;
}

// [#not-implemented-hide:]
// Envoy's EDS implementation *will* fill this message with all currently known endpoints. Endpoint
// Envoy's admin fill this message with all currently known endpoints. Endpoint
// configuration information can be used to recreate an Envoy configuration by populating all
// endpoints as static endpoints or by returning them in an EDS response.
message EndpointsConfigDump {
@@ -356,23 +357,23 @@ message EndpointsConfigDump {
// The endpoint config.
google.protobuf.Any endpoint_config = 1;

// The timestamp when the Endpoint was last updated.
// [#not-implemented-hide:] The timestamp when the Endpoint was last updated.
google.protobuf.Timestamp last_updated = 2;
}

message DynamicEndpointConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.admin.v3.EndpointsConfigDump.DynamicEndpointConfig";

// This is the per-resource version information. This version is currently taken from the
// [#not-implemented-hide:] This is the per-resource version information. This version is currently taken from the
// :ref:`version_info <envoy_api_field_service.discovery.v3.DiscoveryResponse.version_info>` field at the time that
// the endpoint configuration was loaded.
string version_info = 1;

// The endpoint config.
google.protobuf.Any endpoint_config = 2;

// The timestamp when the Endpoint was last updated.
// [#not-implemented-hide:] The timestamp when the Endpoint was last updated.
google.protobuf.Timestamp last_updated = 3;
}

7 changes: 7 additions & 0 deletions docs/root/operations/admin.rst
Original file line number Diff line number Diff line change
@@ -137,6 +137,13 @@ modify different aspects of the server:
The underlying proto is marked v2alpha and hence its contents, including the JSON representation,
are not guaranteed to be stable.

.. _operations_admin_interface_config_dump_include_eds:
Rainton marked this conversation as resolved.
Show resolved Hide resolved

.. http:get:: /config_dump?include_eds

Dump currently loaded configuration including EDS. See the :ref:`response definition <envoy_v3_api_msg_admin.v3.EndpointsConfigDump>` for more
information.

.. _operations_admin_interface_config_dump_by_mask:

.. http:get:: /config_dump?mask={}
1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ New Features
* access loggers: extened specifier for FilterStateFormatter to output :ref:`unstructured log string <config_access_log_format_filter_state>`.
* access loggers: file access logger config added :ref:`log_format <envoy_v3_api_field_extensions.access_loggers.file.v3.FileAccessLog.log_format>`.
* access loggers: gRPC access logger config added added :ref:`API version <envoy_v3_api_field_extensions.access_loggers.grpc.v3.CommonGrpcAccessLogConfig.transport_api_version>` to explicitly set the version of gRPC service endpoint and message to be used.
* admin: added support for dumping EDS config at :ref:`/config_dump?include_eds <operations_admin_interface_config_dump_include_eds>`.
* aggregate cluster: make route :ref:`retry_priority <envoy_v3_api_field_config.route.v3.RetryPolicy.retry_priority>` predicates work with :ref:`this cluster type <envoy_v3_api_msg_extensions.clusters.aggregate.v3.ClusterConfig>`.
* build: official released binary is now built on Ubuntu 18.04, requires glibc >= 2.27.
* build: official released binary is now built with Clang 10.0.0.
13 changes: 7 additions & 6 deletions generated_api_shadow/envoy/admin/v3/config_dump.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions generated_api_shadow/envoy/admin/v4alpha/config_dump.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions source/server/admin/BUILD
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ envoy_cc_library(
"//source/extensions/access_loggers/file:file_access_log_lib",
"@envoy_api//envoy/admin/v3:pkg_cc_proto",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
"@envoy_api//envoy/config/endpoint/v3:pkg_cc_proto",
"@envoy_api//envoy/config/route/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg_cc_proto",
],
Loading