Recall & Review
beginner
What is a Horizontal Pod Autoscaler (HPA) in Kubernetes?
HPA automatically adjusts the number of pods in a deployment or replica set based on observed CPU utilization or other select metrics to keep applications running smoothly.
Click to reveal answer
beginner
Which metric is most commonly used by HPA to scale pods?
CPU utilization is the most common metric used by HPA to decide when to add or remove pods.
Click to reveal answer
intermediate
What command creates a Horizontal Pod Autoscaler for a deployment named 'webapp' targeting 50% CPU usage?
kubectl autoscale deployment webapp --cpu-percent=50 --min=1 --max=5
Click to reveal answer
beginner
What happens if the CPU usage goes above the target set in HPA?
HPA increases the number of pods to distribute the load and reduce CPU usage per pod.
Click to reveal answer
intermediate
Can Horizontal Pod Autoscaler scale based on custom metrics other than CPU?
Yes, HPA can scale pods based on custom metrics like memory usage, request rate, or any metric exposed via the Kubernetes metrics API.
Click to reveal answer
What does Horizontal Pod Autoscaler adjust in Kubernetes?
✗ Incorrect
HPA changes the number of pods to handle load, not CPU speed or nodes.
Which command creates an HPA for deployment 'app' with max 10 pods and target 60% CPU?
✗ Incorrect
The correct syntax uses 'kubectl autoscale deployment' with --cpu-percent, --min, and --max flags.
If CPU usage is below the target, what does HPA do?
✗ Incorrect
HPA reduces the number of pods to save resources when CPU usage is low.
Which Kubernetes API is required for HPA to get metrics?
✗ Incorrect
HPA relies on the Metrics API to fetch CPU and custom metrics.
Can HPA scale pods based on memory usage?
✗ Incorrect
HPA supports custom metrics like memory if properly configured.
Explain how Horizontal Pod Autoscaler helps maintain application performance in Kubernetes.
Think about how adding or removing pods affects workload handling.
You got /4 concepts.
Describe the steps to create and verify a Horizontal Pod Autoscaler for a deployment.
Focus on commands and what you check after creation.
You got /4 concepts.