k8s入坑之报错(10)node节点注册提示:failed to get config map: Unauthorized

参考文档:K8S部署遇到的问题处理汇总

报错输出:

[root@localhost ~]#  kubeadm join 192.168.1.11:6443 --token esce21.q6hetwm8si29qxwn     --discovery-token-ca-cert-hash sha256:5ea87ae5440baa0412acca4fa7d0c650677b37519f57765eed13b9df88c3b2be
W0609 12:12:28.090212    5700 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
^C
[root@localhost ~]# kubeadm join 192.168.1.112:6443 --token pr5ftv.ihrv3t2p32n1s2p8 \
>     --discovery-token-ca-cert-hash sha256:5ea87ae5440baa0412acca4fa7d0c650677b37519f57765eed13b9df88c3b2be 
W0609 12:15:19.889127    5785 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
error execution phase kubelet-start: a Node with name "localhost.localdomain" and status "Ready" already exists in the cluster. You must delete the existing Node or change the name of this new joining Node
To see the stack trace of this error execute with --v=5 or higher

错误原因:
token令牌失效,从新获取token,node节点重新加入

解决方法:

#1、去mater节点重新生成token,需要获取新的token

[root@k8s-master1 kubeadm]# kubeadm token create --ttl 0 --print-join-command
kubeadm join 10.0.0.200:6443 --token dmsehb.dvofkx1z5dpc0r58 --discovery-token-ca-cert-hash sha256:f8d6e3c1562adcd5e35d6246679c23759124229bf36e100cbf03398849263911
#2、再次加入集群
[root@k8s-node2 ~]# kubeadm join 10.0.0.200:6443 --token dmsehb.dvofkx1z5dpc0r58 --discovery-token-ca-cert-hash sha256:f8d6e3c1562adcd5e35d6246679c23759124229bf36e100cbf03398849263911
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Starting the kubelet
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...

This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the control-plane to see this node join the cluster.

[root@k8s-node2 ~]#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值