Use on-demand cluster discovery in on-demand extension#20065
Use on-demand cluster discovery in on-demand extension#20065htuch merged 59 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Krzesimir Nowak <krzesimir@kinvolk.io>
Signed-off-by: Krzesimir Nowak <krzesimir@kinvolk.io>
Signed-off-by: Krzesimir Nowak <krzesimir@kinvolk.io>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
adisuissa
left a comment
There was a problem hiding this comment.
Thanks for working on this, very exciting!
Took a first pass on the code, and left a few comments.
| // service. If not specified, the on-demand cluster discovery will | ||
| // be disabled. When it's specified, the filter will pause a request |
There was a problem hiding this comment.
Do you think that this field should be required?
IMO if a config update contains the OnDemand extension, then it is meant to be used (and enabled).
Unless if there are scenarios where a dummy placeholder is wanted.
There was a problem hiding this comment.
I think that before the on-demand plugin was only talking to RDS if there wasn't any matching route. Not sure if we want to break this by requiring the odcds_config to be defined.
| // service. If not specified, the on-demand cluster discovery will | ||
| // be disabled. When it's specified, the filter will pause a request |
| Upstream::OdCdsApiHandlePtr createOdCdsApi(const ProtoConfig& proto_config, | ||
| Upstream::ClusterManager& cm, | ||
| ProtobufMessage::ValidationVisitor& validation_visitor) { | ||
| if (!proto_config.has_odcds_config() && proto_config.resources_locator().empty()) { |
There was a problem hiding this comment.
IIRC the config-source is required no matter if resources-locator is set or not.
@htuch to correct me if I'm wrong.
There was a problem hiding this comment.
Sorry, my confusion here. I was reading this as resource-name instead of locator.
| filter_iteration_state_ = Http::FilterHeadersStatus::StopIteration; | ||
| auto callback = std::make_unique<Upstream::ClusterDiscoveryCallback>( | ||
| [this](Upstream::ClusterDiscoveryStatus cluster_status) { | ||
| onClusterDiscoveryCompletion(cluster_status); |
There was a problem hiding this comment.
Could there be a case where the filter is destroyed before the callback is invoked?
What I'm not certain about is whether we'll get an invocation of onClusterDiscoveryCompletion on a destroyed filter.
There was a problem hiding this comment.
If the filter is destroyed, then cluster_discovery_handle_ is going to be destroyed too, which will unregister and destroy the callback.
|
/wait |
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
|
/wait |
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
|
@adisuissa could you please take a look when you get a moment? Thanks! |
htuch
left a comment
There was a problem hiding this comment.
LGTM modulo remaining comments.
/wait
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
|
/retest |
|
Retrying Azure Pipelines: |
|
CI is green, so it's ready for review. |
|
Thanks again, @krnowak -- fantastic work, I really appreciate it. |
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
|
@jamesmulcahy: Thank you for the kind words. :) I updated the PR again, this time no code changes (besides another merge from the main branch), but the CI needs to run again. I found out that there are some extra docs for on_demand extension, so I tried my hand at updating them a bit. I'd be grateful for a review of the wording. Thanks! |
htuch
left a comment
There was a problem hiding this comment.
LGTM with two nits (look forward to getting this mergred)
docs/root/configuration/http/http_filters/on_demand_updates_filter.rst
Outdated
Show resolved
Hide resolved
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
) This adds an odcds_config field to the extension's config, and also allows the extension to be configured per-route. As it stands, it currently works only with routes using cluster-header config. Risk Level: Medium, extending one extension in an opt-in way. Testing: Added unit tests and integration tests. Fixes envoyproxy#2500 Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
Commit Message:
This adds an odcds_config field to the extension's config, and also allows the extension to be configured per-route. As it stands, it currently works only with routes using cluster-header config.
Additional Description:
Risk Level:
Medium, extending one extension in an opt-in way.
Testing:
Added unit tests and integration tests.
Docs Changes:
Not sure.
Release Notes:
Extended on-demand extension with on-demand cluster discovery functionality.
Platform Specific Features:
None.
[Optional Runtime guard:]
Fixes #2500
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]
CC: @jamesmulcahy