the connection to the server 6443 was refused - did you specify the right host or port? 問題的解決方法


問題產生

 k8s 虛擬機重啟之后,使用 kubectl get nodes 命令報出如下錯誤:

# kubectl get nodes
The connection to the server <master>:6443 was refused - did you specify the right host or port?

 

解決方法:

1. 編輯 /etc/profile

vim /etc/profile

2. 在里面添加:

export KUBECONFIG=/etc/kubernetes/admin.conf

3. 使生效

source /etc/profile

4. 關機重啟一下


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM