DEV Community

François
François

Posted on • Originally published at blog.lepape.me on

How to increase AWS ELB keep-alive timeout when deployed from Traefik

Let's see together how to change the Load balancer settings when created from an ingress controller like Traefik on Kubernetes.

The default timeout of the AWS Elastic Load Balancer (ELB) is 60 seconds. For some use cases (like long LLM calls) this might be too short and you might want to increase it.

When deploying Traefik on Kubernetes, it might be hard to find the right configuration to increase the keep-alive timeout on the ELB, as Traefik is the one creating the ELB.

Well, after some searches it is pretty easy to change it. You need to add the right annotation on the Kubernetes Service with the type Load Balancer.

Here is the documentation with available annotations: https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.7/guide/service/annotations/

With the Traefik Helm chart, it is as simple as updating this values.yaml file:

service:
  #    https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.7/guide/service/annotations/#resource-attributes
  annotations:
    # 2 minutes
    service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '120'
Enter fullscreen mode Exit fullscreen mode

Some examples of configuration used with nginx ingress controller: https://github.com/zephyrproject-rtos/infrastructure/blob/4b767ceec69f725614ded3dcb715c8ebffeadc83/terraform/zephyr-aws-blueprints/helm_values/nginx-values.yaml#L4

And that's it!

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay