Incremental MCP for SyntheticServiceEntries#12276
Conversation
|
This pull request has been automatically marked as stale because it has not had activity in the last 2 weeks. It will be closed in 30 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! |
|
There are other two questions left:
|
@hzxuzhonghu I don't usually squash my PRs, but this one has been in flight for a very long time and there is always a conflict when I make a commit since it touches many files, having to squash them makes rebasing easier. |
| for _, h := range se.Hosts { | ||
| for _, svcPort := range se.Ports { | ||
| // add not ready endpoint | ||
| out = append(out, d.notReadyServiceInstance(se, svcPort, conf, h, notReadyIP, notReadyPort)) |
There was a problem hiding this comment.
Thisis not right, for example, if 192.168.1.1:8080 and 192.168.1.1:8081 are not ready. What's the output
There was a problem hiding this comment.
Can you elaborate a bit more? I have a test case for this case specifically. The expected out put would be
// NetworkEndpoint(endpoint{Address:192.168.1.1, Port:8080, servicePort: &{http-port 80 http}} service:{Hostname: svc.example2.com})
// NetworkEndpoint(endpoint{Address:192.168.1.1, Port:8081, servicePort: &{http-port 80 http}} service:{Hostname: svc.example2.com})
is that not correct?
The NotReadyEndpoint discovery handles notReady annotations that are received via galley and it exposes them to EDS so the corresponding updates can be sent out to envoy. This is a case that we were not handling previously in Pilot over MCP. |
I could not find its use. |
|
It merged ... Wooh-hoo! :) Thanks @Nino-K! |
|
Two questions:
|
what schemas are you referring to?
You'd either have to implement incremental MCP on your server or use Galley. |
|
|
@seflerZ right, Pilot is only currently using incremental for the synthetic service entries. That could change, but may be obviated by the move to |
|
Is this feature released? I don't see its introduction in recent releases. |
|
I have read the code of this PR. I found in this incremental push of synthetic service entries mode Pilot replaces all endpoints of a service, not just adds/removes endpoints in the service. Say Pilot has data: Am I understanding it right? |
|
@nkorange this will be in the 1.4 release.
That wouldn't be the desired result, although I'm not sure our test currently verifies how pilot handles endpoints from different service registries for the same service. @Nino-K have you tested that by any chance? We're going to want to make sure that works properly. |
|
@nmittler Does 1.4.0-beta contain this feature? |
|
@nkorange yes, I believe this feature will be available in 1.4, however it is turned off by default. |
|
@nmittler the implementation of incremental MCP in syntheticServicController currently only focuses on the removal of the configs that received while incremental flag is set and sending updates incrementally to envoy (EDSUpdate vs ConfigUpdate). The reason I have not invested so much time in incremental updates from the source server is currently galley never forwards incremental payload to Pilot, although the snapshots are configured to support incremental which prevented me from testing this in the integration test. I will go ahead and create an issue to investigate this further. |
@Nino-K So this is expected? And Can I download the 1.4.0-beta.1 to test this incremental feature? The master branch seems not stable. |
@nkorange the behaviour that you are expecting is not part of incremental MCP specification. Currently incremental MCP operates at the resource level and not the sub-resources. |
OK. I see, thanks. |
|
@Nino-K I don't think it's much practical if it doesn't support incremental on sub resources and may lead to misusing because the there is not comment or flag to tell that. How do you think about implementing the incremental updating on sub-resources? We have very large scale clusters and endpoints. We appreciate incremental updating on every resource and sub resources. We can join in and contribute. |
@seflerZ for large clusters with lots of endpoints you are better off to send the full state of the resource as oppose to just updated sub-resources (delta). Here is why incremental updates with full state might be more efficient: 1) pilot would ultimately send the full resource and not only updated part to envoy via EDSUpdate, so what benefit is there to just send an incremental update with only changes in the sub-resource? 2) having pilot to apply the delta on the sub-resources and computing the diff on the resources might be more expensive (in terms of operation) on a large scale cluster with lots of endpoints, I think it would be better to defer that to the config source server to compile the new resource with updated sub-resource (something like what galley does today). Having said all that, it might be worth to bring this up in the community meeting to see what others think, also I think @ayj might have more insights on this too. |
|
ServiceEntry is roughly analogous with the k8s endpoint API. Both contain a list of endpoints for a specific host/service. k8s introduced EndpointSlice as more scalable and extensible alternative. We might consider something similar if/when performance becomes a problem. Taken to the extreme one could imagine an API which represents individual endpoint/hosts per resource. |
|
We will be adding support for EndpointSlice as well Anyways, can't you shard your ServiceEntries already? If you have multiple STATIC service entries they will be merged |
|
@Nino-K For point 1: Pilot would ultimately send the full resource through EDSUpdate() For point 2: Having pilot to apply/compute the delta might be expensive BTW: Should I open a new issue to discuss the incremental updates on sub-resources? @ayj @howardjohn We've a triditional microservice registry named Nacos which holds 10 GiB of services and endpoints. Usally a service may have 1000+ endpoints and 100+ service dependencies. Now we want to move to and join in Istio ecosystem but most of our services are not K8s ready yet. So we sync our services and endpoints to Pilot through MCP or Pilot registry plugin. Currently we're suffering from low performance on both Nacos-Pilot synchronization and Pilot-Envoy data pushing. |
|
I'm not familiar with Pilot's incremental EDS support. @hzxuzhonghu may know more. EndpointSlice should be compatible with MCP though its not plumbed through yet. The config server (e.g. galley, Nacos) is responsible for managing the grouping of endpoints over time. |
@seflerZ I think it would make more sense to create an issue to discuss this further, thanks! |
|
|
|
Thanks, everyone. I've opened a proposal to discuss this. |
This PR introduces the following:
serviceVersion&endpointsVersion) received via MCP (only Galley) . These annotations are used to determine partial update or full config update to envoy.NotReadyEndpointsannotations.NotReadyEndpointsto aggregated controller