Prerequisites
- A Kubernetes cluster (v1.16+)
- Vertical Pod Autoscaler installed
kubectlconfigured against your cluster
1. Deploy the Flask Application
Apply the Deployment and Service manifests:| Resource | Purpose | Manifest |
|---|---|---|
| Deployment | Runs the Flask web application | deployment.yml |
| Service | Exposes the Flask application | service.yml |
2. Observe Pod Initialization
Immediately list the pods to see the initialization phase:Init:0/1 while it pulls the image and runs init containers.
3. Monitor the Pod Resize
After a moment, check the pods again:Manual updates to resource requests take effect immediately, but in production VPA performs these adjustments automatically based on real-time metrics.
4. How Vertical Pod Autoscaler Works
The Vertical Pod Autoscaler continuously monitors pod metrics and updates theirrequests and limits to match actual usage. In this exercise, updating the Deployment triggered a scale-up. In a production environment, VPA would automate these changes without manual intervention.
Manual resizing can cause brief downtime as pods restart. Always test resource changes in a staging environment before applying to production.