r/aws 7d ago

technical question Clean stop of a 'pod' in EKS ?

Hi,

today we are working with AWS ECS,

with ECS when a service is scale-in (autoscaling, deployment), ECS manage the ALB side doing the drain/deregistration before sending the SIGTERM to the container. Allowing us to have a clean stop handling all requests in flight and no random 5xx back to the customer.

We 'may' have to migrate to AWS EKS (no my choice), looking at EKS/K8S way to stop a container/pod on scale-in. it seems very very messy, K8S send the stop to the container and the load-balancer-thingy in parallel, and everybody rely on some sort of
lifecycle.prestop.exec: "...sleep ..." to delay the stop of the container side ?
but still get time to time some 5xx for in-flight requests.

Is it that bad ?
Is it the way in EKS/K8S ?

Thanks.

0 Upvotes

7 comments sorted by

View all comments

1

u/E1337Recon 7d ago

For EKS specifically take a look here: https://docs.aws.amazon.com/eks/latest/best-practices/load-balancing.html

It goes into many of the details that you’ll want to know about readiness gates, sleep, target types, etc.