Terraform & IaC (50 Qs)•Part 3: Kubernetes Infrastructure as Code & GitOps (31 - 42)
Autoscaling in Kubernetes: HPA vs. VPA vs. Karpenter.
senior LevelMost AskedKubernetes
In Simple Words:
- HPA (Horizontal Pod Autoscaler): Adds or removes pod replicas based on CPU, memory, or custom metrics (e.g. queue depth).
- VPA (Vertical Pod Autoscaler): Adjusts CPU and memory requests/limits of existing containers over time.
- Karpenter: High-speed node auto-provisioner. Watches for unschedulable pending pods and launches right-sized EC2 instances directly via AWS APIs in under 60 seconds, bypassing slow ASG scaling groups.