-
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
SNI-based dynamic forward proxy filter #10448
SNI-based dynamic forward proxy filter #10448
Conversation
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[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.
API review..
...nvoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto
Outdated
Show resolved
Hide resolved
...nvoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto
Outdated
Show resolved
Hide resolved
...nvoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto
Outdated
Show resolved
Hide resolved
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
…rd_proxy Signed-off-by: Lizan Zhou <[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.
First pass of comments!
...nvoy/config/filter/network/sni_dynamic_forward_proxy/v2alpha/sni_dynamic_forward_proxy.proto
Outdated
Show resolved
Hide resolved
source/extensions/filters/network/sni_dynamic_forward_proxy/BUILD
Outdated
Show resolved
Hide resolved
source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc
Outdated
Show resolved
Hide resolved
test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc
Show resolved
Hide resolved
test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc
Outdated
Show resolved
Hide resolved
test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc
Outdated
Show resolved
Hide resolved
test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc
Outdated
Show resolved
Hide resolved
/wait |
…rd_proxy Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
/lgtm api |
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.
mostly lgtm assigning to @mattklein123 so he can take a pass.
source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc
Show resolved
Hide resolved
test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Lizan Zhou <[email protected]>
…rd_proxy Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[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 super cool. Just a few small comments.
/wait
[(validate.rules).message = {required: true}]; | ||
|
||
oneof port_specifier { | ||
// The port number to connect to the upstream. |
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.
Is this flexible enough? Might we need different ports for different hosts at some point? Is that why you did the oneof?
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.
Yes that's the reason we have oneof here as pointed out by @htuch. SNI itself dosn't contain port number but we can support original dst port etc.
source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc
Outdated
Show resolved
Hide resolved
source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc
Show resolved
Hide resolved
test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_integration_test.cc
Show resolved
Hide resolved
Please merge master to pick up #10672. We no longer accept changes to v2 (without explicit exception), so any API modifications should happen in v3. If this PR is adding a new proto, please follow the updated instructions in https://github.com/envoyproxy/envoy/blob/master/api/STYLE.md#adding-an-extension-configuration-to-the-api. |
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
…rd_proxy Signed-off-by: Lizan Zhou <[email protected]>
…rd_proxy Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[email protected]>
…rd_proxy Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou <[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 LGTM with 1 question. Can you also merge master?
/wait
return Network::FilterStatus::Continue; | ||
} | ||
|
||
// TODO(lizan): implement circuit breaker in SNI dynamic forward proxy like it is in HTTP: |
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.
Is there an reason not to do this now since it's pretty easy? Or can this be done as an immediate follow up? This is going to get used and this is a pretty big potential issue I think?
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.
Unlike HTTP in network filters we don't have immediate access to cluster info through filter callbacks. There are plumbings need to happen there.
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.
OK sounds good.
…rd_proxy Signed-off-by: Lizan Zhou <[email protected]>
Signed-off-by: Lizan Zhou [email protected]
Description:
Implement a network filter to do DNS resolution based on SNI. So a TCP connection can be routed to a dynamic_forward_proxy cluster based on that.
Risk Level: Low (extension only)
Testing: manual, unit test, integration test.
Docs Changes: protodoc
Release Notes: Added
Fixes #9916