<p>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?</p>

<p>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")</p>

<p>Thank you!</p>

<p>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:</p>
<pre><code>kubectl annotate service my-service service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout=1200
</code></pre>
<p>Also, you can change the load balancing protocol to HTTP with the below annotation.</p>
<pre><code>service.beta.kubernetes.io/aws-load-balancer-backend-protocol
</code></pre>
<p>See <a href="https://github.com/kubernetes/cloud-provider-aws/blob/54f2b5cd571a6d26f79c22f8b8b977ad5d9c8df7/pkg/providers/v1/aws.go#L144" rel="noreferrer">the AWS provider source</a> for more annotations for AWS ELB.</p>
