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

Add host-local IPAM GC on startup #5660

Merged
merged 2 commits into from
Nov 15, 2023

Commits on Nov 14, 2023

  1. Add host-local IPAM GC on startup

    During CNIServer reconciliation, we perform host-local IPAM garbage
    collection (GC) by comparing the set of IPs allocated to local Pods and
    the set of IPs currently reserved by the plugin. We release any IP
    reserved by the plugin that is not in-use by a local Pod. The purpose is
    to avoid leaking IP addresses when there is a bug in the container
    runtime, which has happened in the past.
    
    Two key design choices that were made:
    * We do not invoke CNI DEL to release IPs, instead we access the
      host-local data which is persisted on the Node, and modify it as
      needed.
    * We do not rely on the interface store (as persisted to OVSDB) to
      determine the set of IPs that may have been leaked. In case of an
      Antrea bug, it could be possible (although unlikely) for an IP to
      still be allocated by host-local but be missing from the interface
      store. Intead, we list all allocated IPs from the host-local data (an
      allocated IP corresponds to one disk file).
    
    This approach is essentially the same as our existing script:
    https://github.com/antrea-io/antrea/blob/main/hack/gc-host-local.sh
    
    Fixes antrea-io#4326
    
    Signed-off-by: Antonin Bas <[email protected]>
    antoninbas committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    a9721a3 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2023

  1. Address review comments

    Signed-off-by: Antonin Bas <[email protected]>
    antoninbas committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    4223995 View commit details
    Browse the repository at this point in the history