Challenge, Easy,  on  Kubernetes

Resolve OOMKilled Errors by Reading VPA Memory Recommendations

Scenario

A Deployment web-app is running in the production namespace with 2 replicas.
The web-container consumes more memory than the configured limit, causing repeated OOMKilled events.

A Vertical Pod Autoscaler (VPA) web-app-vpa is already configured for this Deployment with updateMode: Off, meaning it only provides resource recommendations and does not automatically update the Deployment.


Task

  1. Check the VPA recommendation for the web-container.
  2. Update the Deployment web-app to apply the VPA Target recommended memory request and memory limit.
  3. Ensure the Deployment rollout completes successfully and the replica count remains 2.

Do not modify CPU values (they must remain 50m). Wait a few minutes for the VPA to collect metrics before checking recommendations.


Hint 1

Use kubectl describe pod to identify OOMKilled containers and kubectl describe vpa web-app-vpa -n production to view resource recommendations. Apply the recommended values using kubectl set resources or by editing the Deployment directly.

See the official docs: Vertical Pod Autoscaler


Test Cases