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

Conversation

Rainton
Copy link
Contributor

@Rainton Rainton commented Jun 12, 2020

Commit Message:
/config_dump API now supports dumping out EDS while using parameter ?include_eds
Add help method dumpEndpointConfigs() to dump out EDS in /config_dump by calling this method in the handler handlerConfigDump()
This will dump out envoy::admin::v3::EndpointsConfigDump by generating envoy::config::endpoint::v3::ClusterLoadAssignment based on data stored in server_.clusterManager().clusters()

Missing Field:

Additional Description:
Risk Level: Medium
Testing: add unit test, integration test
Docs Changes: operations_admin_interface
Release Notes: N/A

Part of fixing #3362

/cc @fuqianggao @alexburnos

Signed-off-by: Yutong Li [email protected]

@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.
CC @envoyproxy/api-watchers: FYI only for changes made to api/.

🐱

Caused by: #11577 was opened by Rainton.

see: more, trace.

@ramaraochavali
Copy link
Contributor

Should we add additional parameter like ?includeEds and dump this only when it is there?

@Rainton
Copy link
Contributor Author

Rainton commented Jun 15, 2020

Should we add additional parameter like ?includeEds and dump this only when it is there?

For now, just like other xDS, it is implemented as automatically dumping out.
Maybe I can ask @htuch if it is necessary to add this parameter.

for (const auto& key_callback_pair : config_tracker_.getCallbacksMap()) {
Envoy::Server::ConfigTracker::CbsMap callbacks_map = std::move(config_tracker_.getCallbacksMap());
if (!server_.clusterManager().clusters().empty()) {
callbacks_map.emplace("endpoint", [this] { return dumpEndpointConfigs(); });
Copy link
Contributor

@fuqianggao fuqianggao Jun 15, 2020

Choose a reason for hiding this comment

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

since dumpEndpontConfigs is not fully completed, should we defer this and changes in addResourceToDump to the next PR? Otherwise, anyone doing config dump will get incomplete EDS. @htuch WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's fair enough. Or you could use a runtime feature flag to control this behavior. https://github.com/envoyproxy/envoy/blob/master/CONTRIBUTING.md#runtime-guarding. Might be overkill.

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

It might be worth just doing the full EDS dump support in a single PR. In general, small PRs are good, but it's hard to see how this is going to be tested etc. until we have the more complete implementation.

for (const auto& key_callback_pair : config_tracker_.getCallbacksMap()) {
Envoy::Server::ConfigTracker::CbsMap callbacks_map = std::move(config_tracker_.getCallbacksMap());
if (!server_.clusterManager().clusters().empty()) {
callbacks_map.emplace("endpoint", [this] { return dumpEndpointConfigs(); });
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's fair enough. Or you could use a runtime feature flag to control this behavior. https://github.com/envoyproxy/envoy/blob/master/CONTRIBUTING.md#runtime-guarding. Might be overkill.

@htuch
Copy link
Member

htuch commented Jun 16, 2020

@Rainton the suggestion from @ramaraochavali is reasonable, since this might dump a ton of data, so being able to make it opt-in is good.

@Rainton Rainton requested a review from dio as a code owner June 17, 2020 18:06
@Rainton
Copy link
Contributor Author

Rainton commented Jun 18, 2020

/retest

@repokitteh-read-only
Copy link

🐴 hold your horses - no failures detected, yet.

🐱

Caused by: a #11577 (comment) was created by @Rainton.

see: more, trace.

Rainton added 2 commits June 18, 2020 06:29
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
@Rainton
Copy link
Contributor Author

Rainton commented Jun 18, 2020

@htuch I've updated a more complete version. For now, EDS config can be dumped completely except the missing fields with the parameter ?includeEds.

As mentioned in the description, these fields are missing in the ClusterManager. Will it be worth adding track to them?

@Rainton Rainton requested a review from htuch June 18, 2020 18:16
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?

source/server/admin/admin.cc Show resolved Hide resolved
test/server/admin/admin_test.cc Outdated Show resolved Hide resolved
param, rename shouldIncludeEdsInDump()

Signed-off-by: Yutong Li <[email protected]>
@Rainton Rainton reopened this Jun 24, 2020
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM modulo remaining nits.

source/server/admin/admin.h Outdated Show resolved Hide resolved
Rainton added 2 commits June 24, 2020 23:19
Signed-off-by: Yutong Li <[email protected]>
@Rainton
Copy link
Contributor Author

Rainton commented Jun 25, 2020

/retest

@repokitteh-read-only
Copy link

🐴 hold your horses - no failures detected, yet.

🐱

Caused by: a #11577 (comment) was created by @Rainton.

see: more, trace.

Signed-off-by: Yutong Li <[email protected]>
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@htuch htuch merged commit 3cec62a into envoyproxy:master Jun 25, 2020
songhu pushed a commit to songhu/envoy that referenced this pull request Jun 25, 2020
EDS config has been added to config_dump in envoyproxy#11425 and implemented in envoyproxy#11577 .

Risk Level: Low
Testing: N/A

Signed-off-by: Yutong Li <[email protected]>
songhu pushed a commit to songhu/envoy that referenced this pull request Jun 25, 2020
/config_dump API now supports dumping out EDS while using parameter ?include_eds
Add help method dumpEndpointConfigs() to dump out EDS in /config_dump by calling this method in the handler handlerConfigDump()
This will dump out envoy::admin::v3::EndpointsConfigDump by generating envoy::config::endpoint::v3::ClusterLoadAssignment based on data stored in server_.clusterManager().clusters()

Missing Field:

- ClusterLoadAssignment
  - Policy
    - endpoint_stale_after
- StaticEndpointConfig
  - last_updated
- DynamicEndpointConfig
  - version_info
  - last_updated

Risk Level: Medium
Testing: add unit test, integration test
Docs Changes: operations_admin_interface
Release Notes: N/A

Part of fixing envoyproxy#3362

Signed-off-by: Yutong Li <[email protected]>
yashwant121 pushed a commit to yashwant121/envoy that referenced this pull request Jul 24, 2020
EDS config has been added to config_dump in envoyproxy#11425 and implemented in envoyproxy#11577 .

Risk Level: Low
Testing: N/A

Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: yashwant121 <[email protected]>
yashwant121 pushed a commit to yashwant121/envoy that referenced this pull request Jul 24, 2020
/config_dump API now supports dumping out EDS while using parameter ?include_eds
Add help method dumpEndpointConfigs() to dump out EDS in /config_dump by calling this method in the handler handlerConfigDump()
This will dump out envoy::admin::v3::EndpointsConfigDump by generating envoy::config::endpoint::v3::ClusterLoadAssignment based on data stored in server_.clusterManager().clusters()

Missing Field:

- ClusterLoadAssignment
  - Policy
    - endpoint_stale_after
- StaticEndpointConfig
  - last_updated
- DynamicEndpointConfig
  - version_info
  - last_updated

Risk Level: Medium
Testing: add unit test, integration test
Docs Changes: operations_admin_interface
Release Notes: N/A

Part of fixing envoyproxy#3362

Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: yashwant121 <[email protected]>
htuch pushed a commit that referenced this pull request Aug 12, 2020
Added an node field to csds request to identify the CSDS client to the CSDS server, and removed the [#not-implemented-hide:] for the endpoint_config since it has been implemented in #11577

Risk Level: Low
Testing: N/A
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Yutong Li <[email protected]>
@htuch htuch mentioned this pull request Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants