Q: Your HPA (Horizontal Pod Autoscaler) is not scaling up even though CPU usage is high. Why?
HPA needs metrics-server to be installed and working. Without it, HPA can't read CPU/memory metrics and shows <unknown> in kubectl get hpa.
Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "In one of our high-traffic production clusters, our SRE team handled this incident using a standardized runbook. The interviewer is testing: HPA prerequisites and metrics-server dependency.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."
Initial Diagnostics & Root Cause Analysis
HPA needs metrics-server to be installed and working. Without it, HPA can't read CPU/memory metrics and shows in kubectl get hpa.
kubectl get hpa— if it showsfor current metric, metrics-server is missing or broken./50% kubectl top pods— if this fails, metrics-server is the problem.- Also check that pods have resource requests defined — HPA calculates usage as a percentage of the request value. No requests = HPA can't calculate.
Remediation & Permanent Safeguards
Check: Fix: Install metrics-server, set resource requests on pods.
- kubectl get hpa — if it shows /50% for current metric, metrics-server is missing or broken.
- kubectl top pods — if this fails, metrics-server is the problem.
- Also check that pods have resource requests defined — HPA calculates usage as a percentage of the...
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Restarting a crashing container without examining preceding termination logs via kubectl logs --previous when configuring (Horizontal Autoscaler) scaling Restarting the pod flushes ephemeral container runtime state, destroying vital panic stack traces and fatal initialization logs.
-
Misdiagnosing an application boot crash as a failure of aggressive liveness probes when configuring (Horizontal Autoscaler) scaling
Liveness probes with short timeouts or high failure thresholds kill slow-starting applications repeatedly, causing false
CrashLoopBackOffloops. -
Neglecting node taints, tolerations, and resource quotas when diagnosing pods stuck in Pending when configuring (Horizontal Autoscaler) scaling
Pods remain
Pendingwhen scheduler predicates fail;kubectl describe podreveals whether CPU/memory exhaustion or taints prevent placement. - Invoking kubectl delete pod --force --grace-period=0 indiscriminately on unready pods when configuring (Horizontal Autoscaler) scaling Forced deletion bypasses kubelet cleanup and can cause multi-attach errors on PersistentVolumes (PVs) or split-brain on stateful workloads.