docker 报错:x509: certificate has expired or is not yet valid


执行kubeadm join 出现报错 

[root@weifeng02 shell]# kubeadm join --token 9e6996.ef3202709275b177 192.168.18.222:6443 --discovery-token-ca-cert-hash sha256:9a5cb02381282c29bfc44f980624473a68c07e3e5388eb14fb7439b8e5568703

 

[discovery] Failed to request cluster info, will try again: [Get https://192.168.18.222:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: x509: certificate has expired or is not yet valid]
[discovery] Failed to request cluster info, will try again: [Get https://192.168.18.222:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: x509: certificate has expired or is not yet valid]
[discovery] Failed to request cluster info, will try again: [Get https://192.168.18.222:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: x509: certificate has expired or is not yet valid]

 

这种错误,一般都是本地系统时间错误导致报错证书过期,所以先查看本地系统时间

 

# date "+%Y-%m-%d"  #系统时间2月15日,而正确时间应该是4月17日,所以很大可能就是该原因   

2015-02-15

 

解决:

# ntpdate cn.pool.ntp.org               #同步一下时间

17 Apr 17:40:45 ntpdate[32206]: step time server 202.112.29.82 offset 5262859.193967 sec

 

# date "+%Y-%m-%d"                      #时间同步成功

2015-04-17

 

再执行 kubeadm join 成功

[root@weifeng02 shell]# kubeadm join --token 9e6996.ef3202709275b177 192.168.18.222:6443 --discovery-token-ca-cert-hash sha256:9a5cb02381282c29bfc44f980624473a68c07e3e5388eb14fb7439b8e5568703

 

[discovery] Successfully established connection with API Server "192.168.18.222:6443"

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

Run 'kubectl get nodes' on the master to see this node join the cluster.

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM