nerdexam
Linux_Foundation

KCNA · Question #216

Which are the two primary modes for Service discovery within a Kubernetes cluster?

The correct answer is A. Environment variables and DNS. Within a Kubernetes cluster, the two primary methods for service discovery are through automatically injected environment variables and the cluster's internal DNS service.

Submitted by fernanda_arg· May 4, 2026Kubernetes Fundamentals

Question

Which are the two primary modes for Service discovery within a Kubernetes cluster?

Options

  • AEnvironment variables and DNS
  • BAPI Calls and LDAP
  • CLabels and Radius
  • DSelectors and DHCP

How the community answered

(32 responses)
  • A
    91% (29)
  • B
    6% (2)
  • D
    3% (1)

Why each option

Within a Kubernetes cluster, the two primary methods for service discovery are through automatically injected environment variables and the cluster's internal DNS service.

AEnvironment variables and DNSCorrect

Kubernetes services are discoverable by client Pods primarily through two mechanisms: environment variables, which are automatically populated with service details for newly created Pods, and a cluster DNS service that provides stable DNS entries for all Services.

BAPI Calls and LDAP

While the Kubernetes API can be queried for service information, it is not considered a primary direct service discovery mode for applications, and LDAP is unrelated to Kubernetes service discovery.

CLabels and Radius

Labels are used by Kubernetes to organize and select resources, including Pods for a Service, but they are not a direct service discovery mechanism for applications, and Radius is an authentication protocol, not for service discovery.

DSelectors and DHCP

Selectors are used to define which Pods belong to a Service, but they are not a service discovery mechanism, and DHCP is a protocol for IP address assignment, unrelated to Kubernetes service discovery.

Concept tested: Kubernetes service discovery mechanisms

Source: https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services

Topics

#Service Discovery#Kubernetes Services#DNS#Environment Variables

Community Discussion

No community discussion yet for this question.

Full KCNA Practice