Beyond the Start Button: The Hidden Life of Pod Termination in Kubernetes
summary
Walks through the exact pod-deletion sequence: API server sets metadata.deletionTimestamp and deletionGracePeriodSeconds, kubelet watches etcd, runs preStop hooks, sends SIGTERM to PID 1, then SIGKILL after the grace window; shows kubectl flags like --grace-period=30 and --force --grace-period=0 and explains that terminating is only metadata not a real state. Presents a working pattern: use downward API to read deletionTimestamp, compute a deadline, and batch-drain connections so shutdown finishes before SIGKILL; notes gotchas and when grace can be truncated.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:255xx errors and pod termination
- 2:32Agenda
- 3:56What is a pod
- 5:23Pod and container lifecycle
- 8:11Why pods terminate
- 10:20Pod deletion behind the scenes
- 11:45Graceful termination steps
- 16:41kubectl and graceful termination
- 19:10Termination caveats
- 20:56Pre-stop hooks gotchas
- 23:31Dynamic graceful shutdown
- 28:06Key takeaways
- 29:11Q&A
related talks
37mHow To Handle Node Shutdown In Kubernetes
26mThe essense of Graceful Shutdown
26mClean Up Your Room! What Does It Mean to Delete Something in K8s
26mWait! Can Your Pod Survive a Restart?
19mGraceful Node Shutdown – A Beginner’s Journey of Kubernetes Development
10mOptimizing incident response
27mØ Kubernetes Failover Improvement: Non-Graceful Node Shutdown
44mKubernetes: The Second Week
