Repository navigation
Conversation
updateNodeMetadata only set node.k8s.linode.com/private-ip and node.k8s.linode.com/public-ipv6 when the linode had a value, so an address removed from the linode stayed on the node forever. getNodePrivateIP prefers the annotation, so NodeBalancer backends kept pointing at the removed private IP instead of falling back to the node's InternalIP. handleNode also saw the mismatch on every refresh and sent a Node update that changed nothing. Remove the annotation when the expected value is empty. 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
The node controller writes
node.k8s.linode.com/private-ipandnode.k8s.linode.com/public-ipv6, butupdateNodeMetadataonly sets them when the linode has a value (... && privateIP != ""). When the private IPv4 is removed from the linode (or the IPv6 range goes away), the old annotation stays on the node:getNodePrivateIPprefers the annotation overStatus.Addresses, so the NodeBalancer config keeps that node's backend on the removed private IP instead of falling back to itsInternalIP.handleNodecompares the annotation with the linode on every metadata refresh, sees a mismatch, and sends aNodes().Updatethat changes nothing, once per TTL for each such node.Change:
setOrDeleteAnnotationsets the annotation to the expected value, or deletes it when the value is empty. Other annotations are untouched, and the label/ProviderID handling is the same as before.Test:
TestNodeController_handleNodeRemovesStaleIPAnnotationsstarts from a node that has both annotations and a linode that only has its public IPv4. It checks that both annotations are removed and an unrelated one is kept, thatgetNodePrivateIPnow returns the node'sInternalIP, and that the next refresh leaves the node unchanged (same resourceVersion). Onmainit fails:General:
Pull Request Guidelines: