-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
filter: add network filters to the upstreams #7503
Conversation
Allow network filters to be installed via cluster configuration, uses the same configuration syntax as listener filters. Added the following: - Cluster filter config: api/envoy/api/v2/cluster/filter.proto - Test to verify filters are applied: test/common/upstream/cluster_manager_impl_test.cc - Create filter factory and apply to new upstream connnections - Implement Server::Configuration::FactoryContext using contexts from TransportSocketFactoryContext NEEDS MINOR WORK: Some FactoryContext functions throw NOT_IMPLEMENTED, because some context objects are not obviously available to the upstream code. Needs attention from someone better versed in the architecture, see TODO(aconway) This does not prevent use of the feature, most contexts are available. This feature is used by project: https://github.com/alanconway/envoy-amqp. Signed-off-by: Alan Conway <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this going again. This is definitely the right direction, but a few high level comments to get started:
- We will needs docs, release notes, etc.
- I would like to see an integration test for this with a fake filter.
Thank you!
/wait
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
|
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks this is awesome. Some small comments.
/wait
for (ssize_t i = 0; i < filters.size(); i++) { | ||
const auto& proto_config = filters[i]; | ||
const std::string& string_name = proto_config.name(); | ||
ENVOY_LOG(debug, " upstream filter #{}:", i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this debug output look like? It's printed for every cluster so just want to make sure it's useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a sample:
[2019-07-25 22:02:21.833][26][info][config] [source/server/configuration_impl.cc:68] loading 1 cluster(s)
[2019-07-25 22:02:21.833][27][debug][grpc] [source/common/grpc/google_async_client_impl.cc:43] completionThread running
[2019-07-25 22:02:21.839][26][debug][upstream] [source/common/upstream/upstream_impl.cc:695] upstream filter #0:
[2019-07-25 22:02:21.839][26][debug][upstream] [source/common/upstream/upstream_impl.cc:696] name: envoy.upstream.polite
[2019-07-25 22:02:21.839][26][debug][upstream] [source/common/upstream/cluster_manager_impl.cc:838] adding TLS initial cluster cluster_0
[2019-07-25 22:02:21.840][26][debug][upstream] [source/common/upstream/upstream_impl.cc:845] initializing secondary cluster cluster_0 completed
Signed-off-by: Kuat Yessenov <[email protected]>
Thanks for the detailed review! Updated the PR to take the feedback into account. |
Signed-off-by: Kuat Yessenov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, great work. Just 1 small test request.
/wait
Signed-off-by: Kuat Yessenov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great with one tiny nit. Thanks!
/wait
@@ -44,6 +46,7 @@ class PoliteFilter : public Network::Filter, Logger::Loggable<Logger::Id::filter | |||
} | |||
|
|||
private: | |||
std::string greeting; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: const std::string greeting_;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry you are missing the trailing underscore.
/wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duh, thanks.
Signed-off-by: Kuat Yessenov <[email protected]>
Signed-off-by: Kuat Yessenov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description:
Resurrection of PR #6173.
Introduces network filters bound to the upstream clusters.
Risk Level: low
Testing: unit tests
Docs Changes: see #6173
Release Notes: add upstream network filters