0
0
Kubernetesdevops~5 mins

Horizontal Pod Autoscaler in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ANumber of pods
BPod CPU speed
CNode count
DContainer image version
Which command creates an HPA for deployment 'app' with max 10 pods and target 60% CPU?
Akubectl autoscale deployment app --cpu-percent=60 --min=1 --max=10
Bkubectl scale deployment app --cpu=60 --max=10
Ckubectl set hpa app --cpu=60 --max=10
Dkubectl create hpa app --cpu=60 --max=10
If CPU usage is below the target, what does HPA do?
AIncreases pods
BDecreases pods
CRestarts pods
DDoes nothing
Which Kubernetes API is required for HPA to get metrics?
AAuthentication API
BStorage API
CNetworking API
DMetrics API
Can HPA scale pods based on memory usage?
AOnly if pods use less than 50% memory
BNo, only CPU is supported
CYes, with custom metrics configured
DOnly on nodes with special labels
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.