无法执行kubeadm join 望解答!!!谢谢

来源:4-8 安装配置worker node节点

慕慕7580827

2021-06-28

按着老师的步骤检查了好几遍,配置上没看出什么问题,但是kubeadm join不work, 还望老师能答疑解惑

[centos@ip-192-168-10-87 ~]$ sudo kubeadm join 192.168.10.33:6443 --token 1460at.e6c9g8r3sqmj0q00     --discovery-token-ca-cert-hash sha256:041a5293a7192d29edb782196d24a0a2b222921bda677fa697e2f3e7f05fa80c
[preflight] Running pre-flight checks
error execution phase preflight: couldn't validate the identity of the API Server: Get "https://192.168.10.33:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
To see the stack trace of this error execute with --v=5 or higher

用了–v=5 来查看详细输出, 发现是下面这个错误

I0628 05:03:46.481513   24943 token.go:78] [discovery] Created cluster-info discovery client, requesting info from "192.168.10.33:6443"
I0628 05:03:56.482564   24943 token.go:215] [discovery] Failed to request cluster-info, will try again: Get "https://192.168.10.33:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I0628 05:04:12.390266   24943 token.go:215] [discovery] Failed to request cluster-info, will try again: Get "https://192.168.10.33:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I0628 05:04:28.801624   24943 token.go:215] [discovery] Failed to request cluster-info, will try again: Get "https://192.168.10.33:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I0628 05:04:44.799075   24943 token.go:215] [discovery] Failed to request cluster-info, will try again: Get "https://192.168.10.33:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I0628 05:05:00.456249   24943 token.go:215] [discovery] Failed to request cluster-info, will try again: Get "https://192.168.10.33:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

但是master节点上所有的service都运行没问题啊

[centos@master ~]$ kubectl get node
NAME     STATUS   ROLES    AGE     VERSION
master   Ready    master   6h21m   v1.19.3
[centos@master ~]$ kubectl get po -n kube-system
NAME                             READY   STATUS    RESTARTS   AGE
coredns-6d56c8448f-9j2p6         1/1     Running   0          6h21m
coredns-6d56c8448f-h4k4h         1/1     Running   0          6h21m
etcd-master                      1/1     Running   0          6h21m
kube-apiserver-master            1/1     Running   0          6h21m
kube-controller-manager-master   1/1     Running   0          6h21m
kube-flannel-ds-tzmt8            1/1     Running   0          90m
kube-proxy-94cw4                 1/1     Running   0          6h21m
kube-scheduler-master            1/1     Running   0          6h21m

还望老师能够指点下,看看到底哪里出了问题,谢谢!

写回答

1回答

清风

2021-07-01

看起来是网络链接问题,能ping成功吗,把防火墙策略打开

0
1
慕慕7580827
master/worker上互相ping都没有问题 [centos@master .kube]$ cat /etc/hosts # 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 127.0.0.1 mysql57 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.10.33 master 192.168.10.87 node1 192.168.10.231 node2 [centos@master .kube]$ ping node1 PING node1 (192.168.10.87) 56(84) bytes of data. 64 bytes from node1 (192.168.10.87): icmp_seq=1 ttl=64 time=0.476 ms --- node1 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3999ms [centos@master .kube]$ ping node2 PING node2 (192.168.10.231) 56(84) bytes of data. 64 bytes from node2 (192.168.10.231): icmp_seq=1 ttl=64 time=0.395 ms --- node2 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.364/0.379/0.395/0.024 ms
2021-07-14
共1条回复

Kubernetes 入门到进阶实战,系统性掌握 K8s 生产实践

阿里云最有价值专家亲授,云原生时代必备技能

1503 学习 · 613 问题

查看课程