由于之前安装了一版1.23.5的kubeadm,但执行kubectl指令都会报 The connection to the server 192.168.50.100:8080 was refused - did you specify the right host or port? 的报错问题,而且一直没有解决。
所以决定将此前安装的docker和kubeadm卸载清理之后,根据指导教程 https://blog.csdn.net/u010800804/article/details/127709691 ,重新搞了一版 kubeadm 1.25.0,但结果还是出现相同的问题,执行 kubectl get nodes 和 kubectl version 指令,都会提示 The connection to the server 192.168.50.100:8080 was refused - did you specify the right host or port?
我不理解的是,我在 KUBECONFIG=/etc/kubernetes/admin.conf 配置了是访问 6443 端口号,但指令执行还是访问到了 8080 端口。求大家指点下。