kubernetes 和 GKE 有什么区别?

What is the difference between kubernetes and GKE?

我知道GKE下面是kubernetes驱动的。但我似乎仍然不明白,在分层中,GKE 负责哪些部分,k8s 负责哪些部分?在我看来,两者的主要目的是管理集群中的容器。基本上,我正在寻找一个带有示例的更简单的解释。

GKE (Google Container Engine)只是容器平台,Kubernetes可以管理。 "differences".

不是类似 kubernetes 的

如“Docker and Kubernetes and AppC ”中所述(2015 年 5 月,可以更改):

Docker is currently the only supported runtime in GKE (Google Container Engine) our commercial containers product, and in GAE (Google App Engine), our Platform-as-a-Service product.

您可以在这个例子中看到在 GKE 上使用的 Kubernetes:“Spinning Up Your First Kubernetes Cluster on GKE" from Rimantas Mocevicius.

gcloud API 仍会在后台执行 kubernetes 命令。

GKE 将通过 Kubernetes master

组织其平台

Every container cluster has a single master endpoint, which is managed by Container Engine.
The master provides a unified view into the cluster and, through its publicly-accessible endpoint, is the doorway for interacting with the cluster.

The managed master also runs the Kubernetes API server, which services REST requests, schedules pod creation and deletion on worker nodes, and synchronizes pod information (such as open ports and location) with service information.

GKE 是一个 managed/hosted Kubernetes(即它是为您管理的,因此您可以专注于 运行安装您的 pods/containers 应用程序)

Kubernetes 处理:

  • 运行 pods,在节点上调度它们,保证每个 Replication Controller 设置的副本数(即如果它们失败则重新启动 pods,如果节点失败则重新定位它们)
  • 服务:将流量代理到正确的 pod,无论它位于何处。
  • 职位

此外,还有几个 'add-ons' 到 Kubernetes,其中一些是构成 GKE 的一部分:

  • DNS(你真的离不开它,甚至认为它是一个附加组件)
  • 指标监控:使用influxdb、grafana
  • 仪表板

None 其中是开箱即用的,虽然它们很容易设置,但您需要维护它们。 没有真正的 'logging' 附加组件,但有各种项目可以做到这一点(使用 Logspout、logstash、elasticsearch 等...)

简而言之,Kubernetes 负责编排,其余的是 运行 在 Kubernetes 之上的服务。

GKE 为您提供所有这些开箱即用的组件,您无需维护它们。它们是为您设置的,而且它们更 'integrated' 带有 Google 门户。

每个人都需要的一个重要的东西是 LoadBalancer 部分: - 由于 Pods 是临时容器,可以随时随地重新安排,它们不是静态的,因此需要单独管理入口流量。

这可以在 Kubernetes 中完成,方法是使用 DaemonSet 将 Pod 固定在特定节点上,并使用 hostPort 为该 Pod 绑定到节点的 IP。 显然这缺乏容错能力,因此您可以使用多个并进行 DNS 循环负载平衡。

GKE 也通过外部负载平衡来处理所有这一切。 (在 AWS 上,它类似,由 ALB 负责 Kubernetes 中的负载平衡)

简而言之,不涉及技术细节, GKE 是受管的 Kubernetes,类似于 Google 的 Cloud Composer 是受管的 Apache Airflow 和 Cloud Dataflow 是受管的 Apache Beam。

因此,Google Cloud Platform 的一些服务(GKE、Cloud Composer、Cloud Dataflow)是各种开源技术(Kubernetes、Airflow、Beam)的托管实现。