wuming@master kubernetes]$ sudo kubectl get nodes
出现 The connection to the server localhost:8080 was refused - did you specify the right host or port?
拷贝kubectl使用的连接k8s认证文件到默认路径
1.echo “export KUBECONFIG=/etc/kubernetes/admin.conf” >> profile
执行 export KUBECONFIG=/etc/kubernetes/admin.conf这个文件下根本没有admin.conf
Run these commands solved this issue:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown ( i d − u ) : (id -u):