GKE single ip load balancers overlap ports

5/25/2021

I have a test cluster in GKE with several apps. Some of them must be exposed on a single ip and as a service of type: LoadBalancer.

I've reserved static external address, and used it in yamls of my services as loadBalancerIP. But everything is ok, except one service. It's ftp server with ports 20-21, and 30000-30005 for passive mode. GKE automatically configures loadbalancers for services with port range from the lowest one to the greatest for every service. So, obviously it overlaps any other service of my cluster with port range 20-30005 and this service external ip keeps pending state.

Are there any solution of that problem? My thoughts brings me to using externalIPs field with manually created load balancer with forwarding rules and targets in gcp network services console. Or either both loadbalancerIP and externalIPs with same ip, but i am not sure about that. Is it will work correctly? Are there other solutions?

-- sfcdota
google-cloud-platform
google-kubernetes-engine
kubernetes
kubernetes-service
load-balancing

1 Answer

5/25/2021

After trying almost everything, I've just realized, that with such GKE LB implementation behaviour, I am actually can create two services, first for active mode port range, second for passive. With selector to ftps app. Sounds not perfect, but this is single correctly working solution I've found so far.

-- sfcdota
Source: StackOverflow