Skip to main content
Welcome — this lesson runs a full Vertical Pod Autoscaler (VPA) lab so you can observe recommendations and automated updates in action. We’ll deploy a sample Flask app, apply a VPA, generate load, and watch how the updater accepts recommendations and evicts pods to apply new resource requests. High-level sequence:
  • Deploy the sample Flask application (Deployment + Service).
  • Apply a VPA with updateMode: Off to collect recommendations only.
  • Generate load against the app so VPA can observe usage.
  • Inspect the VPA updater logs while Off to confirm no evictions occur.
  • Switch the VPA to Auto (or Recreate) to enable automatic application.
  • Watch the updater evict pods and confirm new pods run with updated requests.
A slide titled "Lab Steps" showing a vertical timeline with four numbered tasks: 01 Deploy Application, 02 Deploy VPA Configuration, 03 Initiate Load Test, and 04 Monitor Logs. The left side has a teal gradient panel with the title and the right side lists the steps with colorful numbered markers.
Summary of the demo flow: For more on VPA concepts, see the Kubernetes docs: Vertical Pod Autoscaler.
A presentation slide titled "Lab Steps" with a blue gradient panel on the left. On the right are two numbered steps: "05 Update VPA Configuration" and "06 Monitor Logs to see VPA in action."

1) Deploy the sample app

Apply the manifest for the sample Flask application. The manifest creates both a Deployment and a Service so the app can be load-tested.
Expected output:
Confirm the Deployment and Service are created and pods are running before proceeding.

2) VPA configuration (initial)

Create a VPA that targets the flask-app Deployment. Start with updateMode: Off so the VPA only computes and exposes recommendations without evicting pods.
This manifest:
  • Targets the flask-app Deployment.
  • Uses updateMode: Off so the updater will not evict pods (only recommendations are generated).
  • Sets minAllowed and maxAllowed to constrain suggestions.
  • Controls cpu and memory resources.
Apply the VPA manifest:
Inspect VPA recommendations and bounds:
Sample (truncated) kubectl describe vpa output:
At this stage the updater provides recommendations but does not evict or modify pods.

3) Start a load test

Generate traffic so the VPA collects realistic resource usage metrics. For this lab the provided script is used:
Sample console output (repeated responses):
Allow the load to run for several minutes so VPA accumulates observations and refines its recommendations.

4) Inspect the VPA updater logs (while updateMode is Off)

While updateMode remains Off, confirm the updater is collecting data but not evicting pods. Identify the updater pod name (example shown below uses vpa-updater-59469d986c-gw5jf — replace with your pod name):
Example logs showing the updater skipping VPA objects that aren’t in an active update mode:
VPA behavior is split into two concerns: (1) computing recommendations based on observed usage, and (2) applying those recommendations by evicting pods so new pods start with updated requests. updateMode: Off disables automatic application; use Auto or Recreate to enable eviction and automatic application.

5) Enable automatic updates

When you’re ready for the VPA to apply recommendations, change updateMode to Auto (or Recreate if you require a different eviction behavior). Editing in-place:
Change the updatePolicy block to:
Verify the change:
Expected output:
Enabling Auto (or Recreate) will allow the VPA updater to evict pods to apply recommended resource requests. Be prepared for transient pod restarts and possible brief disruptions to service. Use during maintenance windows if running in production.

6) Watch the updater apply recommendations

With Auto enabled and load in effect, the updater will accept recommendations, evict selected pods, and let the Deployment create new pods with the updated resource requests. Tail the updater logs again to observe this flow:
Example log lines showing accepted recommendations and eviction events:
These lines show the updater computed a target CPU (~587m) and evicted pods so the Deployment could recreate them with the new resource requests.

7) Confirm new pods are running with updated resource requests

After evictions and recreations, list pods and verify ages and resource requests. New pods created after eviction will have a low AGE value:
Example output:
To inspect the resource requests of a pod’s containers, describe the pod or check the Deployment’s pod template after the VPA has updated the requests:
Look for the resources.requests fields to verify they reflect the VPA recommendations.
That completes the end-to-end demo. You can now practice applying VPA manifests, generating load, and watching the updater behavior. For additional reading, consult:

Watch Video

Practice Lab