kubeadm init kubelet complains default bind address already in use

11/15/2018

kubeadm version 1.12.2

$ sudo kubeadm init --config kubeadm_new.config --ignore-preflight-errors=all

/var/log/syslog shows:

Nov 15 08:44:13 khteh-T580 kubelet[5101]: I1115 08:44:13.438374    5101 server.go:1013] Started kubelet
Nov 15 08:44:13 khteh-T580 kubelet[5101]: I1115 08:44:13.438406    5101 server.go:133] Starting to listen on 0.0.0.0:10250
Nov 15 08:44:13 khteh-T580 kubelet[5101]: E1115 08:44:13.438446    5101 kubelet.go:1287] Image garbage collection failed once. Stats initialization may not have completed yet: failed to get imageFs info: unable to find data in memory cache
Nov 15 08:44:13 khteh-T580 kubelet[5101]: E1115 08:44:13.438492    5101 server.go:753] Starting health server failed: listen tcp 127.0.0.1:10248: bind: address already in use
Nov 15 08:44:13 khteh-T580 kubelet[5101]: I1115 08:44:13.438968    5101 server.go:318] Adding debug handlers to kubelet server.
Nov 15 08:44:13 khteh-T580 kubelet[5101]: F1115 08:44:13.439455    5101 server.go:145] listen tcp 0.0.0.0:10250: bind: address already in use

I have tried sudo systemctl stop kubelet and manually kill kubelet process but to no avail. Any advice and insights are appreciated.

-- Kok How Teh
bind
ip-address
kubelet
kubernetes

3 Answers

11/15/2018

Have you tried using netstat to see what other process is running that has already bound to that port?

sudo netstat -tulpn | grep 10250
-- Zach Swanson
Source: StackOverflow

11/27/2018

I ditch kubeadm and use microk8s.

-- Kok How Teh
Source: StackOverflow

11/15/2018

Here is what you can do:

Try the following command to find out which process is holding the port 10250

root@master admin]# ss -lntp | grep 10250
LISTEN     0      128         :::10250                   :::*                   users:(("kubelet",pid=23373,fd=20))

It will give you PID of that process and name of that process. If it is unwanted process which is holding the port, you can always kill the process and that port becomes available to use by kubelet.

After killing the process again run the above command, it should return no value.

Just to be on safe side run kubeadm reset and then run kubeadm init and it should go through.

-- Prafull Ladha
Source: StackOverflow