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

Refactor routing code and add support for subnet failover (HA) #1024

Merged
merged 13 commits into from
Dec 6, 2022

Conversation

juanfont
Copy link
Owner

This PR implements #988, for better route management.

It enables Headscale to:

  • Enable and disable advertised subnets
  • Handle exit nodes
  • Manage multiple nodes offering the same route
  • Failover to another node when the primary node for a subnet is disconnected

Should also implement #1010, and #260.

@juanfont juanfont requested a review from kradalby as a code owner November 28, 2022 21:16
machine.go Show resolved Hide resolved
cmd/headscale/cli/routes.go Show resolved Hide resolved
@juanfont juanfont force-pushed the improve-routing branch 3 times, most recently from 7331e0e to 7c33519 Compare December 4, 2022 11:26
Add migration from Machine.EnabledRoutes to the new Route table

Cleanup route.go and add helper methods to process HostInfo
Port routes tests to new model

Mark as primary the first instance of subnet + tests

In preparation for subnet failover, mark the initial occurrence of a subnet as the primary one.
Added method to perform subnet failover

Added tests for subnet failover
Another bunch of gosec/golint related fixes

Remove method no longer used
Add more logging

Updated protos with new routes API
Remove magic number (base10...)
kradalby
kradalby previously approved these changes Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants