The connection to the server localhost:8080 was refused - did you specify the right host or port?
原因:kubectl命令需要使用kubernetes-admin來運行。
解決辦法:
1.將主節點中的/etc/kubernetes/admin.conf文件拷貝到從節點相同目錄下
2.配置環境變量
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
3.立即生效
source ~/.bash_profile