News for hackers. Stuff that matters.
Re:Problems with “graceful shutdown” in Kubernetes (2019) by LimaBearz on Tuesday March 22, 2022 @06:47PM (#30772616)
Not defending the situation of a preStop hook at least in the case of API's k8s can handle it 100%, its just messy.

We have a preStop hook of 62s. 60s timeouts are set in our apps, 61s is set on the ALBs (ensuring the ALB is never the cause of the hangup), and 62s on the preStop to make sure nothing has come into the container in the last 62s.

Then we set a terminationGracePeriodSeconds of 60 just to make sure it doesn't pop off too fast. This gives us 120s where nothing happens and anything in flight can get to where its going.

Re:Problems with “graceful shutdown” in Kubernetes (2019) by chippiewill on Tuesday March 22, 2022 @10:07PM (#30774043)
> Then we set a terminationGracePeriodSeconds of 60 just to make sure it doesn't pop off too fast.

I think the grace period includes the prestop duration doesn't it?

Re:Problems with “graceful shutdown” in Kubernetes (2019) by bogomipz on Wednesday March 23, 2022 @12:27AM (#30774949)
The grace period does include the time spent to execute the preStop hook yes.
Re:Problems with “graceful shutdown” in Kubernetes (2019) by thecosmicfrog on Tuesday March 22, 2022 @08:31PM (#30773401)
Yep, same configuration here other than we use 60/65/70 for (admittedly) completely unscientific reasons.