What is the Difference between docker swarm vs kubernetes in service discovery point of view

12/7/2019

Could somebody let me know,how the service discovery happening in docker swarm and kubernetes to understand the difference or even if any source like books or docs which explains this then share it

-- user10912187
docker
docker-swarm
kubernetes

1 Answer

12/9/2019

As I could find there and there

Kubernetes vs. Docker Swarm

Docker Swarm and Kubernetes both offer different approaches to service discovery. In K8s you need to define containers as services manually. On the other hand, containers in Swarm can communicate via virtual private IP addresses and service names regardless of their underlying hosts.


Kubernetes network is flat, as it enables all pods to communicate with one another. In Kubernetes, the model requires two CIDRs. The first one requires pods to get an IP address, the other is for services.

In a Docker Swarm, a node joining a cluster creates an overlay network of services that span all of the hosts in the Swarm and a host only Docker bridge network for containers. In Docker Swarm, users have the option to encrypt container data traffic when creating an overlay network by on their own.


Kubernetes provides easy service organization with pods

With Kubernetes you don’t need to modify your application to use an unfamiliar service discovery mechanism. Kubernetes gives Pods their own IP addresses and a single DNS name for a set of Pods, and can load-balance across them.

Kubernetes

There is example which provide informations about service discovery in kubernetes.

And more informations from kubernetes documentation.


Docker swarm

There is example which provide informations about service discovery in docker swarm.

There is training about how to use Service Discovery under Docker Swarm Mode.

And some more informations from linux tutorials.

-- jt97
Source: StackOverflow