本文介绍了Kubernetes 和 GKE 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I know that GKE is driven by kubernetes underneath. But I don't seem to still get is that what part is taken care by GKE and what by k8s in the layering? The main purpose of both, as it appears to me is to manage containers in a cluster. Basically, I am looking for a simpler explanation with an example.

推荐答案

GKE 是一个托管/托管的 Kubernetes(即它为您托管,因此您可以专注于运行您的 Pod/容器应用程序)

GKE is a managed/hosted Kubernetes (i.e. it is managed for you so you can concentrate on running your pods/containers applications)

Kubernetes 确实处理:

Kubernetes does handle:

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

此外,Kubernetes 有几个附加组件",其中一些是 GKE 的组成部分:

In addition, there are several 'add-ons' to Kubernetes, some of which are part of what makes GKE:

  • DNS(你不能没有它,即使它是一个附加组件)
  • 指标监控:使用 influxdb、grafana
  • 仪表板

这些都不是开箱即用的,尽管它们很容易设置,但您需要维护它们.没有真正的日志"插件,但有很多项目可以做到这一点(使用 Logspout、logstash、elasticsearch 等......)

None of these are out-of-the-box, although they are fairly easy to setup, but you need to maintain them.There is no real 'logging' add-on, but there are various projects to do this (using Logspout, logstash, elasticsearch etc...)

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

In short Kubernetes does the orchestration, the rest are services that would run on top of Kubernetes.

GKE 为您提供所有这些开箱即用的组件,您无需维护它们.它们是为您设置的,并且与 Google 门户更集成".

GKE brings you all these components out-of-the-box, and you don't have to maintain them. They're setup for you, and they're more 'integrated' with the Google portal.

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

One important thing that everyone needs is the LoadBalancer part:- Since Pods are ephemeral containers, that can be rescheduled anywhere and at any time, they are not static, so ingress traffic needs to be managed separately.

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

This can be done within Kubernetes by using a DaemonSet to fix a Pod on a specific node, and use a hostPort for that Pod to bind to the node's IP. Obviously this lacks fault tolerance, so you could use multiple and do DNS round robin load balancing.

GKE 也通过外部负载平衡处理所有这些问题.(在 AWS 上类似,ALB 负责 Kubernetes 中的负载均衡)

GKE takes care of all this too with external Load Balancing. (On AWS, it's similar, with ALB taking care of load balancing in Kubernetes)

这篇关于Kubernetes 和 GKE 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:47