Open masa213f opened 5 months ago
I believe coild
on the assigned node will eventually collect unused AddressBlocks.
https://github.com/cybozu-go/coil/blob/main/docs/design.md#addressblock
At startup, coild also checks each AddressBlock for the Node, and if no Pod is using the addresses in the block, it deletes the AddressBlock.
Please reopen if I'm wrong.
@ymmt2005 In the actual cluster, an unused AddressBlock had been left for nearly half a year...
If that is so serious, I'd like to suggest calling the GC logic periodically, not only at the process startup.
I'd like to suggest calling the GC logic periodically,
That sounds good.
But this is not a serious problem, except when deleting addresspools. I don't think we should bother to modify it.
A workaround is to manually delete the coild
Pod of the node.
That will trigger a GC.
Deleting coild
is a safe operation. It does not interrupt networking.
Describe the bug
The Coil create two AddressBlocks when the coil-controller is temporarily down. And one of the two AddressBlocks may leak when the pod which uses the AddressBlocks is deleted.
Environments
To Reproduce
Setup kind cluster
Create AddressPool and Namespace
$ kubectl apply -f - << EOF apiVersion: v1 kind: Namespace metadata: annotations: coil.cybozu.com/pool: test-pool name: test-ns EOF
Create a Pod
Wait 1 minute
Start the coil-controllers
Then, the Coil sometimes creates two AddressBlocks for the test Pod.
After this, when the test Pod is deleted, one AddressBlock remains.