当你遇到 kubectl the connection to the server localhost:8080 was refused 这个错误时,可以按照以下步骤进行排查和解决: 确认kubectl配置是否正确 首先,检查 kubectl 的配置文件(通常是 ~/.kube/config)。确保配置文件中的 server 字段指向正确的 Kubernetes API 服务器地址。如果你是在本地使用 minikube 或kind ...
执行kubectl get nodes,报错提示The connection to the server localhost:8080 was refused - did you specify the right host or port? 问题分析: kubernetes master没有与本机绑定,集群初始化的时候没有绑定,此时设置在本机的环境变量即可解决问题。 解决方案: 解决方案一: # vim /etc/profile # 在最底部增...
执行kubectl get nodes时提示The connection to the server localhost的解决方法 问题现象描述 执行kubectl get nodes时,提示“The connection to the server localhost:8080 was refused”。 关键过程、根本原因分析 Kube的config文件并没有赋予合理所属权导致执行权限不
# 设置集群参数 kubectl config set-cluster kubernetes --certificate-authority=/usr/local/opt/kubernetes/server/ssl/kubectl/ca.pem --embed-certs=true --server=https://192.168.100.10:6443 --kubeconfig=kube.config # 设置客户端认证参数 kubectl config set-credentials admin --client-certificate=/usr/lo...
[root@k8snode1 kubernetes]# kubectl get pod The connection to the server localhost:8080 was refused - did you specify the right host or port? 出现这个问题的原因是kubectl命令需要使用kubernetes-admin来运行,解决方法如下,将主节点中的【/etc/kubernetes/admin.conf】文件拷贝到从节点相同目录下,然后如提...
The connection to the server localhost:8080 was refused - did you specify the right host or port? 出现这个问题的原因是 kubectl 命令需要使用 kubernetes-admin 来运行。可能是系统环境不干净导致,例如重装 k8s 前未完全清空配置等。 解决方法:
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】文件拷贝到从节点相同目录下 ...
The connection to the server localhost:8080 was refused - did you specify the right host or port? 出现这个问题的原因是kubectl命令需要使用kubernetes-admin来运行,解决方法如下,将主节点中的【/etc/kubernetes/admin.conf】文件拷贝到从节点相同目录下,然后配置环境变量: ...
在集群节点上执行kubectl报错,提示"The connection to the server localhost:8080 was refused - did you specify the right host or port?",表明执行kubectl时遇到连接问题。深入分析后发现,问题源于kubernetes master与本地主机绑定不正确,可能在集群初始化阶段未完成绑定操作。为解决此问题,只需在本...
kubectl get pods The connection to the server was refused - did you specify the rig 1 主要是运行这个命令 alias kubectl='kubectl --kubeconfig=/etc/kubernetes/kubelet.conf'问题解决。 同时也用到如下命令: passwd kubeusr # 改kubeusr的密码