Exposing a service with --type="LoadBalancer" in AWS currently creates a TCP-level AWS ELB with the default timeout of 60 sec. Is there a way to change that timeout other than manually looking up the load balancer and reconfiguring it using AWS tools? (I.e. the laborious kubectl describe service xyz | grep "LoadBalancer Ingress" -> use AWS API to lookup the load balancer with this URL and set its timeout) Or are the good alternatives to using this automatically created ELB?
The problem with the current situation is that (1) 1 min is too short for some of our services and (2) due to load-balancing on the TCP (and not HTTP) level, the client does not get an informative error when the timeout is reached (in the case of curl: "curl: (52) Empty reply from server")
Thank you!
It's possible to set connection idle timeout for ELB in the recent Kubernetes versions (1.4 or later?) using an annotation on the service. For example:
kubectl annotate service my-service service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout=1200
Also, you can change the load balancing protocol to HTTP with the below annotation.
service.beta.kubernetes.io/aws-load-balancer-backend-protocol
See the AWS provider source for more annotations for AWS ELB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With