-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Feature : Listener Filter Chain Discovery Service #23096
Conversation
Hi @rakeshdatta, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Assigning over to @htuch @adisuissa for first pass on API and general feature overview. Thank you! |
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 working on this!
I think DCO needs to be fixed.
High level question - what are the warming constraints this xDS service require?
message Fcds{ | ||
string fcds_name = 1 [(validate.rules).string.min_len = 1]; | ||
envoy.config.core.v3.ConfigSource config_source = 2 [(validate.rules).message.required = true]; | ||
} |
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.
This should probably be called ListenerFCDS, to differentiate between listener and http filter chains.
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.
Sure!
@@ -138,6 +139,9 @@ message Listener { | |||
// :ref:`FAQ entry <faq_how_to_setup_sni>`. | |||
repeated FilterChain filter_chains = 3; | |||
|
|||
// FCDS: Filter Chain Discovery Service config block. filter_chains and fcds are mutually exclusive | |||
Fcds fcds = 34; |
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.
I think this needs to be promoted to oneof with filter_chains
, and clearly comment that they are mutual exclusive.
Also, is this going to return a single filter-chain? Maybe it should return a glob collection of filter-chains.
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.
I tried oneof when I started implementing this. Had some issues that I can't recall. Will give it another try and update this PR as needed.
FCDS block would encompass a collection of filter chains., which are under a listener Plz refer to the yaml samples in the PR description.
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.
I tried oneof when I started implementing this. Had some issues that I can't recall. Will give it another try and update this PR as needed.
Changing to oneof breaks backwards compatibility. This should be promoted in future major version, and clearly stated in the comments.
FCDS block would encompass a collection of filter chains., which are under a listener Plz refer to the yaml samples in the PR description.
Looking here it implies that the returned type is a single FilterChain object for each request, not multiple ones. I think this should be a Glob collection and return a list of such elements.
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.
Hi @adisuissa
I gave it a thought. I want to represent a single resource as a filter chain, not a list of filter chains. I think the name that I added in the proto, created confusion.
- For file inotify, much like LDS, I wanted a single listener to point to one FCDS file which has a list of filter chains resources
- Also, for GRPC, I want a listener to be able to subscribe to all(*) or a specific list of filter chains. The Control plane would respond back with a list of resources, where each resource is a filter chain.
In that case, much like LDS proto, I believe the resource type not being a list is fine. Is my understanding correct?
However, the challenge here is, how could a listener subscribe to a specific list of filter chain updates. Seems like thats a challenge that glob collection will solve? Is that the reason you suggested using glob collection?
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.
Changing to oneof breaks backwards compatibility. This should be promoted in future major version, and clearly stated in the comments.
@adisuissa - Can you please show an example how to promote a proto change to a "Future major version"?
returns (stream discovery.v3.DiscoveryResponse) { | ||
} | ||
|
||
rpc DeltaFilterChains(stream discovery.v3.DeltaDiscoveryRequest) |
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.
Not yet implemented in this PR.
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 @adisuissa Delta is not implemented in this PR. I am working on it and will submit using a subsequent PR. Hope that works.
@@ -358,3 +362,8 @@ message Listener { | |||
// :ref:`global_downstream_max_connections <config_overload_manager_limiting_connections>`. | |||
bool ignore_global_conn_limit = 31; | |||
} | |||
|
|||
message Fcds{ | |||
string fcds_name = 1 [(validate.rules).string.min_len = 1]; |
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.
Every listener filter chain has a name so one can think of a listener as a collection of filter chains. Is this name referring to the collection name?
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.
That's right @kyessenov. It is referring to the name of the collection of listener filter chains under a listener. It is not used in the code anywhere today though. It's just a name to refer to.
Can I have multiple of those such collections of listener filter-chains under the same listener? No.
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 explaining. If two collections share a filter chain, then at the transport level, do we still have to get duplicate resources <fcds_name/filter_chain.name>
if two listeners share a filter chain? I wonder if there is a way to have a global subscription instead of a per-listener subscription model.
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 explaining. If two collections share a filter chain, then at the transport level, do we still have to get duplicate resources
<fcds_name/filter_chain.name>
if two listeners share a filter chain? I wonder if there is a way to have a global subscription instead of a per-listener subscription model.
Somewhat dependent on the use-case, but if you think of ADS, then there should be a single subscription to the management server, and it will notify the multiple "watchers".
/wait |
I am working on the comments plus the draining logic. Will be back shortly. Thanks for reviewing the PR. |
// associated HTTP connection manager filters) to use different route | ||
// configurations. Each listener will bind its HTTP connection manager filter to | ||
// a route table via this identifier. | ||
service FcdsDiscoveryService { |
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.
Do we actually need this RPC service? I think we've agreed to move the xDS API to a model where new resource types can be added and used via ADS without having to add a new RPC service for each one.
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.
Hi, @markdroth Thanks for the comment. This is new to me; I was not aware. As I am not sure about this, tagging @adisuissa to comment.
Also, wondering what is the downside of having new RPC APIs for this new XDS service. In case we don't have this, can u help me understand how we hook the FCDS back-end logic to the ADS RPC APIs?
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.
Hi @markdroth @adisuissa Plz suggest if it is still acceptable to have these separate RPC endpoint for FCDS.
P.S. I resolved couple of bugs and handling another one on the draining (only the filter chains, without recreating a new listener) sequence now. I am testing off the file inotify way now, and should get to the grpc transport next.
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.
From the wire protocol perspective, ADS already supports this; all you need to do is use the new resource type in the ADS stream.
I don't know how this would work from the perspective of Envoy's existing ADS implementation, although I would expect that this would get much easier once Envoy implements the xDS caching layer described in #13009. @adisuissa can advise further as to how to actually implement this today.
789b5d1
to
d8d1085
Compare
Signed-off-by: Rakesh Datta <[email protected]>
0eb76c6
to
87757d7
Compare
Signed-off-by: Rakesh Datta <[email protected]> Signed-off-by: Rakesh Datta <[email protected]>
87757d7
to
733fc2b
Compare
@rakeshdatta thanks for all this. Can you take a look at https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md and in particular the stanza starting with "Once your PR is under review, please do not rebase it. " Thank you! Looks like CI is not healthy right now. /wait |
Hi @jmarantz, Thank you for sharing! I am aware of the rebasing requirement; however, I was actually trying to fix the DCO in the very first commit by rebasing the technique. That is not helping though. In case there is an easier way to the fix the DCO if the very first commit, could u plz suggest? Thanks again! |
I know that it's possible to "repair" a PR with git magic (and losing PR comments in the process). But usually I find it easiest to simply open a new PR, and reference the old one from it. That way any comments in the old PR are not lost. Maybe the most important thing, though, as you start to contribute to Envoy, is to set up a github hook to automatically add the signed-by line. There are instructions in https://github.com/envoyproxy/envoy/blob/main/DEVELOPER.md |
/wait |
This pull request has been automatically marked as stale because it has not had activity in the last 30 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! |
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Commit Message: Feature: Listener Filter Chain Discovery Service (SoTW)
Additional Description:
Representing tenants as filter-chains in envoy, its essential to be able to dynamically and independently load the tenant (filter chain) configs. To achieve that, this feature introduces anothe xDS called Filter Chain Discovery Service, which allows the filter chains inside a listener to be discovered dynamically.
This allows a tenant config to be added, deleted and modified on the fly, without impacting other tenant configs.
This is also an Implementation for the ask here: (#4540)
This feature would allow dynamic config update of filter chains.
Main envoy config yaml:
fcds (dynamic) config yaml:
Risk Level: High
Testing: Locally tested with Inotify-based config updates.
Pending work: Test and implement filter-chain level draining
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]