• Kubernetes Submit Queue's avatar
    Merge pull request #29907 from luxas/lookup_ip_better · 3dad8f7c
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue
    
    [kubelet] Auto-discover node IP if neither cloud provider exists and IP is not explicitly specified
    
    One example where the earlier implementation failed is when running kubelet on CoreOS (bare-metal), where the nameserver is set to `8.8.8.8`. kubelet tries to lookup the node name agains Google DNS, which obviously fails. The kubelet won't recover after that.
    
    The workaround hsa been to set `--hostname-override` to an IP address, but it's quite annoying to try to make a multi-distro way of getting the IP in bash for example. This way is much cleaner.
    
    Refactored the function a little bit at the same time
    
    @vishh @yujuhong @resouer @Random-Liu 
    3dad8f7c
kubelet_node_status.go 26.9 KB