-
Notifications
You must be signed in to change notification settings - Fork 524
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
Patch bug affecting IPv6 clusters in Kubernetes 1.21 #1925
Conversation
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.
LGTM pending testing.
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.
🎼
I approved, but the patch isn't there? Did we already have it checked in to our repo? |
The aws cloud provider was not sanitizing the imds node ip before being sent to kubelet. As a result, the address provided to the node-ip in kubelet and the one received from cloud provider mismatched.
I made a mistake with git while renaming files and removed the patch, but I have since rectified. My mistake! |
nodeIPTypes := make(map[v1.NodeAddressType]bool) | ||
for _, nodeAddress := range cloudNodeAddresses { | ||
- if nodeAddress.Address == nodeIP.String() { | ||
+ if string(net.ParseIP(nodeAddress.Address)) == string(net.ParseIP(nodeIP.String())) { |
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.
This is incorrect and compares internal net.IP representations, which only compare equal 'sometimes'.
We want: if net.ParseIP(nodeAddress.Address).Equal(nodeIP) {
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.
Thanks for the heads up, @anguslees! We've opened an issue (#1930) and are looking into it.
Description of changes:
This applies a patch for the issue described in this Kubernetes issue..
Testing done:
[ ] ensure the reproducer in the reported issue does not result in nodes without the full ipv6 octet.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.