Using kubeadm to init kubernetes 1.12.0 falied:node "xxx" not found

10/2/2018

My environment:

CentOS7 linux

/etc/hosts:

192.168.0.106 master01

192.168.0.107 node02

192.168.0.108 node01

On master01 machine:

/etc/hostname:

master01

On master01 machine I execute commands as follows:

1)yum install docker-ce kubelet kubeadm kubectl

2)systemctl start docker.service

3)vim /etc/sysconfig/kubelet

EDIT the file:

KUBELET_EXTRA_ARGS="--fail-swap-on=false"

4)systemctl enable docker kubelet

5)kubeadm init --kubernetes-version=v1.12.0 --pod-network-cidr=10.244.0.0/16 servicecidr=10.96.0.0/12 --ignore-preflight-errors=all

THEN

The first error message:

unable to load client CA file /etc/kubernetes/pki/ca.crt: open /etc/kubernetes/pki/ca.crt: no such file or directory

kubelet.go:2236] node "master01" not found

kubelet_node_status.go:70] Attempting to register node master01 Oct 2 23:32:35 master01 kubelet: E1002 23:32:35.974275 49157

kubelet_node_status.go:92] Unable to register node "master01" with API server: Post https://192.168.0.106:6443/api/v1/nodes: dial tcp 192.168.0.106:6443: connect: connection refused

l don't know why node master01 not found?

l have tried a lot of ways but can't solve the problem.

Thank you!

-- 朱可凡
docker
kubeadm
kubernetes

1 Answer

10/3/2018

Your issue also might be caused by firewall rules, restricting tcp connection to 6443 port. So you can temporary disable firewall on master node to validate this:

systemctl stop firewalld

and then try to perform kubeadm init once again. Hope it helps.

-- getslaf
Source: StackOverflow