Your Pods Are Not Draining: I Checked
Every graceful shutdown guide for Kubernetes tells the same story. The pod gets SIGTERM. The endpoint leaves rotation. Traffic stops arriving. Your handler finishes the in-flight work and exits. It is a reasonable story. I wanted to know if it is true. Not plausible. Measured, with timestamps.
So I built drainwatch. It is a small Go tool that holds open long-lived TCP and UDP connections against a pod, terminates the pod in different ways, and records what actually ends each connection and when. The evidence comes from Kubernetes watch events and from the packets themselves.
I ran 25 trials. Five termination scenarios, five repeats each, one frozen binary, and a fresh kind cluster per scenario. Kubernetes v1.34.0, kube-proxy in iptables mode. Every claim below traces to a committed report.json in the repo.
Finding 1: What you do on SIGTERM decides your TCP fate.
Same cluster. Same trigger, a pod...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE