参考地址:https://blog.csdn.net/CEVERY/article/details/108753379

问题分析

环境变量
原因:kubernetes master没有与本机绑定,集群初始化的时候没有绑定,此时设置在本机的环境变量即可解决问题。

问题图片
The connection to the server localhost:8080 was refused - did you specify the right host or port?解决

解决方式

步骤一:设置环境变量

具体根据情况,此处记录linux设置该环境变量
方式一:编辑文件设置
vim /etc/profile
在底部增加新的环境变量 export KUBECONFIG=/etc/kubernetes/admin.conf
方式二:直接追加文件内容
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> /etc/profile
步骤二:使生效

source /etc/profile
解决问题后截图:

 The connection to the server localhost:8080 was refused - did you specify the right host or port?解决

 

相关文章:

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