kubeadm init --apiserver-advertise-address=192.168.56.103 --pod-network-cidr=192.168.0.0/16
getting following error
W0501 02:23:32.828806 8629 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
[init] Using Kubernetes version: v1.18.2
[preflight] Running pre-flight checks
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Port-10259]: Port 10259 is in use
[ERROR Port-10257]: Port 10257 is in use
[ERROR Port-10250]: Port 10250 is in use
[ERROR Port-2380]: Port 2380 is in use
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
[ERROR Port-10259]: Port 10259 is in use
[ERROR Port-10257]: Port 10257 is in use
[ERROR Port-10250]: Port 10250 is in use
[ERROR Port-2380]: Port 2380 is in use
Above error shows ports are in use.
In kubernetes
It seems kubeadm init
was already called on this node. Run kubeadm reset
before running kubeadm init
command.
If that does not work for you then you can check which process using those port by running
netstat -lnp | grep 1025
and you can kill those port by running
sudo fuser -k <port>/tcp