k8s从节点报错:The connection to the server localhost:8080 was refused - did you specify the right host or port?

 

 原因:kubernetes-admin命令没有同步过来

解决办法:

将主节点的配置 /etc/kubernetes/admin.conf 复制到本机,再重新声明环境变量

1、复制配置文件

scp root@主节点服务器地址:/etc/kubernetes/admin.conf /etc/kubernetes/

2、添加环境变量

echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile

3、申明环境变量

source ~/.bash_profile

4、重新查看配置

[root@k8s-node01 local]# kubectl get nodes
NAME           STATUS     ROLES    AGE   VERSION
k8s-master01   NotReady   master   38m   v1.14.0
k8s-node01     NotReady   <none>   21m   v1.14.0
k8s-node02     NotReady   <none>   21m   v1.14.0

k8s从节点报错:The connection to the server localhost:8080 was refused - did you specify the right host or port?

 

相关文章:

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