-
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
Lazy loading (on demand) for Routes, Clusters and Endpoints #2500
Comments
Here are my rough implementation notes for how I would go about doing this: Initially I would probably implement a new gRPC API for this purpose. I think you could use the existing CDS API roughly, but operate it yourself by running your own gRPC fetcher on the main thread (created during filter initialization -- there are singleton examples of this already including RDS itself). The API you want might actually be unary vs. streaming also. Roughly you want to fetch a cluster given a name, without any streaming. I think ultimately we can figure out how to fold this back into the main CDS API definition as well as internal Envoy implementation, but my recommendation is to initially implement out of band while we explore the design space. Implementing an API like this in Envoy is pretty trivial with the interfaces we have. The request flow looks something like:
A few implementation notes:
@htuch is very familiar with all of this and should be able to help while I'm out on leave. LMK if what I wrote above makes sense or if you want any additional specific pointers and I can provide them. |
Thank you for the notes, I'll get started on this. I do not plan to implement TTL though as part of this change. |
I'd add that code structure wise, I think it makes sense to have some kind of |
One middle ground from modifying xDS would be to establish an independent CDS channel, using the same streaming protocol, from the That way, you can keep the CDS protocol, but not use the existing CDS implementation which will be not work well as structured today. You can post independent updates from |
+1 to all of @htuch's comments above. |
I have an initial PR out: #2740 |
Initial partial implementation of cross thread cluster creation here: #3479 cc @ramaraochavali |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
This is nowadays typically being referred to as "on-demand". Hopefully writing on-demand or on demand in here will make this issue show up when searching issues for "on-demand". On-demand on-demand. |
@fredlas I've also updated the title, thanks. |
Signed-off-by: Piotr Sikora <[email protected]>
Does anyone have any info on the status of this? From the linked issue above it seems like there is already some support for a subset of RDS loading on demand. Is anyone working on or planning to work on extending that to work for clusters and/or endpoints? I got excited reading the Delta xDS docs recently:
I realise that's only talking about what the protocol allows not what Envoy actually does but the way it's worded doesn't make it very clear that this is aspirational still. Since I couldn't find a definitive answer on whether Envoy does actually support that already (other than this issue still being open I guess) I experimented and indeed I can't get either CDS or EDS to only subscribe when a request comes in for the resource when using delta xDS. Any info much appreciated! |
@banks we only have VHDS (for VirtualHosts in route configs) today. It would be fairly reasonable to add on-demand CDS (and it's done implicitly by at least one filter but not generically). This is because we already have all the hooks in place to support this. This would then imply on-demand EDS loading. This issue remains in help wanted state. |
Any updates for on-demand EDS loading now? |
I don't think there has been any public work on on-demand EDS. |
cc lambda@ |
cc @lambdai |
Hi, I'd like to take the part of lazy (on-demand) loading of clusters. Will write a document and share here and on slack. |
@krnowak SGTM. At a high level we need a filter that can hold requests (for HTTP) or connections (for network) and perform a cluster lookup and wait on various callbacks until it's complete, times out, or fails. All of the plumbing exists it just needs to be put together in OSS. Would love to see this happen. |
@mattklein123: My idea was to extend envoy.filters.http.on_demand to perform the lookup and waiting. And extend RouteAction with a "odcds" field containing "SourceConfig". But I think I'll flesh it all out in the design document. Will share it here ASAP. |
This is being actively worked on. @krnowak can you make sure this issue gets closed when the on demand work is fully merged and documented? Thank you! |
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 #2500 Signed-off-by: Krzesimir Nowak <[email protected]>
) 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 <[email protected]>
For requests that do not have routes, I would need to write a filter that can send xDS queries to get a Route Added with the associated configuration (cluster def and endpoints).
The use case is for deployments with a very high cluster cardinality and failing the request is not an option.
I do not know if this should be an envoy feature but it does not seem like it can be implemented as a custom filter as there are not xDS headers in include/envoy.
Any pointers on how to achieve this would be greatly appreciated.
cc @mattklein123 @htuch
The text was updated successfully, but these errors were encountered: