Kuberneters节点加入证书过期问题解决方案

11 篇文章 0 订阅
10 篇文章 0 订阅

证书过期加入集群报错如下: 

root@worker00 ~]# kubeadm join 172.16.0.106:6443 --token bovuz7.a7rzxono6gk5jt78 --discovery-token-ca-cert-hash sha256:49e20dee4a7794f99ab6999daed1f32b0e8585bdbf8c96636dea502448982789
W0804 17:04:08.455469    4376 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
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 "bovuz7"
To see the stack trace of this error execute with --v=5 or higher

解决方案,重新生成token,以及sha256:

root@master00 ~]# kubeadm token create
W0804 17:12:29.119893   19826 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
ahmkaw.06mtkupwl3dvt3up
[root@master00 ~]# openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
49e20dee4a7794f99ab6999daed1f32b0e8585bdbf8c96636dea502448982789
[root@master00 ~]# 

 更换token和sha256再次加入即可:

[root@worker00 ~]# kubeadm join 172.16.0.106:6443 --token ahmkaw.06mtkupwl3dvt3up --discovery-token-ca-cert-hash sha256:49e20dee4a7794f99ab6999daed1f32b0e8585bdbf8c96636dea502448982789
W0804 17:15:01.868306    5148 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'
[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.18" ConfigMap in the kube-system namespace
[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@worker00 ~]# 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值