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