In Kubernetes, what is the primary function of a service of type ExternalName?
Think about how Kubernetes can redirect service requests to names outside the cluster.
An ExternalName service does not create endpoints or proxy traffic. Instead, it returns a DNS CNAME record that points to an external DNS name, allowing services inside the cluster to access external services by a Kubernetes service name.
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?
ExternalName services return a DNS alias, not direct IP addresses.
ExternalName services return a CNAME DNS record that points to the externalName specified. This allows pods to resolve the service name to the external DNS name transparently.
Which YAML snippet correctly defines an ExternalName service named db-service that points to db.example.org?
Remember the service type must be ExternalName and no clusterIP or load balancer is needed.
Only option A correctly sets the service type to ExternalName and specifies the externalName field. Other options either use wrong types or include invalid fields.
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?
ExternalName relies on external DNS resolution.
ExternalName services depend on the external DNS name being resolvable. If the DNS name does not exist or is unreachable, pods will get DNS errors. Selector labels and clusterIP do not affect ExternalName services.
When using ExternalName services to access external resources, which practice improves security and reliability?
Think about controlling access and DNS resolution scope.
Using private DNS names scoped to the cluster network and applying network policies limits exposure and improves security. Using IP addresses or disabling DNS caching are not recommended practices for ExternalName services.