Bird
0
0

What is the output of the command kubectl get pods --field-selector spec.nodeName=node1?

medium📝 Command Output Q5 of 15
Kubernetes - Scheduling
What is the output of the command kubectl get pods --field-selector spec.nodeName=node1?
ALists all Pods currently scheduled on node1
BLists all Pods with label nodeName=node1
CShows all nodes named node1
DDisplays Pods in Pending state only
Step-by-Step Solution
Solution:
  1. Step 1: Understand field-selector usage

    The field selector filters Pods by the node they are assigned to, here node1.
  2. Step 2: Differentiate from label selector

    Labels are different from fields; this command filters by spec.nodeName field.
  3. Final Answer:

    Lists all Pods currently scheduled on node1 -> Option A
  4. Quick Check:

    Field selector spec.nodeName filters Pods by node [OK]
Quick Trick: Use field-selector to filter Pods by assigned node [OK]
Common Mistakes:
  • Confusing field-selector with label-selector
  • Expecting node list instead of Pods
  • Assuming it shows only Pending Pods

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes