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

Fix: Add Route Reconciliation #1749

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Fix: Add Route Reconciliation #1749

wants to merge 13 commits into from

Commits on Nov 11, 2024

  1. Configuration menu
    Copy the full SHA
    6dd7a92 View commit details
    Browse the repository at this point in the history
  2. feat(NRC): route reconciliation

    Add a route reconciliation step to the host_route_sync file that uses
    the BGP state table as a system of record for the routes that should or
    should not be synced to the system.
    
    In theory, kube-router should be consistently informed of route changes
    via BGP Path change events that are sent to us from GoBGP. However, in
    practice it seems that some routes are getting stuck in our state table.
    aauren committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    20b2639 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ef71110 View commit details
    Browse the repository at this point in the history
  4. feat: add health check to host route sync

    Host route syncing is an important part of kube-router that is run in
    its own goroutine, so we should be checking it for health the way we do
    the major controllers to make sure that it never stops functioning.
    
    Additionally, as the health check controller has been continuously added
    on to, we also make some modifications here to make it a bit more robust
    and scalable.
    aauren committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    505d0c3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    943cc0d View commit details
    Browse the repository at this point in the history
  6. fix(host_route_sync.go): track changed routes in checkCacheAgainstBGP()

    In addition to added / removed routes, there is also the chance that the
    gateway has changed and we need to track that as well by fixing the
    cache state.
    aauren committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    83ffcd4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c6542c0 View commit details
    Browse the repository at this point in the history
  8. fix(host_route_sync.go): check relevant path attributes

    We don't want to add paths that are either not the Best path, which is
    something that we get for free on the BGP Watch method that we have in
    the NRC, or paths that are currently being withdrawn (even though this
    should be an edge case).
    aauren committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    c129fb0 View commit details
    Browse the repository at this point in the history
  9. fix(host_route_sync.go): check against primary IP

    In a List operation, we get our own routes that we've advertised. This
    was a problem that we didn't have with BGP Watches. However, this now
    affects us, so we need to remove IPs that represent ourselves, so that
    we don't add needless routes.
    aauren committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    23c9e19 View commit details
    Browse the repository at this point in the history
  10. feat(linux_routes.go): add a boolean to InjectRoute()

    Adding a boolean to the return values of InjectRoute() allows us to
    track when a route is actually inserted vs. when it was called. This
    helps us better represent HostRoutesStaleAddedCounter metric.
    
    Without this, the administrator will see a bunch of routes seemingly
    being added every time we call checkCacheAgainstBGP() when, in fact,
    most of them are tossed out depending on the user's mesh subnet
    settings.
    aauren committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    43e44fd View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a27e751 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2024

  1. fix(InjectRoute): ensure routes is removed from map

    There are a couple of items that have typically ended up in a no-op for
    us when considering routes to inject. However, now that we have a route
    map where we track route state, we need this not just to be no-ops, but
    also update the route state cache as well to ensure that the route
    doesn't get replaced in the future.
    
    When we find tunnels to clean up, we need to not only remove the tunnel
    and the route to that tunnel, but also remove the route from the state
    map.
    
    When we discover that no route needs to be added to the host because
    it's not in the same subnet and we weren't supposed to create a tunnel,
    then we also clean it up and ensure that it isn't in our state as well.
    aauren committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    4c9fb28 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e328d0f View commit details
    Browse the repository at this point in the history