Thank you for another great video! I totally agree on the fact that apps should handle OS signals. As a Java developer shutdown hooks and interrupted Exceptions were part of my routine. In Kubernetes though the magic vanishes when you cope with pod termination lifecycle . The Pod removal from Endpoint objects and SIGTERM sending occur in parallel, so you can have a race condition where the Pod is terminated before the Endpoint object is. That means the Pod would still get traffic even if the Pod is no more! That is why you may need preStop hooks to handle graceful shutdown properly
That's up to the logic you put into your code. What matters is that processes will be shutdown almost immediately without the code processing signals so you should always have them.
Thank you for another great video! I totally agree on the fact that apps should handle OS signals. As a Java developer shutdown hooks and interrupted Exceptions were part of my routine. In Kubernetes though the magic vanishes when you cope with pod termination lifecycle . The Pod removal from Endpoint objects and SIGTERM sending occur in parallel, so you can have a race condition where the Pod is terminated before the Endpoint object is. That means the Pod would still get traffic even if the Pod is no more! That is why you may need preStop hooks to handle graceful shutdown properly
That's true. In this case, I was more focused on shutdown of only Pods due to upgrades (where the rest stay) since that is much more common scenario.
Thank you !
really enjoying those thriller scripts around the topic .. 😂
what if the requests or user session related to the request is long, coupling in multiple sessions on multiple pods , how would this be handled.
That's up to the logic you put into your code. What matters is that processes will be shutdown almost immediately without the code processing signals so you should always have them.
Is it possible to override the SIGTERM type/value using the container environment variables?
I don't think so. It's Lijux standard not dit ctly related but adopted by containers.
Its confusing when you say Nix and not *nix. I assumed you meant "unix like" systems
My bad. I wanted to say Linux or Unix and thought that nix would cover it.
Googled nix and i didn’t understand before seeing this comment 😂. Thanks for the video and thanks @robertkozak for your comment