What is the difference between a Kubernetes Controller and a Kubernetes Operator?

后端 未结 3 1608
青春惊慌失措
青春惊慌失措 2020-12-12 19:25

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 jo

3条回答
  •  自闭症患者
    2020-12-12 20:05

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

    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.

    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.

    Update

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

    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 is a customized controller implemented with CRD. It follows the same pattern as built-in controllers (i.e. watch, diff, action).

    Update 2

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

提交回复
热议问题