Description
Title: Support retaining clusters when still referenced by route/listeners
Description:
Currently, our ingress's gets clusters for all services we know about. This is often extremely wasteful, since most of them are not referenced by any routes.
We added an option to filter these out, but started seeing some issues when
- Initial state: route /foo -> cluster foo-v1
- Desired end state: route /foo -> cluster foo-v2, remove foo-v1
In practice, there is a gap between the cluster being removed and the route being updated. This results in a period of downtime on route updates.
Our ideal would be that envoy doesn't delete the cluster while a route still references it.
The alternative would be to solve it in the control plane. But that seems pretty hard... I guess we would need to realize foo-v1 is referenced by a route and keep it around until the route is updated.
This may be ~impossible for us (until we move to Delta XDS, anyways), since "keep it around" with sotw means we literally need a copy of it in the control plane and we don't store config after we send it, nor can we generate it again.
And to know its updated we need to send the route and wait for the ack I guess? Which also introduces a ton of complexity to the control plane and requires it to be stateful.
It seems a bit complex, and I am not even sure it can work if the proxy reconnects to a new control plane instance during the middle of this operation, unless our control plane instances sync data which is extremely complicated
[optional Relevant Links:]
Issue tracker on our side: istio/istio#29131