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.
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)- A91% (29)
- B6% (2)
- D3% (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.
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.
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.
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.
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
Community Discussion
No community discussion yet for this question.