Fixing a kubelet Memory Leak in Kubernetes 1.36
Summary
This article details a real-world memory leak in Kubernetes 1.36 related to kubelet, traced to a Go context handling change. It describes using Go pprof for heap profiling to identify leaked contexts, identifies the root cause in startPodSync, and outlines patching efforts, collaboration with Kubernetes maintainers, and a concise timeline of fixes. It offers practical lessons on memory profiling, code review, and patch backporting for production clusters.