Terminating a pod

The sequence of shutdown events is similar to events while starting a pod. After receiving a deletion invocation, Kubernetes sends SIGTERM to the pod that is going to be deleted, and the pod's state becomes terminating. Meanwhile, Kubernetes removes the endpoint of that pod to stop further requests if the pod is backing a service. Occasionally, there are pods that don't quit at all. It could be that the pods don't honor SIGTERM, or simply because their tasks aren't completed. Under such circumstances, Kubernetes will send SIGKILL to forcibly kill those pods after the termination period. The period length is set at .spec.terminationGracePeriodSeconds under the pod specification. Even though Kubernetes has mechanisms to reclaim such pods anyway, we still should make sure our pods can be closed properly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset