Skip to content
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

Lighthouse: prefer the local cluster first, before routing to other remote clusters #331

Closed
nyechiel opened this issue Oct 8, 2020 · 8 comments · Fixed by #343
Closed
Assignees
Labels
enhancement New feature or request lighthouse QE Labels related to QE handling items

Comments

@nyechiel
Copy link
Member

nyechiel commented Oct 8, 2020

Today, for the use case where a single ClusterIP service is deployed to multiple clusters for redundancy or scale, the Lighthouse plugin uses a round robin selection, so that traffic will be eventually served by all clusters in the ClusterSet.

Ideally, routing should be optimized for some sort of cost metric (e.g look at complete Service Topology information and prioritize traffic local to zone, region, etc), but until this concept matures in the upstream community I'd like to propose that we default to what we used to do with the original Lighthouse design and always prefer the local cluster first, before routing the traffic to other remote clusters (in a round-robin fashion).

I hope we can achieve this by enhancing the Lighthouse agent, and without modifying the MCS API.

@nyechiel nyechiel added the enhancement New feature or request label Oct 8, 2020
@nyechiel nyechiel added this to To do in Submariner Project v0.8.0 via automation Oct 8, 2020
@aswinsuryan
Copy link
Contributor

We have a weight which is assigned to zero and unused. The weight can be increased to a higher value for the local cluster and can use weighted RR to select the IP. The plugin currently does not have the awareness of the cluster which it is running. But I think we could get it from one of the Submariner CRD. This will be required to assign a higher weight.

@danibachar
Copy link
Contributor

danibachar commented Oct 9, 2020

Aren't DNS requests from within the cluster will not get to the Lighthouse plugin?
In any way, can I be assigned to it?

@nyechiel
Copy link
Member Author

nyechiel commented Oct 9, 2020

Aren't DNS requests from within the cluster will not get to the Lighthouse plugin?
In any way, can I be assigned to it?

Sure, Daniel. All requests to service.ns.svc.clusterset.local will be forwarded to the Lighthouse DNS. Please sync with @aswinsuryan and @vthapar if you have any questions, but a PR is welcome :)

@vthapar
Copy link
Contributor

vthapar commented Oct 12, 2020

@danibachar We get local clusterid from gateway object here https://github.com/submariner-io/lighthouse/blob/master/pkg/gateway/controller.go#L175 and storing it in connection map. We can easily tweak the code here to handle it differently from remote endpoints.

@nyechiel nyechiel changed the title Lighouse: prefer the local cluster first, before routing to other remote clusters Lightouse: prefer the local cluster first, before routing to other remote clusters Oct 12, 2020
@nyechiel nyechiel changed the title Lightouse: prefer the local cluster first, before routing to other remote clusters Lighthouse: prefer the local cluster first, before routing to other remote clusters Oct 12, 2020
@nyechiel nyechiel moved this from To do to Backlog in Submariner Project v0.8.0 Oct 12, 2020
@nyechiel nyechiel moved this from Backlog to To do in Submariner Project v0.8.0 Oct 13, 2020
@nyechiel
Copy link
Member Author

@danibachar we want to support this feature in our upcoming release (v0.8). Do you have cycles to work on this in the next few weeks?

@danibachar
Copy link
Contributor

@nyechiel Yep!
Plan to have a PR ready by the end of this weekend

@nyechiel nyechiel linked a pull request Oct 21, 2020 that will close this issue
@nyechiel nyechiel moved this from To do to Review / Verify in Submariner Project v0.8.0 Oct 21, 2020
Submariner Project v0.8.0 automation moved this from Review / Verify to Done Nov 6, 2020
@nyechiel nyechiel moved this from Done to Review / Verify in Submariner Project v0.8.0 Nov 8, 2020
@nyechiel nyechiel added the QE Labels related to QE handling items label Nov 8, 2020
@nyechiel
Copy link
Member Author

nyechiel commented Nov 8, 2020

@manosnoam FYI

@manosnoam
Copy link

Thanks @nyechiel
Added E2E request: #365

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lighthouse QE Labels related to QE handling items
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants