Kubernetes Controller 和 Kubernetes Operator 有什么区别? [英] What is the difference between a Kubernetes Controller and a Kubernetes Operator?

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

问题描述

据我所知,Kubernetes 控制器的目的是确保当前状态与所需状态相同.尽管如此,Kubernetes Operator 也做同样的工作.

As I understand the purpose of the Kubernetes Controller is to make sure that current state is equal to the desired state. Nevertheless, Kubernetes Operator does the same job.

Control-plane 中的控制器列表:

The list of controller in the Control-plane:

  • 部署
  • 副本集
  • StatefulSet
  • 守护进程集

从谷歌搜索,我发现有K8s Operators 如

From the Google Search, I found out that there are K8s Operators such as

  • etcd 操作员
  • 普罗米修斯操作员
  • kong 运营商

但是,我无法理解为什么不能使用 Controller 来完成?

However, I was not able to understand why it cannot be done using Controller?

操作员是对控制器的补充吗?

Is Operator complementing the Controllers?

这两种设计在目的和功能上有什么区别.

What's the difference between these two design as a purpose and functionality.

在控制器和操作员之间进行选择时需要记住哪些特定事项??

What certain things need to keep in mind to choose between Controller and Operator? ?

推荐答案

我相信术语kubernetes operator"由 这里的 CoreOS 人员

I believe the term "kubernetes operator" was introduced by the CoreOS people here

Operator 是一个特定于应用程序的控制器,它扩展了 Kubernetes API 以代表 Kubernetes 用户创建、配置和管理复杂的有状态应用程序的实例.它建立在基本的 Kubernetes 资源和控制器概念之上,但也包括特定领域或应用程序的知识,以自动执行由计算机更好地管理的常见任务.

An Operator is an application-specific controller that extends the Kubernetes API to create, configure and manage instances of complex stateful applications on behalf of a Kubernetes user. It builds upon the basic Kubernetes resource and controller concepts, but also includes domain or application-specific knowledge to automate common tasks better managed by computers.

因此,基本上,kubernetes operator 是一种模式的名称,该模式由 kubernetes 控制器组成,该控制器向 Kubernetes API 添加新对象,以便配置和管理应用程序,例如 Prometheus 或 etcd.

So basically, a kubernetes operator is the name of a pattern that consists of a kubernetes controller that adds new objects to the Kubernetes API, in order to configure and manage an application, such as Prometheus or etcd.

一句话:操作员是域特定的控制器.

In one sentence: An operator is a domain specific controller.

在 Github 上有一个新的讨论,讨论了同样的主题,链接到同一篇博文.讨论的相关部分是:

There is a new discussion on Github about this very same topic, linking to the same blog post. Relevant bits of the discussion are:

所有 Operator 都使用控制器模式,但并非所有控制器都是 Operator.如果它有:控制器模式 + API 扩展 + 单应用焦点,它只是一个 Operator.

All Operators use the controller pattern, but not all controllers are Operators. It's only an Operator if it's got: controller pattern + API extension + single-app focus.

Operator 是一个用 CRD 实现的定制控制器.它遵循与内置控制器相同的模式(即 watch、diff、action).

Operator is a customized controller implemented with CRD. It follows the same pattern as built-in controllers (i.e. watch, diff, action).

更新 2

我发现了一篇新博文,它也试图解释这种差异.

Update 2

I found a new blog post that tries to explain the difference as well.

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

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆