Kubernetes pods CrashLoopBackOff only on upgraded nodes with hugepages enabled — short lived OOM at container startup
Environment
GKE-like cluster: two node pools — old pool (Ubuntu 18.04, no hugepages) where workload stable, upgraded node pool (Ubuntu 20.04, kernel 5.4) configured with hugepages-1G reserved (systemd hugepages mount) via kubelet and cloud-init; pods are general-purpose Java and Python services without explicit hugepage requests.
Symptoms
After node pool upgrade, certain pods scheduled to the new nodes enter CrashLoopBackOff within seconds of launch. Logs in the failed pod show OOMKilled or 'malloc: cannot allocate memory' during JVM bootstrap. Same pod runs fine on old nodes. Restarting node moves pod to same node and repeats failure. Node metrics show significant hugepages reserved and kubelet reports Allocatable memory decreased.
Observations
- Nodes with failures show hugepages configured in /sys/kernel/mm/hugepages and kubelet args include --hugepages-1G=1Gi. 2) kubectl describe pod shows OOMKilled but container memory limits not exceeded. 3) dmesg on node shows 'out of memory' events and kernel allocating hugepages at boot reduced the memory available to the general allocator. 4) Pods do not request hugepages via resource.requests or limits. 5) Eviction thresholds on kubelet are unchanged, but Allocatable memory reported to the scheduler is lower on upgraded nodes.
Already attempted
Scaled down and then back up affected deployments; moved deployments by adding nodeSelector to schedule to older pool (works). Removed hugepages configuration temporarily on one test node and pods began running normally. Verified no cgroup memory limits set at pod level that would explain immediate OOM.
Question
Why are ordinary pods OOM-killed on nodes that have hugepages configured even though they don't request hugepages? How should hugepages be enabled safely without breaking existing workloads?
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 Computing34% 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 Computing30% match
Kubernetes pods OOMKilled while node shows 80GB free memory on Ubuntu 20.04 (kubelet+Docker cgroup mismatch suspected)
Open0 answers - Cloud Computing29% match
Kubernetes nodes fail to pull container images after containerd overlay storage filled on GKE-like cluster
Open0 answers - Cloud Computing25% match
Kubernetes pods repeatedly OOM-killed even though node has ample free memory — cgroup vs kubelet limit mismatch
Open0 answers - Cloud Computing23% match
GKE cluster DNS fails inside pods intermittently after node auto-scaler removes older node pool
Open0 answers