-
Notifications
You must be signed in to change notification settings - Fork 260
feat: [NPM] lazy delete ipsets #1252
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
Conversation
| // NOTE: in ApplyAllIPSets mode, if this ipset has never been created in the kernel, it would be added to the deleteCache, and then the OS would fail to delete it | ||
| iMgr.modifyCacheForKernelRemoval(set.Name) | ||
| } | ||
| // if mode is ApplyOnNeed, the set will not be in the kernel (or will be in the delete cache already) since there are no references |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even in applyONNeed we might end in situation where a set is needed with members and then we delete the referenced netpol/list. We can end up with empty sets in kernel right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anytime the set is modified, we see if it should be in the kernel now, and it to the deleteCache if needed
Place the burden of cleaning up empty/unreferenced ipsets on the dataplane. The ipset manager will remove all deletable sets from the main cache, and for
ApplyAllIPSetsmode, will add those sets to thetoDeleteCache, ready to be removed on the nextApplyIPSetscall.This PR does the following:
DeleteIPSetcalls from the controllers:Namespaceipsets in namespace controllerMinor updates: