Interview Prep/Kubernetes/Resources, OOM, probes and termination

After enabling VPA in `Auto` mode, Pods are evicted and recreated repeatedly.

AdvancedTroubleshootingResources, OOM, probes and termination
Answer

Likely causes → VPA updater evicts Pods to apply new recommendations. With bursty usage the recommendation changes often, and an HPA scaling on the same CPU/memory metric fights it.

Diagnose →

kubectl describe vpa api | sed -n '/Recommendation/,$p'
kubectl get events --field-selector reason=EvictedByVPA -A
kubectl get hpa api -o yaml | yq '.spec.metrics'

Fix → Switch VPA to updateMode: "Off" (recommendations only) or Initial, set minAllowed/maxAllowed, and never combine VPA with an HPA on the same resource metric.

Prevent → Use VPA as a recommender feeding manifest changes in Git; let HPA handle replica count.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination