問題產生
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. 關機重啟一下
