Kubernetes concepts
In this section, I'll briefly introduce many important Kubernetes concepts and give you some context as to why they are needed and how they interact with other concepts. The goal is to get familiar with these terms and concepts. Later, we will see how these concepts are woven together to achieve awesomeness. You can consider many of these concepts as building blocks. Some of the concepts, such as node and master, are implemented as a set of Kubernetes components. These components are at a different abstraction level, and I discuss them in detail in a dedicated section Kubernetes components.
Kubernetes Controller vs 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.
The list of controller in the Control-plane:
- Deployment
- ReplicaSet
- StatefulSet
- DaemonSet
- etc
From the Google Search, I found out that there are K8s Operators such as
- etcd Operator
- Prometheus Operator
- kong Operators
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? ?
BEST ANSWER:
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 implement with CRD. It follow the same pattern with build-in controllers (i.e. watch, diff, action).
Please pay attention very carefully, because this is the truest thing a stranger will ever say to you: In the face of such hopelessness as our eventual, unavoidable death, there is little sense in not at least TRYING to accomplish all your wildest dreams in life.
Kevin Smith