第一个:node节点注册提示:failed to get config map: Unauthorized
[root@node1 ~]# kubeadm join 10.5.1.10:6443 --token llilpc.9je7qvdn7l4sygoo --discovery-token-ca-cert-hash sha256:a82baf34d02c5338c6c7c8e9234316dffecee709cea7cc76cda47c8e595f1745 W0122 19:36:32.447752 12903 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 preflight: unable to fetch the kubeadm-config ConfigMap: failed to get config map: Unauthorized To see the stack trace of this error execute with --v=5 or higher
错误原因,token令牌失效,解决方法:
在master节点执行下面的命令
sudo kubeadm token create
然后再执行下面的命令重新生成注册令牌
sudo kubeadm token create --print-join-command
然后杀死node节点所有K8S相关的进程再注册一次即可
至此,问题解决
原文:https://www.cnblogs.com/liuyi778/p/12229416.html