Bird
0
0

What is the output of kubectl get svc ext-svc -o yaml for an ExternalName service named ext-svc with externalName db.example.com?

medium📝 Command Output Q5 of 15
Kubernetes - Services
What is the output of kubectl get svc ext-svc -o yaml for an ExternalName service named ext-svc with externalName db.example.com?
Aspec: type: ExternalName externalName: db.example.com clusterIP: ""
Bspec: type: ExternalName externalName: db.example.com
Cspec: type: ExternalName externalName: db.example.com clusterIP: None
Dspec: type: ClusterIP externalName: db.example.com
Step-by-Step Solution
Solution:
  1. Step 1: Recall ExternalName service spec output

    ExternalName services show type: ExternalName and externalName field; clusterIP is not set or shown.
  2. Step 2: Evaluate options

    The snippet showing only type: ExternalName and externalName: db.example.com correctly matches the spec. Snippets including clusterIP incorrectly add it to spec. The snippet with type: ClusterIP has the wrong type.
  3. Final Answer:

    spec with type ExternalName and externalName only -> Option B
  4. Quick Check:

    kubectl get svc shows type and externalName only [OK]
Quick Trick: ExternalName services do not have clusterIP set [OK]
Common Mistakes:
  • Expecting clusterIP field to be set
  • Confusing service type with ClusterIP
  • Including ports or selectors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes