GCE LoadBalancer: Invalid value for field 'namedPorts [0] .port': '0'. Must be greater than or equal to 1

In one of my HTTP (S) LoadBalancer, I want to change my backend configuration to increase the timeout from 30 to 60 (we have several 502 that don't have any server-side logs, I want to check if it comes from LB)

But, as I check the change, I received an error message

Invalid value for field 'namedPorts [0] .port': '0'. Must be greater than or equal to 1

even if I did not change namedPort.

This question seems to be the same, but the only solution is a workaround that doesn't work in my case:

Thank you for your help,

+5
source share
2 answers

I'm sure the OP has solved this by now, but for someone else pulling hair, this might work for you:

There is an error in the GCE load balancer user interface. If you accidentally add an empty IP / Port combination with an interface, it will create a named port in an instance group named port0 with a value of 0 . Perhaps you do not even understand that this happened because you will not see an empty display of the interface in the console.

To fix the problem, edit your instance group and remove port0 from the list of port name mappings.

Instance Group -> Details -> Display Port Name

+8
source

I ran into the same problem and the @tmirks fix did not help me.

After experimenting with GCE for a while, I realized that the problem was with the service.

By default, all services are type: ClusterIP unless otherwise specified.

In short, if your service does not appear as type: NodePort , than the GCE load balancer will not have traffic on it.

From the official Kubernetes project :

nodeport is a requirement of the GCE Ingress controller (and cloud controllers in general). On-prem controllers, such as nginx login controllers, work with clusterip:

+4
source

Source: https://habr.com/ru/post/1270969/


All Articles