In this article
Fit application termination into the applicable node shutdown phase and distinguish graceful detection from abrupt infrastructure loss.
A model Pod requests a long termination grace, yet a planned operating-system shutdown stops it sooner. Pod grace is constrained by the node’s shutdown procedure and available budget. A correct application drain path still needs time that the node and operating system actually preserve for its workload class.
Confirm graceful detection
On supported Linux setups, kubelet uses the operating system’s shutdown notification and inhibitor mechanism. Read the effective kubelet configuration and node events. Feature availability alone does not establish active grace: the relevant durations need appropriate configuration. Abrupt power loss or a shutdown path that bypasses detection cannot be treated as the same tested graceful sequence.
Read the shared budget
In the documented two-phase configuration, shutdownGracePeriod is the total delay, while shutdownGracePeriodCriticalPods reserves part for critical Pods. The regular-workload phase uses the remaining portion. Do not add the two values as independent time allowances or assume every model Pod receives the entire node total. Check any separately configured priority-based ordering before applying this simpler interpretation.
Fit application shutdown inside it
Compare Pod termination grace and observed application cleanup with the applicable node phase. Kubelet can constrain Pod termination to the remaining node budget. Include readiness withdrawal, accepted requests and final output publication in the application evidence. A generous Pod field cannot create time beyond the node’s supported shutdown delay or the infrastructure’s actual power-off boundary.
Read admission and cancellation
During detected shutdown, the node becomes unavailable for new placement and kubelet rejects new Pod admission. Tolerating a not-ready scheduling taint does not make starting there appropriate. If the operating system cancels shutdown, the node can recover readiness, but Pods already entering termination are not restored to their earlier running lifecycle. Inspect controller replacement behavior separately.
Verify a planned rehearsal
Use an isolated disposable node and harmless work to observe notification, node condition, termination phases and complete cleanup. Then compare the measured available interval with a bounded model shutdown fixture. Success establishes that tested graceful path. It does not cover power failure, guarantee a long stream completes, prove upstream rerouting is timely or authorize changes to live node shutdown settings.
Primary references
Related reading: preStop consumes the grace period: budgeting Pod termination; Graceful inference-server termination with active streams.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.