在深入研究Docker、谷歌Cloud和Kubernetes时,我还没有清楚地了解它们三个,在我看来,这些产品是重叠的,但它们并不兼容。

例如,docker-compose。yml文件需要重写,以便应用程序可以部署到Kubernetes。

谁能提供一个高层次的、粗略的描述,说明Docker、Docker Compose、Docker Cloud和Kubernetes在哪里重叠,在哪里相互依赖?


当前回答

Docker Compose is not a production ready tool. It works great for PoC or development environments, but lacks a lot of the capabilities that are more or less table stakes for serious production use. Swarm is more production-ready, but I would never invest into Swarm in a greenfield scenario. Kubernetes has won the orchestration battle, as evidenced by its inclusion into Docker Desktop and it being offered by all major cloud providers. Kubernetes is much more capable and has far more community and corporate support.

我建议你深入研究一些在Pluralsight、Linux Academy等网站上提供的Kubernetes教程,并在你选择的云平台(EKS、AKS、GKE等)上旋转一个集群。如果您试图在裸机上旋转,可以看看OpenShift,但要认识到在这种设置中您失去了Kubernetes的一些魔力。

其他回答

如果你在同一个主机上连接容器,请使用docker compose。

如果您正在跨多个主机连接容器,请使用kubernetes。

首先是容器引擎和容器编排器之间的区别。

docker是一个容器引擎,它让你构建和运行通常最多不超过一个容器,在你的PC本地用于开发目的。

Docker -compose是一个Docker工具,可以运行多个容器,让它们通过Docker引擎特性共享卷和网络,本地运行以模拟服务组合,远程运行在集群上。

Kubernetes是一个容器编排平台,它负责运行容器并增强引擎功能,以便容器可以组合和扩展以服务于复杂的应用程序(类似于PaaS,由您或云提供商管理)。Kubernetes的主要功能是将基础设施与使用容器的应用程序分离开来,它也对Docker的其他引擎开放,例如它可以使用rkt或cro运行容器。

Docker云也是一种PaaS服务,它可以让你通过Docker引擎API运行和编排容器。

现在,根据您的需求,对基础设施和目标受众的控制水平,您可以在baremetal上使用Kubernetes,或Azure ACS或谷歌GKE等…

希望这对你有所帮助。 问候

容器:

容器是这里列出的其他技术的核心

码头工人:

Docker是一种流行的技术实现,它允许将应用程序捆绑到容器中。 Docker是一个命令行工具,用于管理映像、容器、卷和网络

码头工人组成

Docker Compose是Docker cli的声明式版本 它可以启动一个或多个容器 它可以创建一个或多个网络并将容器附加到这些网络上 它可以创建一个或多个卷,并配置容器来挂载它们 所有这些都用于单个主机

Docker经典蜂群

Docker swarm has been abandoned by Docker Inc. and is not being actively maintained or supported. Docker Swarm is for running and connecting containers on multiple hosts. Docker Swarm is a container cluster management and orchestration tool. It manages containers running on multiple hosts and does things like scaling, starting a new container when one crashes, networking containers ... The Docker Swarm file named stack file is very similar to a Docker Compose file The only comparison between Kubernetes and Compose is at the most trivial and unimportant level: they both run containers, but this says nothing to help one understand what the two tools are and where they are useful. They are both useful for different things

Kubernetes

Kubernetes (K8S) is a distributed container orchestration tool initially created by Google It was open-sourced in 2014 and handed over to the Cloud Native Computing Foundation (CNCF) the following year The CNCF is an industry body with hundreds of members drawn from the majority of large cloud, software and hardware companies At the time of writing (late 2021) there are nearly a thousand K8S related projects split into around twenty classes with a total of over $21 billion dollars in funding Kubernetes (2021) is the most popular distributed system orchestrator in the world with 88% adoption Because of its near ubiquity, K8S has become the most popular contemporary platform for innovative system development in 2021 Kubernetes is a competitor (more or less) to Docker swarm but does more stuff than docker swarm i.e a popular choice.

Docker Compose is not a production ready tool. It works great for PoC or development environments, but lacks a lot of the capabilities that are more or less table stakes for serious production use. Swarm is more production-ready, but I would never invest into Swarm in a greenfield scenario. Kubernetes has won the orchestration battle, as evidenced by its inclusion into Docker Desktop and it being offered by all major cloud providers. Kubernetes is much more capable and has far more community and corporate support.

我建议你深入研究一些在Pluralsight、Linux Academy等网站上提供的Kubernetes教程,并在你选择的云平台(EKS、AKS、GKE等)上旋转一个集群。如果您试图在裸机上旋转,可以看看OpenShift,但要认识到在这种设置中您失去了Kubernetes的一些魔力。