Bird
0
0

You applied this HPA YAML but it does not scale pods as expected:

medium📝 Troubleshoot Q14 of 15
Kubernetes - Resource Management
You applied this HPA YAML but it does not scale pods as expected:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: test-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: test-app
  minReplicas: 2
  maxReplicas: 5
  metrics:
  - type: Resource
    resource:
      name: memory
      target:
        type: Utilization
        averageUtilization: 70

What is the most likely reason for no scaling?
AThe pods do not expose memory metrics, so HPA has no data
BminReplicas is set too low
CmaxReplicas is less than minReplicas
DThe deployment name is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Check metric type and data availability

    HPA needs metrics from pods. If memory metrics are not exposed or collected, HPA cannot scale.
  2. Step 2: Verify other spec values

    minReplicas and maxReplicas are valid (2 and 5). Deployment name looks correct. So likely missing metrics cause no scaling.
  3. Final Answer:

    The pods do not expose memory metrics, so HPA has no data -> Option A
  4. Quick Check:

    Missing metrics = no scaling [OK]
Quick Trick: HPA needs metrics; no metrics means no scaling [OK]
Common Mistakes:
  • Assuming minReplicas too low stops scaling
  • Confusing minReplicas and maxReplicas values
  • Ignoring metric availability

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes