Bird
0
0

Given this HPA YAML snippet:

medium📝 Command Output Q13 of 15
Kubernetes - Resource Management
Given this HPA YAML snippet:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: myapp-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: myapp
  minReplicas: 1
  maxReplicas: 4
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 60

What happens if the CPU usage stays at 80% for a while?
AThe number of pods will increase up to 4 to reduce CPU load
BThe number of pods will decrease to 1
CThe number of pods will stay the same regardless of CPU
DThe deployment will be deleted automatically
Step-by-Step Solution
Solution:
  1. Step 1: Understand HPA scaling behavior

    HPA increases pods when CPU usage exceeds target averageUtilization (60%). Here CPU is 80%, which is higher.
  2. Step 2: Check min and max replicas limits

    Pods can scale between 1 and 4. Since CPU is high, pods will increase up to max 4 to reduce load.
  3. Final Answer:

    The number of pods will increase up to 4 to reduce CPU load -> Option A
  4. Quick Check:

    CPU > target => pods increase [OK]
Quick Trick: CPU above target means pods scale up within min-max [OK]
Common Mistakes:
  • Thinking pods scale down when CPU is high
  • Ignoring min/max replica limits
  • Assuming deployment deletion on high CPU

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes