This question is about graceful shutdowns in Kubernetes.
I have a set of servers that are eventually consistent and requires each of them to communicate with each other constantly, even if some servers are terminating.
Since the servers communicate via HTTP requests, I need to ensure that the terminating server needs to be able to continue to receive HTTP requests in order to pass on relevant information to its peers.
Based on my understanding, there will be a few things that will happen in parallel when a server is shutting down: it will be removed from endpoints list for service and that if there is a preStop hook it will be run. Originally I thought if I use a preStop handler and perform a sleep command then I can let the server continue to server traffic. But after some experimentation I realized that the server will stop serving traffic even before the sleep ends.
I was wondering if there are any ways I can configure the servers to keep receiving traffic while it's shutting down.