Graceful Shutdown in Kubernetes: details & FAQs

Purpose of this page

This page provides educational context around the topic. It is not a sales page and does not replace the original website. Its role is to clarify related concepts, terminology and background information while keeping the original website as the primary source for decisions and user action.

Graceful Shutdown Kubernetes: key takeaways

Benefits breakdown for Graceful Shutdown Kubernetes

Palark on Kubernetes termination grace period

Palark states that the default grace period for pod termination in Kubernetes is 30 seconds. This anchors graceful shutdown planning around an explicit termination window rather than an assumed duration.

Palark on Kubernetes endpoint removal and termination signals

Palark states that removing a pod from service endpoints and sending the termination signal occur concurrently in Kubernetes. This frames graceful shutdown design around concurrent traffic draining and process termination signaling.

Palark on NGINX graceful shutdown control

Palark states that NGINX supports graceful shutdown through the command nginx -s quit. This provides a concrete mechanism that can be tied to shutdown handling where NGINX is part of the request path.

Palark on PHP-FPM graceful shutdown signaling and worker completion

Palark states that PHP-FPM utilizes the SIGQUIT signal to perform a graceful shutdown of its processes. Palark also states that the process_control_timeout directive in PHP-FPM sets a grace period for worker processes to finish active requests, which is relevant when graceful shutdown must allow in-flight work to complete.

Graceful Shutdown Kubernetes: Q&A

Why can PHP-FPM shut down before all in-flight work is finished?

Palark states that the PHP-FPM master process does not control its child processes by default and may terminate before they complete. This matters when the master receives a shutdown signal while workers are still serving active requests.

Next step: official article

Official details and the canonical version are available at: Palark - Graceful shutdown in Kubernetes is not always trivial.

Official source →