Skip to content

Commit

Permalink
handle cases where the internal-ip is already set (e.g. kubelet)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleyDumaine committed Oct 2, 2024
1 parent 291e46f commit a777899
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cloud/linode/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,13 @@ func (i *instances) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloud
addresses = append(addresses, v1.NodeAddress{Type: ip.ipType, Address: ip.ip})
}

// include IPs set by kubelet for internal node IP
for _, addr := range node.Status.Addresses {
if addr.Type == v1.NodeInternalIP {
addresses = append(addresses, v1.NodeAddress{Type: v1.NodeInternalIP, Address: addr.Address})
}
}

klog.Infof("Instance %s, assembled IP addresses: %v", node.Name, addresses)
// note that Zone is omitted as it's not a thing in Linode
meta := &cloudprovider.InstanceMetadata{
Expand Down

0 comments on commit a777899

Please sign in to comment.