VPA recommender misses OOM signal when pod is recreated too fast (updateMode: Recreate), so memory recommendation never bumps
Author: qudongfangCreated Sep 25, 2026Updated Sep 29, 2026
Labelsarea/vertical-pod-autoscalerkind/bugtriage/accepted
**Which component are you using?**:
/area vertical-pod-autoscaler
**What version of the component are you using?**:
[1.7.2](https://github.com/kubernetes/autoscaler/releases/tag/vertical-pod-autoscaler-1.7.2)
Component version:
**What k8s version are you using (`kubectl version`)?**:
**What environment is this in?**:
EKS
**What did you expect to happen?**:
When a container is OOMKilled, the VPA recommender should detect the OOM and inject an artificial memory sample into the container's AggregateMemoryPeaks histogram (via RecordOOM, bumped by max(request * OOMBumpUpRatio, request + OOMMinBumpUp)), so the memory recommendation rises and the recreated pod gets a higher memory request. This should hold even when the pod is recreated quickly.
**What happened instead?**:
With updateMode: Recreate, a pod gets OOMKilled and is recreated so fast that the recommender never observes the OOM. The memory recommendation is not bumped, the new pod starts with the same (too-low) memory request, and the pod enters an OOM loop with no VPA intervention.
**How to reproduce it (as minimally and precisely as possible)**:
1. Create a VPA with updateMode: Recreate targeting a Deployment.
2. Run a container whose memory request is intentionally too low, with a workload that spikes memory quickly and reliably triggers an OOM shortly after start.
3. Let the pod OOM and be recreated by the workload controller in a tight loop (sub-second to low-second recreation).
4. Observe kubectl describe vpa — Status.Recommendation.containerName.memory.target does not increase despite repeated OOMs.
5. Observe the recommender logs: no OOM is recorded for the container (no RecordOOM / artificial sample insertion), and the checkpoint's memory histogram does not gain an elevated bucket.
**Anything else we need to know?**:
It seems that root cause is in the recommender's OOM observer (pkg/recommender/input/oom/observer.go) and pod feed (pkg/recommender/input/cluster_feeder.go): The recommender only learns about OOMs from pod OnUpdate events on containerStatuses (OOMKilled in State. Terminated or LastTerminationState.Terminated). It does not consume OOMKilled Kubernetes Events, kubelet, or Prometheus.
kubectl version Output
$ kubectl version
Source: kubernetes/autoscaler