Bird
0
0

What will be the output of this command?

medium📝 Command Output Q5 of 15
Kubernetes - ReplicaSets and Deployments
What will be the output of this command?
kubectl get deployment backend -o jsonpath='{.spec.replicas}'
Assuming the deployment is scaled to 3 replicas.
Areplicas
Bbackend
C3
DError: jsonpath not found
Step-by-Step Solution
Solution:
  1. Step 1: Understand jsonpath query

    The query extracts the replicas count from deployment spec.
  2. Step 2: Match with scaled replicas

    Since deployment is scaled to 3, output is '3'.
  3. Final Answer:

    3 -> Option C
  4. Quick Check:

    jsonpath replicas value = 3 [OK]
Quick Trick: jsonpath '{.spec.replicas}' shows replica count [OK]
Common Mistakes:
  • Expecting deployment name as output
  • Confusing field names in jsonpath
  • Mistyping jsonpath causing errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes