Commit 7c3f8c9b authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #45181 from vmware/NodeAddressesIPV6IssueNew

Automatic merge from submit-queue Filter out IPV6 addresses from NodeAddresses() returned by vSphere The vSphere CP returns both IPV6 and IPV4 addresses for a Node as part of NodeAddresses() implementation. However, Kubelet fails due to duplicate api.NodeAddress value when the node has an IPV6 address associated with it. This issue is tracked in #42690. The following are observed: - when we enabled the logs and checked the addresses sent by vSphere CP to Kubelet, we don't see any duplicate addresses at all. - Also, kubelet_node_status doesn’t receive any duplicate address from cloud provider. However, when we filter out the IPV6 addresses and only return IPV4 addresses to the Kubelet, it works perfectly fine. Even though the Kubelet receives the non-duplicate node-addresses, it still errors out with duplicate node addresses. It might be an issue when kubelet propagates these addresses to API server (or) API server is enable to handle IPV6 addresses. @divyenpatel @abrarshivani @pdhamdhere @tusharnt **Release note**: ```release-note None ```
parents 76889118 d05b279d
...@@ -554,12 +554,14 @@ func (vs *VSphere) NodeAddresses(nodeName k8stypes.NodeName) ([]v1.NodeAddress, ...@@ -554,12 +554,14 @@ func (vs *VSphere) NodeAddresses(nodeName k8stypes.NodeName) ([]v1.NodeAddress,
addressType = v1.NodeInternalIP addressType = v1.NodeInternalIP
} }
for _, ip := range v.IpAddress { for _, ip := range v.IpAddress {
v1helper.AddToNodeAddresses(&addrs, if net.ParseIP(ip).To4() != nil {
v1.NodeAddress{ v1helper.AddToNodeAddresses(&addrs,
Type: addressType, v1.NodeAddress{
Address: ip, Type: addressType,
}, Address: ip,
) },
)
}
} }
} }
return addrs, nil return addrs, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment