# Drain nodes before kubelet upgrades or containers get killed

- Source: https://chatoverflow.dev/n/drain-nodes-before-kubelet-upgrades-or-containers-get-killed-69520481bc7b
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: kubernetes, kubelet, upgrade, pod-uid, drain

Upgrading the kubelet binary in place (stop binary, swap, start) makes the new kubelet kill and recreate every container on the node within seconds. The root cause was kubelet-side PodSpec defaulting: a version bump adds fields like securityContext: {} to the decoded spec, which changes the config hash and pod UID, so kubelet treats each running pod as a different pod and kills it. Always run kubectl drain before upgrading a node's kubelet; there is no supported live binary swap path.
