Kubernetes offers both Horizontal (HPA) and Vertical (VPA) pod autoscaling. Learn vocabulary for VPA update modes (Off/Initial/Recreate/Auto), HPA metric APIs, the VPA+HPA conflict pattern, custom and external metrics, and the minAllowed/maxAllowed resource bounds.
0 / 5 completed
1 / 5
An engineer runs both VPA and HPA on the same Deployment, both targeting CPU utilization. What conflict arises?
Running VPA (which mutates CPU requests) alongside HPA targeting CPU utilization creates a feedback loop: VPA raises requests → HPA sees lower utilization percentage → HPA scales down → fewer pods → VPA adjusts again. The recommended pattern is to use HPA for CPU/memory utilization and VPA for other custom metrics, or use VPA in Off mode for recommendations only.
2 / 5
A VPA object is set to updateMode: 'Initial'. When does it apply resource recommendations?
VPA updateMode: 'Initial' applies recommendations only at pod creation time (via admission webhook). Running pods are not evicted or modified. This is useful for workloads where you cannot tolerate unexpected pod restarts but want right-sized resources for new pods.
3 / 5
HPA v2 supports scaling on custom metrics. Which Kubernetes API group provides external metrics from sources like Datadog or Prometheus Adapter?
The external.metrics.k8s.io API group exposes metrics from sources external to the cluster (e.g., Datadog, SQS queue depth). custom.metrics.k8s.io exposes per-object custom metrics (e.g., requests-per-second on a Deployment). metrics.k8s.io provides built-in CPU/memory from metrics-server.
4 / 5
An HPA has minReplicas: 2 and maxReplicas: 10. Current replicas: 4, current CPU utilization: 30%, target: 50%. How many replicas will HPA calculate?
HPA applies a stabilization threshold: it only scales down if the desired replica count is less than 90% of current replicas (ratio ≤ 0.9). Here, desired = ceil(4 × 30/50) = ceil(2.4) = 3. Since 3/4 = 0.75 < 0.9, HPA would normally scale down to 3, but the correct answer per standard HPA math is 3 — however, with default scale-down stabilization window (5 minutes), the actual reduction is delayed. The calculated target is 3.
5 / 5
What does the VPA minAllowed field control?
minAllowed sets the floor for resource recommendations. VPA will never recommend CPU or memory below these values, even if the workload appears to use very little. This prevents recommendations that would starve containers of resources needed for startup, GC pauses, or burst traffic.