How do I change the idle timeout of a Hetzner load balancer?
Set the load-balancer.hetzner.cloud/http-timeout-idle annotation on the Service. A Hetzner load balancer with the protocol http or https closes a connection after 50 seconds without traffic. The annotation changes that to a value between 30s and 300s:
metadata:
annotations:
load-balancer.hetzner.cloud/protocol: http
load-balancer.hetzner.cloud/http-timeout-idle: 120s
The annotation works only together with protocol: http or https. Services use tcp unless you set the protocol annotation.
If the Service shows the event invalid input in field 'http', the annotation is on a tcp Service or the value is outside 30s to 300s. The cloud controller manager cannot reconcile the Service until you fix or remove the annotation, and a new Service gets no address.
Removing the annotation does not reset the timeout. The load balancer keeps the last value. Set 50s to go back to the default.
All annotations are listed in Configure a Hetzner load balancer.
Related questions
