Pod Termination

Since Pods represent processes running on your cluster, Kubernetes provides for graceful termination when Pods are no longer needed. Kubernetes implements graceful termination by applying a default grace period of 30 seconds from the time that you issue a termination request. A typical Pod termination in Kubernetes involves the following steps:

  1. You send a command or API call to terminate the Pod.
  2. Kubernetes updates the Pod status to reflect the time after which the Pod is to be considered "dead" (the time of the termination request plus the grace period).
  3. Kubernetes marks the Pod state as "Terminating" and stops sending traffic to the Pod.
  4. Kubernetes send a TERM signal to the Pod, indicating that the Pod should shut down.
  5. When the grace period expires, Kubernetes issues a SIGKILL to any processes still running in the Pod.
  6. Kubernetes removes the Pod from the API server on the Kubernetes Master.

Note: The grace period is configurable; you can set your own grace period when interacting with the cluster to request termination, such as using the kubectl delete command. See the Terminating a Pod tutorial for more information.