mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Merge pull request #49025 from danwinship/non-cloud-node-ip
Automatic merge from submit-queue (batch tested with PRs 50537, 49699, 50160, 49025, 50205) When not using a CloudProvider, set both InternalIP and ExternalIP on Nodes #36095 changed all of the cloudproviders to set both InternalIP and ExternalIP on Nodes, but the non-cloudprovider fallback code now only sets InternalIP. This causes the test "should be able to create a functioning NodePort service" in test/e2e/service.go to fail on cloud-provider-less clusters, because (with LegacyHostIP gone), it now will only try to work with ExternalIPs, and will fail if the node has only an InternalIP. There isn't much other code that assumes that ExternalIP will always be set (there's something in pkg/master/master.go, but I don't know what it's doing, so maybe it's only useful in the case where InternalIP != ExternalIP anyway). But given that several of the cloudproviders (mesos, ovirt, rackspace) now explicitly set both InternalIP and ExternalIP to the same value always, it seemed right to do that in the fallback case too. @deads2k FYI **Release note**: ```release-note NONE ```
This commit is contained in:
commit
b91f19180d
@ -309,6 +309,10 @@ func GetNodePublicIps(c clientset.Interface) ([]string, error) {
|
||||
nodes := GetReadySchedulableNodesOrDie(c)
|
||||
|
||||
ips := CollectAddresses(nodes, v1.NodeExternalIP)
|
||||
if len(ips) == 0 {
|
||||
// If ExternalIP isn't set, assume the test programs can reach the InternalIP
|
||||
ips = CollectAddresses(nodes, v1.NodeInternalIP)
|
||||
}
|
||||
return ips, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user