Abdulrahman Bres
Abdulrahman Bres

Reputation: 2903

Does Kubernetes send a signal before restarting a pod?

Kubernetes sends a SIGTERM signal to containers in a pod before terminating the pod

Does it send a similar signal when it restarts a pod?

Upvotes: 5

Views: 1834

Answers (1)

Anirudh Ramanathan
Anirudh Ramanathan

Reputation: 46728

Depends on what you mean here by pod restart. If a pod stops running because an underlying node is lost and then a higher level controller restarts it, then you may/may not see any signal being delivered because it is unexpected termination.

On the other hand, if you're talking about planned termination, where a controller kills/evicts a pod and starts a new pod of the same kind on a (potentially different) node, you will see the same set of events (SIGTERM -> termination_grace_period > SIGKILL) occur as in the case of a pod being killed.

Upvotes: 3

Related Questions