0
0
Kubernetesdevops~20 mins

ExternalName service type in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ExternalName Service Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What does an ExternalName service do in Kubernetes?

In Kubernetes, what is the primary function of a service of type ExternalName?

AIt creates a load balancer in the cloud provider to route traffic.
BIt exposes a service on a static IP address inside the cluster.
CIt forwards traffic to pods selected by labels within the cluster.
DIt maps a service to an external DNS name by returning a CNAME record.
Attempts:
2 left
💡 Hint

Think about how Kubernetes can redirect service requests to names outside the cluster.

💻 Command Output
intermediate
1:30remaining
Output of ExternalName service DNS lookup

Given this ExternalName service YAML:

apiVersion: v1
kind: Service
metadata:
  name: my-external
spec:
  type: ExternalName
  externalName: example.com

What is the expected DNS record type returned when a pod inside the cluster queries my-external.default.svc.cluster.local?

AAn A record with the IP address of example.com
BA CNAME record pointing to example.com
CAn SRV record for service discovery
DNo DNS record found error
Attempts:
2 left
💡 Hint

ExternalName services return a DNS alias, not direct IP addresses.

Configuration
advanced
2:00remaining
Correct ExternalName service YAML configuration

Which YAML snippet correctly defines an ExternalName service named db-service that points to db.example.org?

A
apiVersion: v1
kind: Service
metadata:
  name: db-service
spec:
  type: ExternalName
  externalName: db.example.org
B
apiVersion: v1
kind: Service
metadata:
  name: db-service
spec:
  type: ClusterIP
  externalName: db.example.org
C
apiVersion: v1
kind: Service
metadata:
  name: db-service
spec:
  type: ExternalName
  clusterIP: None
  externalName: db.example.org
D
apiVersion: v1
kind: Service
metadata:
  name: db-service
spec:
  type: LoadBalancer
  externalName: db.example.org
Attempts:
2 left
💡 Hint

Remember the service type must be ExternalName and no clusterIP or load balancer is needed.

Troubleshoot
advanced
2:00remaining
Why does an ExternalName service fail to resolve?

You created an ExternalName service pointing to nonexistent.example.com. Pods trying to access the service get DNS resolution errors. What is the most likely cause?

AThe externalName DNS does not exist or is unreachable from the cluster DNS resolver.
BThe service selector labels are missing, so no endpoints are created.
CThe service type ExternalName is not supported in the Kubernetes version used.
DThe clusterIP is set to None, causing DNS failures.
Attempts:
2 left
💡 Hint

ExternalName relies on external DNS resolution.

Best Practice
expert
2:30remaining
Best practice for using ExternalName services securely

When using ExternalName services to access external resources, which practice improves security and reliability?

ADisable DNS caching on pods to ensure fresh resolution of the externalName every time.
BUse ExternalName services only for internal cluster services to avoid external dependencies.
CUse a private DNS name that resolves only within the cluster network and configure network policies to restrict access.
DSet the externalName to a public IP address instead of a DNS name to avoid DNS resolution delays.
Attempts:
2 left
💡 Hint

Think about controlling access and DNS resolution scope.