【问题标题】:Can't connect to my private cluster using kubectl (Unable to connect to the server: dial tcp )无法使用 kubectl 连接到我的私有集群(无法连接到服务器:拨号 tcp)
【发布时间】:2021-12-27 16:43:14
【问题描述】:

我有 2 个集群相同的配置,直到昨天我都能够连接到它们,但今天我无法连接到其中一个,所有应用程序都运行正常,我在使用 kubectl 时出现此错误

Unable to connect to the server: dial tcp IP:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because the connected host has failed to respond 

我尝试从界面缩放我的集群(缩放有效,但我仍然无法使用 kubectl)

有人可以帮忙吗?

【问题讨论】:

  • 检查 kubectl 正在工作或使用的上下文,希望首先仅指向 k8s 服务器
  • 这不是上下文问题,这是在我的 8 个集群中的 1 个上出现的错误,并且它的配置与另一个相同,当我在其他集群之间切换时我没有问题,我尝试重置配置文件使用gcloud container clusters get-credentials clustername --zone zoneid --project projectid,我还比较了证书和防火墙规则,没有任何改变
  • 看起来像是阻塞了连接。我建议查看代理日志,看看它是否报告了任何启动错误。
  • 你能ping、nmap、traceroute、路由等你当前的公网IP吗?
  • 我无法通过 telnet 访问以前工作的 443 端口,但我的第二个端口仍在工作,(tracert 无法访问目标)

标签: kubernetes google-kubernetes-engine


【解决方案1】:

这是与 docker 网桥网络的网络冲突,基本上我使用 dockers 默认网桥网络作为我的 GKE 端点,所以当我在我的部署机器上安装 docker(自动构建图像并推送它们)时,我失去了与此的连接Kubernetes 集群。

所以我所要做的就是禁用桥接网络,然后我就可以连接回这个集群了

【讨论】:

    猜你喜欢
    • 2019-10-06
    • 2019-03-01
    • 2019-12-09
    • 2018-12-28
    • 2019-06-26
    • 2020-10-23
    • 2021-11-22
    • 2019-02-08
    • 1970-01-01
    相关资源
    最近更新 更多