Author : HASSAN MD TAREQ | Updated : 2021/04/24
- The Operator pattern aims to capture the key aim of a human operator who is managing a service or set of services
- The Kubernetes Operator pattern acts in accordance with one of the core Kubernetes principles: the control theory
- In robotics and automation, “control theory” is a mechanism that continuously operates dynamical systems
- Custom Resource is an extension of the Kubernetes API that provides a place where you can store and retrieve structured data—the desired state of your application
- A resource is an endpoint in the Kubernetes API that stores a collection of API objects of a certain kind
- Example: the built-in pods resource contains a collection of Pod objects
- A custom resource is the API extension mechanism in Kubernetes
What is Operator?
- Operators are software extensions to Kubernetes that make use of custom resources to manage applications and their components
- An operator is a client of the Kubernetes API that acts as a controller for a Custom Resource
- The Operator itself is a piece of software running in a Pod on the cluster, interacting with the Kubernetes API server
- Operators are first class citizen in K8s
- Most of the time operators are just a pod (or a few pods) running a custom controller and one or more custom resources to interact with it
- An operator is a custom Kubernetes controller that uses custom resources (CR) to manage applications and their components
An operator is an application-specific controller. It extends a Kubernetes API to create, configure, and manage complex applications on behalf of humans (operation engineers or site reliability engineers). It builds upon the basic Kubernetes resource and controller concepts, but includes domain or application-specific knowledge to automate the entire life cycle of the software it manages.
Operators are mainly used for stateful applications. Using a Kubernetes operator means you can operate a stateful application by writing a custom controller with domain specific knowledge built into it.