Join today

Hands-On Lab: Horizontal Pod Autoscaling in Kubernetes

Deploy a real Kubernetes autoscaler, generate load against a live service, and watch your cluster scale up and down automatically — then tune the HPA behavior for faster, more controlled responses.
🏅 Included in the PRO membership!
Write your awesome label here.

By completing this lab, you will be able to:

  • Deploy the Kubernetes Metrics Server and verify that CPU metrics are available for running pods
  • Configure a Horizontal Pod Autoscaler with replica bounds, a CPU utilization target, and a connection to a live deployment
  • Generate load against a running service and observe real-time scale-out behavior in a live cluster
  • Explain the stabilization window and why Kubernetes delays scale-in to prevent oscillation
  • Tune HPA scale-down behavior by configuring custom policies and validating the effect with a live test
What you are going to learn

From Static Deployments to Dynamic, Load-Driven Scaling

This lab puts you in the driver's seat of Kubernetes autoscaling. You will deploy the Metrics Server, configure a CPU-intensive application with proper resource requests, and create a Horizontal Pod Autoscaler targeting a specific CPU utilization threshold. You will then generate artificial load and watch the HPA respond in real time — adding replicas as demand rises and returning to minimum capacity once the load subsides.

By the end of the lab, you will understand how the HPA control loop works, why scale-in is intentionally slower than scale-out, and how the stabilization window protects your cluster against oscillation. You will go further by tuning the HPA behavior directly — reducing the default five-minute stabilization window to one minute and observing the effect immediately. You will leave with a practical, hands-on understanding of HPA that goes well beyond reading the documentation.

Recommended Courses

The following courses are highly recommended before tackling this lab. They will provide all the knowledge you need to understand everything that is discussed in the lab. That being said, if you are already familiar with Docker and its fundamentals (images, containers, build context, Dockerfiles, etc.), feel free to jump in right away!

Lab Contents