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

 



相关文章:

  • 2022-12-23
  • 2021-05-23
  • 2022-02-19
  • 2021-10-29
  • 2021-07-01
  • 2022-03-07
猜你喜欢
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
相关资源
相似解决方案