| 确认 | kubectl get pod -o jsonpath 取 lastState.terminated.reason |
|---|---|
| 对比 | limits.memory vs kubectl top/监控峰值 |
| 节点侧 | 节点内存压力也可能杀:查 dmesg 与 kubelet 事件 |
| 常见修正 | 调大 limit、修内存泄漏、控制缓存与并发 |
| 预防 | requests≈limits、压测与内存告警 |
排查命令
排查命令
kubectl get pod web-1 -o jsonpath='{.status.containerStatuses[0].lastState}'
kubectl top pod web-1
kubectl describe pod web-1 | grep -i oom
kubectl describe node node-1 | grep -i memory | head只把 limit 调大:应用增长曲线没变,早晚再次撞墙;上线前按峰值内存的 1.3-1.5 倍设限更稳。