Kubernetes pods OOMKilled while node shows 80GB free memory on Ubuntu 20.04 (kubelet+Docker cgroup mismatch suspected)
Environment
On-prem Kubernetes 1.23 control plane, 5 worker nodes (Ubuntu 20.04, Docker 20.10.12, kubelet configured with cgroupDriver=systemd). Workers: 128GB RAM, 32 vCPU. Applications deployed as Deployments with requests/limits set (example: request=512Mi, limit=2Gi). No node swap configured in cloud-init.
Symptoms
Application Pods abruptly terminate with status OOMKilled during short CPU/memory bursts. Restarts clustered to particular Deployments during load spikes; problem appears after a recent OS package update and Docker restart. End users report 502s from the service for ~10–60s until pods restart.
Observations
kubectl describe pod shows ContainerStatus: Terminated, Reason=OOMKilled, ExitCode=137. top/htop on node shows >80GB free memory. free -m and vmstat show low overall memory pressure. dmesg contains OOM kill messages referencing PIDs belonging to container processes. kubectl top node reports substantial usage but not exhausted. /sys/fs/cgroup/memory/docker/<container-id>/memory.limit_in_bytes exists and matches expected limit for some containers; for others the cgroup path is missing or not populated.
Already attempted
Restarted Docker and kubelet on affected nodes (briefly mitigated for 1–2 hours). Scaled the Deployments up/out to distribute load (reduced frequency but not eliminated OOMs). Added temporary higher memory limits in Deployment yaml and reapplied (containers still OOMKilled after a short period). Ran kubelet --version and docker info to confirm versions; reviewed recent apt upgrade list (kernel and systemd packages updated).
Question
What is the most likely reason Kubernetes containers are being OOMKilled when the host shows plenty of free RAM, and what safe diagnostics and reversible configuration checks should I run to identify whether this is a cgroup accounting/enforcement problem versus an application memory leak?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Cloud Computing41% match
Kubernetes pods repeatedly OOM-killed even though node has ample free memory — cgroup vs kubelet limit mismatch
Open0 answers - Cloud Computing29% match
Kubernetes StatefulSet pods fail to mount Ceph PVCs on nodes upgraded to newer kubelet: 'failed to find device' in kubelet logs
Open0 answers - Cloud Computing25% match
Kubernetes pods CrashLoopBackOff only on upgraded nodes with hugepages enabled — short lived OOM at container startup
Open0 answers - Cloud Computing25% match
CoreDNS resolution breaks inside pods after kube-proxy switch to IPVS on Debian worker nodes
Open0 answers - Cloud Computing24% match
Kubernetes PVCs stuck Pending after node migration — CSI node plugin fails to register with kubelet
Open0 answers