Skip to main content
Welcome. In this lesson we’ll work through a hands-on lab for the Vertical Pod Autoscaler (VPA). The goal is to deploy a simple Flask application as a single-replica Deployment and observe how VPA (or a manual update) adjusts Pod resource requests. When resource requests change, Kubernetes replaces the existing Pod with a new Pod that reflects the updated resource settings. Environment overview:
  • A Kubernetes cluster runs a Deployment that manages a single Pod for the Flask application.
  • Users access the application from outside the cluster.
A simple lab overview diagram of a Kubernetes cluster, showing a Deployment containing a pod. Arrows indicate a user accessing the pod from outside the cluster.
Getting started
  1. Apply the Deployment manifest to create (or update) the Flask application:
  1. Typical kubectl output after applying a manifest:
  1. Inspect Pods to observe how Kubernetes replaces Pods when resource requests change:
Example output you may see:
Why Pods are recreated
  • Kubernetes treats resource requests (CPU/memory) as immutable for a running Pod. To change those values, the Pod must be terminated and a new Pod created with the updated requests.
  • VPA can observe resource usage and either propose new requests or automatically apply them. When VPA applies a change, the Pod is evicted and re-scheduled with the new resource requests.
VPA observes resource usage and can propose or apply new resource requests for Pods. When requests change, Pods are typically recreated (evicted and re-scheduled) so the new resource requests take effect.
Quick summary of the lab
  • Deploy a single-replica Flask application using a Deployment.
  • Apply an updated Deployment (or accept a VPA recommendation) that increases the Pod’s resource requests.
  • Kubernetes terminates the old Pod and brings up a new Pod with the larger resource allocation.
  • This illustrates how Vertical Pod Autoscaler helps automate Pod resizing and simplifies resource management.
Steps & expected behavior Useful commands
  • Check Deployment status:
  • Describe the new Pod to verify requests:
  • View VPA recommendations (if VPA is installed):
Links and references This lab demonstrates the core behavior of VPA-driven resizing: resource request changes result in Pod recreation so the scheduler can place the new Pod with appropriate resources.

Watch Video

Practice Lab