docker - 从服务发现的角度来看,docker swarm 与 kubernetes 之间有什么区别

标签 docker kubernetes docker-swarm

有人可以让我知道,服务发现是如何在 docker swarm 和 kubernetes 中发生的,以了解差异,或者即使有任何来源(如书籍或文档)解释了这一点,然后分享它

最佳答案

我能找到therethere

Kubernetes 与 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

kubernetes 中有提供有关服务发现信息的示例.

更多信息来自 kubernetes documentation .


Docker 集群

docker swarm 中有提供有关服务发现信息的示例.

有关于如何使用的培训Service Discovery under Docker Swarm Mode .

还有来自 linux tutorials 的更多信息.

关于docker - 从服务发现的角度来看,docker swarm 与 kubernetes 之间有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59226410/

相关文章:

docker - 在 dokku 上运行 docker 镜像

docker - 如何查看docker网络中的所有域

maven - 在kubernetes上的Jenkinsfile Maven构建中正确覆盖 "settings.xml"吗?

amazon-web-services - 在 AWS 的 Docker 中找不到节点的 Docker 根目录

docker - cpu限制后失败docker容器

mongodb - Docker:Mongo 在运行时退出

networking - Docker - curl 返回 "connection reset"

node.js - Minikube 和 docker 上的开发工作流程

docker - 其他PC无法访问K8S仪表板

Docker 数据卷容器 - 我可以跨 swarm 共享吗