Re:Zero-Downtime Kubernetes Deployments on AWS with EKS
by relistan on Tuesday March 11, 2025 @04:13AM
(#43330289)
Yeah, exactly. We just catch the TERM, clean up, and then shut down. But the rest of the top post in the thread is right on.
Re:Zero-Downtime Kubernetes Deployments on AWS with EKS
by remram on Tuesday March 11, 2025 @10:05AM
(#43332572)
If I understand correctly, because ALB does its own health checks, you need to catch TERM, wait 30s while returning non-ready for ALB to have time to notice, then clean up and shut down.
Re:Zero-Downtime Kubernetes Deployments on AWS with EKS
by paranoidrobot on Tuesday March 11, 2025 @05:52AM
(#43330816)
> If you are referring the 30 seconds to kill time, that would be holding it wrong. As long as your process is PID 1, you can rig up your own process exit handlers, which completely resolves the problem.
Maybe I am holding it wrong. I'd love not to have to do this work.
But I don't see how being PID 1 or not helps (and yes, for most workloads it is PID 1)
The ALB controller is the one that would need to deregister a target from the target group, and it won't until the pod is gone. So we have to force it by having the app do the functional equivalent with the readiness check.
Many people don’t run the main process in the container as PID 1, so this “problem” remains.
If it’s not feasible to remove something like a shell process from being the first thing that runs, exec will allow replacing the shell process with the application process.