Repository navigation
Conversation
AllocateOrOccupyCIDR takes an IPv4 CIDR from the cluster CIDR set and then looks up the IPv6 range of the Linode. When that lookup fails, for example because the node has no ProviderID yet or the Linode API returned an error, the function returned without giving the IPv4 CIDR back. The node is requeued and every retry took another block, so the cluster CIDR ran out until the controller restarted. Release the IPv4 CIDR before returning the IPv6 error. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
cloudAllocator.AllocateOrOccupyCIDRtakes an IPv4 CIDR from the cluster CIDR set withAllocateNext()and then callsallocateIPv6CIDR. If the IPv6 lookup fails, it returns the error without releasing the IPv4 CIDR.syncNodethen requeues the node withAddRateLimited, and every retry allocates another block.This is easy to hit: the node informer enqueues every new node, and a kubelet running with
--cloud-provider=externalregisters the node before the cloud node controller setsspec.providerID. Until thenparseLinodeIDFromProviderIDfails (node ... has no ProviderID set) and each retry leaks one IPv4 block. A transient Linode API error inGetInstance/ListInterfaces/ListInstanceConfigshas the same effect. The leaked blocks only come back when the CCM restarts, so with node churn the cluster CIDR runs out (CIDRNotAvailable).The fix releases the IPv4 CIDR before returning the IPv6 error, the same way
updateCIDRsAllocationalready releases it when patching the node fails.TestAllocateOrOccupyCIDRReleasesIPv4WhenIPv6Failsuses a/28cluster CIDR with/30node blocks (four blocks), fails the IPv6 step six times (node without ProviderID, andGetInstancereturning an error), and then expects four free blocks. Onmain:With the change:
General:
Pull Request Guidelines: