1

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.

Rico
  • 58,485
  • 12
  • 111
  • 141
Kok How Teh
  • 3,298
  • 6
  • 47
  • 85

4 Answers4

1

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
  • 121
  • 4
  • @KokHowTeh you need to install the net-tools package to use it. – Zach Swanson Nov 15 '18 at 13:07
  • net-tools is obsolete – Kok How Teh Nov 16 '18 at 05:03
  • Then use `ss` as @prafull-ladha suggested in the other answer. It has the same command structure. Regardless of what tool you want to use, the error message from k8 indicates that some other process is already bound to that ip:port, so just figure that out and kill it. – Zach Swanson Nov 16 '18 at 14:18
1

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
  • 12,341
  • 2
  • 37
  • 58
0

For me, later on I discovered that there were 2 extra containers "Terminating" of core-dns-xxxxx in my cluster.

After deleting them forcefully solved the problem for me:

kubectl delete core-dns-xxxx --force

Thanks.

ZIA UR REHMAN
  • 119
  • 12
-1

I ditch kubeadm and use microk8s.

Kok How Teh
  • 3,298
  • 6
  • 47
  • 85