What is the purpose of the ExternalName service type in Kubernetes?
ExternalName service type maps a Kubernetes service to an external DNS name. It allows pods to access services outside the cluster using a simple service name.
Click to reveal answer
intermediate
How does Kubernetes resolve an ExternalName service?
Kubernetes returns a CNAME record pointing to the external DNS name specified in the ExternalName service. The client then resolves this DNS name outside the cluster.
Click to reveal answer
beginner
Which field must be specified in the ExternalName service manifest?
The 'externalName' field must be set to the DNS name you want to map to, for example 'my.database.example.com'.
Click to reveal answer
intermediate
Can ExternalName services be used with selectors or endpoints?
No, ExternalName services do not use selectors or endpoints because they do not manage pods. They only provide DNS mapping to an external name.
Click to reveal answer
beginner
Give an example YAML snippet for an ExternalName service.
C. externalName must be a DNS name, not an IP address
D. Service type must be ClusterIP for IP addresses
Solution
Step 1: Check externalName field requirements
The externalName must be a valid DNS name, not an IP address.
Step 2: Identify error cause
Using an IP address like 123.45.67.89 in externalName is invalid and causes failure.
Final Answer:
externalName must be a DNS name, not an IP address -> Option C
Quick Check:
externalName = DNS name only [OK]
Hint: externalName must be a DNS name, not IP [OK]
Common Mistakes:
Using IP instead of DNS in externalName
Confusing service type rules
Omitting externalName field
5. You want pods in your cluster to access an external database at db.external.com using the service name external-db. You also want to ensure no IP or port is configured inside the cluster. Which is the best way to configure this?
hard
A. Create an ExternalName service named external-db with externalName: db.external.com
B. Create a ClusterIP service named external-db with selector matching database pods
C. Create a LoadBalancer service named external-db pointing to db.external.com IP
D. Create a NodePort service named external-db with targetPort set to database port
Solution
Step 1: Understand requirement for no IP or port inside cluster
ExternalName service maps a service name to an external DNS without IP or port configuration inside the cluster.
Step 2: Match requirement with service types
ClusterIP, LoadBalancer, and NodePort require IPs or ports inside the cluster, so they don't fit the requirement.
Final Answer:
Create an ExternalName service named external-db with externalName: db.external.com -> Option A
Quick Check:
ExternalName = external DNS, no IP/port config [OK]
Hint: Use ExternalName for external DNS without cluster IP/port [OK]
Common Mistakes:
Using ClusterIP or LoadBalancer for external DNS
Configuring ports inside the cluster unnecessarily
Not using ExternalName for external services
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.