kubernetes - 如何解决GKE上的kubectl连接问题

标签 kubernetes google-cloud-platform google-kubernetes-engine google-cloud-networking

我们在GKE上有几个K8S集群。突然,我们无法通过kubectl来控制生产集群(这意味着它因超时错误而失败)。
我检查了群集的K8S API,似乎一切正常,并且可以在云 shell 内(通过主节点的相同IP)使用群集。
我还从本地计算机扫描了443端口,并显示filtered。但是我不确定根本原因是什么。
我还检查了防火墙规则,没有deny阻止了它。
我还需要检查什么?
更新1
我为两个集群端点运行了tcptraceroute。响应kubectl命令的那个,经过20跳后才到达目的地。但是上述群集的结果失败:

❯ sudo tcptraceroute <Master Node IP> 443
Selected device en0, address 192.168.1.238, port 50617 for outgoing packets
Tracing the path to <Master Node IP> on TCP port 443 (https), 30 hops max
 1  192.168.1.1  3.527 ms  2.436 ms  2.578 ms
 2  some ip  17.407 ms  17.644 ms  18.379 ms
 3  some ip  17.172 ms  17.487 ms  17.676 ms
 4  some ip  17.173 ms  17.258 ms  17.292 ms
 5  some ip  30.990 ms  30.630 ms  30.745 ms
 6  108.170.241.236  31.337 ms  31.384 ms  32.783 ms
 7  209.85.254.49  31.290 ms  31.320 ms  278.574 ms
 8  142.250.227.193  35.582 ms  39.082 ms  84.725 ms
 9  209.85.142.95  41.474 ms * 614.860 ms
10  108.170.231.173  38.148 ms  36.335 ms  35.805 ms
11  * * * # this should be 72.14.234.27
...
20  * * * # this must have ended here at <some ip>.bc.googleusercontent.com
...
30  * * *
Destination not reached

最佳答案

因此,有一个称为Master Authorized Networks的功能,如果启用该功能,它将阻止来自非授权网络的连接。

关于kubernetes - 如何解决GKE上的kubectl连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63177309/

相关文章:

postgresql - chown :/var/lib/postgresql/data/postgresql. conf:只读文件系统

kubernetes - kubectl label - 如何标记 "spec : template : metadata : labels"

kubernetes - 如何使用 helm 从目录创建 ConfigMap

docker - 在Google Cloud实例上独立安装kubelet永久磁盘

google-cloud-platform - 如何将 Google Cloud Platform 中的 'localhost' 添加为 OAuth2 的授权域

google-cloud-platform - GCloud 发布/订阅推送订阅 : Limit max outstanding messages

python - 从 Azure 服务总线读取的数据流

java - Cloud SQL 代理和权限不足

kubernetes - 使用网关 + VirtualService + http01 + SDS

kubernetes - 将 kubernetes yaml 转换为 kubectl cli 命令