Describe the bug
GetNodeIP() would return empty IP for some certain output format of ip route, thus failed to run kubelets
For example:
default via 10.96.191.254 dev eth0 proto dhcp metric 100
10.96.176.0/20 dev eth0 proto kernel scope link src 10.96.179.135 metric 100
169.254.0.0/16 dev docker0 scope link metric 1000 linkdown
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
The output of ip route | awk '{print $(NF)}' | awk '/^10\..*/' {print; exit} would be empty and directly returned; won't execute hostname -I | awk '{print $1}' in the rest of the function
To Reproduce
Deploy in a multi-node stock-only environment
Machine: arm64
OS: ubuntu18.04
Software: stock-only
Expected behavior
Handle the circumstance that IP address is not at last column
Handle the circumstance that command output is empty
Logs
In journalctl -xeu kubelet
May 16 21:51:25 ubuntu kubelet[16064]: E0516 21:51:25.258484 16064 run.go:74] "command failed" err="failed to parse kubelet flag: flag needs an argument: --node-ip"
Describe the bug GetNodeIP() would return empty IP for some certain output format of
ip route
, thus failed to run kubelets For example:The output of
ip route | awk '{print $(NF)}' | awk '/^10\..*/' {print; exit}
would be empty and directly returned; won't executehostname -I | awk '{print $1}'
in the rest of the functionTo Reproduce Deploy in a multi-node stock-only environment Machine: arm64 OS: ubuntu18.04 Software: stock-only
Expected behavior Handle the circumstance that IP address is not at last column Handle the circumstance that command output is empty
Logs In
journalctl -xeu kubelet