From 839863849cfae070f096a24a1886ba48b928cce7 Mon Sep 17 00:00:00 2001 From: Christoph Petrausch Date: Thu, 1 Oct 2020 09:16:47 +0200 Subject: [PATCH 1/2] Clarify the pod termination process. --- content/en/docs/concepts/workloads/pods/pod-lifecycle.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/content/en/docs/concepts/workloads/pods/pod-lifecycle.md b/content/en/docs/concepts/workloads/pods/pod-lifecycle.md index 9dc37c357c..29631c4de1 100644 --- a/content/en/docs/concepts/workloads/pods/pod-lifecycle.md +++ b/content/en/docs/concepts/workloads/pods/pod-lifecycle.md @@ -342,7 +342,8 @@ place, the {{< glossary_tooltip text="kubelet" term_id="kubelet" >}} attempts gr shutdown. Typically, the container runtime sends a TERM signal to the main process in each -container. Once the grace period has expired, the KILL signal is sent to any remaining +container. Many container runtimes respect the STOPSIGNAL defined in the container image and send this instead of TERM. +Once the grace period has expired, the KILL signal is sent to any remaining processes, and the Pod is then deleted from the {{< glossary_tooltip text="API Server" term_id="kube-apiserver" >}}. If the kubelet or the container runtime's management service is restarted while waiting for processes to terminate, the @@ -353,9 +354,9 @@ An example flow: 1. You use the `kubectl` tool to manually delete a specific Pod, with the default grace period (30 seconds). 1. The Pod in the API server is updated with the time beyond which the Pod is considered "dead" - along with the grace period. + along with the grace period. If you use `kubectl describe` to check on the Pod you're deleting, that Pod shows up as - "Terminating". + "Terminating". On the node where the Pod is running: as soon as the kubelet sees that a Pod has been marked as terminating (a graceful shutdown duration has been set), the kubelet begins the local Pod shutdown process. @@ -386,7 +387,7 @@ An example flow: `SIGKILL` to any processes still running in any container in the Pod. The kubelet also cleans up a hidden `pause` container if that container runtime uses one. 1. The kubelet triggers forcible removal of Pod object from the API server, by setting grace period - to 0 (immediate deletion). + to 0 (immediate deletion). 1. The API server deletes the Pod's API object, which is then no longer visible from any client. ### Forced Pod termination {#pod-termination-forced} From 1498f297d566c120fc0700746632d7a86ec94fe5 Mon Sep 17 00:00:00 2001 From: Christoph Petrausch <263448+hikhvar@users.noreply.github.com> Date: Thu, 1 Oct 2020 10:43:30 +0200 Subject: [PATCH 2/2] Update content/en/docs/concepts/workloads/pods/pod-lifecycle.md Co-authored-by: Tim Bannister --- content/en/docs/concepts/workloads/pods/pod-lifecycle.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/en/docs/concepts/workloads/pods/pod-lifecycle.md b/content/en/docs/concepts/workloads/pods/pod-lifecycle.md index 29631c4de1..9c74012e8c 100644 --- a/content/en/docs/concepts/workloads/pods/pod-lifecycle.md +++ b/content/en/docs/concepts/workloads/pods/pod-lifecycle.md @@ -342,7 +342,8 @@ place, the {{< glossary_tooltip text="kubelet" term_id="kubelet" >}} attempts gr shutdown. Typically, the container runtime sends a TERM signal to the main process in each -container. Many container runtimes respect the STOPSIGNAL defined in the container image and send this instead of TERM. +container. Many container runtimes respect the `STOPSIGNAL` value defined in the container +image and send this instead of TERM. Once the grace period has expired, the KILL signal is sent to any remaining processes, and the Pod is then deleted from the {{< glossary_tooltip text="API Server" term_id="kube-apiserver" >}}. If the kubelet or the