解决K8S提示:certificate has expired or is not yet valid: current time
1、提示信息[root@localhost zgj_toutiao]# kubeadm join 10.1.0.20:6443 --token 4v0w24.i1yo05c4fipsbzqm--discovery-token-ca-cert-hash sha256:455df700f62a3850fac6e1443e52a5843f5ba210f36c1c9f902ed563e3d92bf2[pr
·
1、提示信息
[root@localhost zgj_toutiao]# kubeadm join 10.1.0.20:6443 --token 4v0w24.i1yo05c4fipsbzqm --discovery-token-ca-cert-hash sha256:455df700f62a3850fac6e1443e52a5843f5ba210f36c1c9f902ed563e3d92bf2
[preflight] Running pre-flight checks
error execution phase preflight: couldn't validate the identity of the API Server: Get "https://10.1.0.20:6443/api/v1/namespaces/kube-public/configmaps/cluster-info?timeout=10s": x509: certificate has expired or is not yet valid: current time 2020-09-19T12:39:59+08:00 is before 2020-12-25T01:25:57Z
2、问题描述
这是因为你的主机时间不同步导致的
3、解决方法
3.1、安装ntpdate
yum install ntpdate
3.2、同步
ntpdate time.windows.com
执行结果:
[root@localhost zgj_toutiao]# ntpdate time.windows.com
25 Dec 11:47:28 ntpdate[32323]: step time server 20.189.79.72 offset 8374967.417558 sec
[root@localhost zgj_toutiao]# ntpdate time.windows.com
25 Dec 11:51:06 ntpdate[32357]: step time server 20.189.79.72 offset -10.882267 sec
[root@localhost zgj_toutiao]#
4、最终效果
此时问题就解决了。
你可能还需要看:
解决最新版K8S V1.20版本镜像拉取失败的问题及脚本处理
更多推荐
已为社区贡献7条内容
所有评论(0)