GKE Loadbalancer 服务上的最大端口数

Maximum number of ports on GKE Loadbalancer Service

问题

(外部)LB 服务在 GKE 上可以支持的最大端口数是多少?

背景

当端口数超过 ~30 时,LB 服务出现超时。

超时提示我在修补新的 TCP 端口时没有为服务创建防火墙规则。但是,手动添加相关的防火墙规则并不能解决问题。

因此,当服务端口数太高时,服务本身可能无法将流量路由到相关 pods。

这些 docs 表示 50 个端口限制适用于内部 LB。想知道这是否与外部相同?

更多信息

端口肯定是在服务上创建的:

$ kubectl get svc -n router-proxy | tr ',' '\n' | grep 52220                                                                                       
52220:30142/TCP

我们可以使用他们的 Pod IP 访问 Pods 但我们不能使用服务访问他们。

使用 kubectl describe svc ... 找到答案。最大似乎是每个服务 100 个端口。

  Warning  SyncLoadBalancerFailed  23s (x272 over 97m)    service-controller  (combined from similar events): Error syncing load balancer: failed to ensure load balancer: googleapi: Error 413: Value for field 'resource.allowed[0].ports' is too large: maximum size 100 element(s); actual size 494., fieldSizeTooLarge