Is there a possible race condition in pod termination right after creation?

2/27/2020

I have a container that runs a server, which listens for SIGTERM to perform a graceful shutdown.

What happens if the pod starts to terminate while it is starting up, or right after it starts up?

Is it possible for SIGTERM to fire after the server starts but before it starts listening to SIGTERM, preventing the server from knowing about the shut down? If so, would the preStop hook fix this?

-- Code
kubernetes

0 Answers