filter: add network filters to the upstreams#7503
filter: add network filters to the upstreams#7503mattklein123 merged 34 commits intoenvoyproxy:masterfrom
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 <aconway@redhat.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
mattklein123
left a comment
There was a problem hiding this comment.
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 <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
|
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
mattklein123
left a comment
There was a problem hiding this comment.
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.
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.
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 <kuat@google.com>
|
Thanks for the detailed review! Updated the PR to take the feedback into account. |
Signed-off-by: Kuat Yessenov <kuat@google.com>
mattklein123
left a comment
There was a problem hiding this comment.
Nice, great work. Just 1 small test request.
/wait
mattklein123
left a comment
There was a problem hiding this comment.
Looks great with one tiny nit. Thanks!
/wait
| } | ||
|
|
||
| private: | ||
| std::string greeting; |
There was a problem hiding this comment.
nit: const std::string greeting_;
There was a problem hiding this comment.
Sorry you are missing the trailing underscore.
/wait
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