DCA · Question #22
Which of the following modes can be used for service discovery of a Docker swarm service (Pick 2 correct answers)
The correct answer is A. Virtual IP (VIP) with --endpoint-mode vip C. DNS Round-Robin with --endpoint-mode dnsrr. Docker Swarm services support Virtual IP (VIP) and DNS Round-Robin (DNS RR) as modes for internal service discovery and load balancing.
Question
Which of the following modes can be used for service discovery of a Docker swarm service (Pick 2 correct answers)
Options
- AVirtual IP (VIP) with --endpoint-mode vip
- BOverlay with --endpoint-mode overlay
- CDNS Round-Robin with --endpoint-mode dnsrr
- DIngress with --endpoint-mode ingress
- ENetwork Address Translation(NAT) with --endpoint-mode nat
How the community answered
(32 responses)- A88% (28)
- B6% (2)
- D3% (1)
- E3% (1)
Why each option
Docker Swarm services support Virtual IP (VIP) and DNS Round-Robin (DNS RR) as modes for internal service discovery and load balancing.
The `--endpoint-mode vip` uses a single virtual IP address for the service, and Swarm's internal load balancer distributes incoming requests to the service's healthy tasks, providing a stable endpoint.
`overlay` refers to a network driver type, not a specific endpoint mode for service discovery within Docker Swarm.
The `--endpoint-mode dnsrr` (DNS Round-Robin) uses DNS queries to return a list of IP addresses for all healthy service tasks. Clients then perform their own load balancing by selecting an IP from the list to connect directly.
`ingress` is a type of network used for external access to Swarm services, not an endpoint mode for internal service discovery and load balancing.
`nat` (Network Address Translation) is a general networking concept and not a specific endpoint mode for Docker Swarm service discovery.
Concept tested: Docker Swarm service endpoint modes
Source: https://docs.docker.com/engine/reference/commandline/service_create/#endpoint-mode
Topics
Community Discussion
No community discussion yet for this question.