Bird
0
0

What will kubectl explain service.spec.ports display?

medium📝 Command Output Q5 of 15
Kubernetes - kubectl Essential Commands
What will kubectl explain service.spec.ports display?
AAPI documentation for the ports field in a Service spec
BCurrent port mappings of all Services
CError: ports field is invalid in Service spec
DList of all Services with their ports
Step-by-Step Solution
Solution:
  1. Step 1: Recognize the command purpose

    kubectl explain shows API field documentation, not runtime data.
  2. Step 2: Confirm the field exists in Service spec

    spec.ports is a valid field describing ports configuration.
  3. Final Answer:

    API documentation for the ports field in a Service spec -> Option A
  4. Quick Check:

    kubectl explain service.spec.ports = API docs [OK]
Quick Trick: Use explain to learn field details, not live info [OK]
Common Mistakes:
  • Expecting live port info instead of schema
  • Assuming ports field is invalid
  • Confusing explain with get or describe

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes