Kubernetes 因令牌过期新增节点报错问题处理
Kubernetes 集群初始化完成之后,间隔一天发现 Worker 节点无法正常加入集群。
2、报错信息
$ kubeadm join api.k8s.com:9443 --token mmvhoe.yxnfs1jzmp3i058s --discovery-token-ca-cert-hash sha256:630a00c0ea19cf578ed8d0d6444b015b516e4e203982a6bc359e76c75b2e6e8
error execution phase preflight: couldn't validate the identity of the API Server: could not find a JWS signature in the cluster-info ConfigMap for token ID "mmvhoe"
To see the stack trace of this error execute with --v=5 or higher
3、报错解决
这个错误是 Worker 节点在加入集群时无法验证 API Server 的身份导致的,根本原因是由于令牌过期导致。
# 生成令牌
$ kubeadm token create --ttl 24h
x8hadg.85bibbsp8hsyolwx
# 加入集群
$ kubeadm join api.k8s.com:9443 --token x8hadg.85bibbsp8hsyolwx --discovery-token-ca-cert-hash sha256:630a00c0ea19cf578ed8d0d6444b015b516e4e203982a6bc359e76c75b2e6e8