Maximum number of ports on GKE Loadbalancer Service

7/20/2020

Question

What is the maximum number of ports an (external) LB Service can support on GKE?

Background

We are experiencing timeouts against a LB Service when the port count gets higher than ~30.

The timeout suggests to me that firewall rules are not being created for the Service when new TCP ports are patched in. However, manually adding relevant firewall rules does not fix the issue.

As such, it is possible that the Service itself is failing to route traffic to relevant pods when the Service port count is too high.

These docs indicate a 50 port limit applies to internal LBs. Wondering if this is the same for external?

More Info

The port is definitely created on the Service:

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

We can hit the Pods using their Pod IPs but we cannot hit them using the Service.

-- Serge
gke-networking
google-kubernetes-engine
kubernetes
load-balancing

1 Answer

7/20/2020

Found the answer using kubectl describe svc .... Maximum seems to be 100 ports per Service.

  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
-- Serge
Source: StackOverflow