Bird
0
0

You applied this YAML but get an error:

medium📝 Debug Q7 of 15
Kubernetes - Services
You applied this YAML but get an error:
apiVersion: v1
kind: Service
metadata:
  name: ext
spec:
  type: ExternalName
  selector:
    app: web
  externalName: web.example.com

What is wrong?
AExternalName services should not have a selector field
BexternalName must be a cluster IP address
Ctype must be ClusterIP for externalName to work
Dmetadata name cannot be 'ext'
Step-by-Step Solution
Solution:
  1. Step 1: Review ExternalName service spec rules

    ExternalName services do not use selectors because they do not route to pods.
  2. Step 2: Identify invalid field usage

    Including a selector causes an error as it conflicts with ExternalName semantics.
  3. Final Answer:

    ExternalName services should not have a selector field -> Option A
  4. Quick Check:

    No selector allowed in ExternalName spec [OK]
Quick Trick: Remove selector from ExternalName service spec [OK]
Common Mistakes:
  • Adding selector to ExternalName service
  • Expecting externalName to be IP
  • Changing service type incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes