calico icon indicating copy to clipboard operation
calico copied to clipboard

Support for CNI GC Verb

Open haircommander opened this issue 4 months ago • 3 comments

Currently, CRI-O has some behavior specifically tuned for calico (though it could be argued that it's correct behavior for all) where we keep track of a pod across reboots so we can call CNI del on the now dead container after a reboot.

With the CNI GC verb, CRI-O could instead ask calico to GC the contents of that node. That would allow it to have less to keep track of and potentially not even persist pods across reboots.

Are there plans to support GC?

haircommander avatar Feb 09 '24 18:02 haircommander

Oh that's exciting - I hadn't spotted that change.

Sounds like something we should look into implementing in Calico - thanks for the pointer.

caseydavenport avatar Feb 27 '24 00:02 caseydavenport

This is the spec section: https://github.com/containernetworking/cni/blob/main/SPEC.md#gc-clean-up-any-stale-resources

Note this clause:

The runtime MUST NOT use GC as a substitute for DEL. Plugins may be unable to clean up some resources from GC that they would have been able to clean up from DEL.

and

specifically tuned for calico (though it could be argued that it's correct behavior for all)

I tend to agree that this is probably the correct behavior for all. I think Calico likely should implement the GC action, but given the above I don't think it would invalidate the desire for the logic to send DEL commands as it does currently.

caseydavenport avatar Feb 27 '24 00:02 caseydavenport

dang yeah I guess I missed that section. I'll leave this open but it does close the avenue of optimization I was hoping for

haircommander avatar Mar 06 '24 21:03 haircommander