【问题标题】:Remote kubernetes server unreachable远程 Kubernetes 服务器无法访问
【发布时间】:2022-06-27 21:23:14
【问题描述】:

我尝试使用 Docker 桌面安装 kubernetes。但是,只要我输入

kubectl get nodes

我收到远程 kubernetes 服务器无法访问错误。

I0217 23:42:56.224000   26220 versioner.go:56] Remote kubernetes server unreachable
Unable to connect to the server: dial tcp 172.28.112.98:6443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

关于如何解决这个问题的任何想法?

【问题讨论】:

  • 你能ping 172.28.112.98 吗?
  • 很遗憾,没有。
  • 您有多个上下文吗?检查“kubectl config get-contexts”。如有必要,使用“kubectl config use-context docker-desktop”更改上下文
  • @RobinWebb 这对我有用。非常感谢。
  • 嗨@RobinWebb,您能否将您的解决方案放在答案中,以便社区更容易访问?

标签: kubernetes


【解决方案1】:

您的 kubeconfig 中有多个上下文吗?

您可以通过kubectl config get-contexts 进行检查。

如有必要,使用 kubectl config use-context docker-desktop 将您的上下文更改为 Docker Desktop Kubernetes。

您是否有可能尝试过minikube,而这在您的.kube\config 中留下了集群/上下文?

Configure Access to Multiple Clusters

【讨论】:

    【解决方案2】:

    当您从本地 k8s 集群切换到需要 VPN 连接且您未连接到 VPN 的远程集群时,也可能会出现相同的错误消息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-12
      • 2020-03-06
      • 2013-03-17
      • 1970-01-01
      • 2015-01-08
      • 1970-01-01
      • 1970-01-01
      • 2020-03-04
      相关资源
      最近更新 更多