|
| 1 | +--- |
| 2 | +title: Kubernetes Operator |
| 3 | +status: Completed |
| 4 | +category: concept |
| 5 | +tags: ["infrastructure"] |
| 6 | +--- |
| 7 | + |
| 8 | +A Kubernetes Operator is a helper program that runs inside a Kubernetes cluster |
| 9 | +and extends its capabilities without modifying the core code, |
| 10 | +enabling the automated installation and management of complex applications and resources. |
| 11 | + |
| 12 | +## Problem it addresses |
| 13 | + |
| 14 | +When we want to run a complex [stateful](/stateful-apps/) application like a database cluster for instance, |
| 15 | +we need to take care of a lot of operational tasks in order to keep it up and running. |
| 16 | +This is especially true for properties like the high availability and the zero downtime. |
| 17 | +How does the cluster behave in case of an update or failure? |
| 18 | +How can we securely scale it up or down? |
| 19 | +These are things that are very specific to the type of technology, |
| 20 | +because not every database cluster for instance behaves the same way in case of scaling or failure. |
| 21 | +That is why Kubernetes cannot provide a general handling of these scenarios. |
| 22 | +Also, this knowledge is usually known and executed by a human administrator or also called operator. |
| 23 | +But in the highly automated cloud native world we cannot always afford to be dependent on manual interactions of a person to do these critical operations. |
| 24 | + |
| 25 | +## How it helps |
| 26 | + |
| 27 | +The Kubernetes Operator is basically an abstraction, a model, |
| 28 | +that allows us to build resources that can be used to help us with the above mentioned problems. |
| 29 | +Typically, existing operators provide a set of new resources - known as CRDs (Custom Resource Definition) - |
| 30 | +as well as components that are responsible for keeping the actual state of the cluster in sync with the desired state. |
| 31 | +If we take a database cluster operator for instance, |
| 32 | +these components know exactly how to scale this cluster up and down |
| 33 | +and what to do if it crashes etc. |
| 34 | +This way we don't need to be experts in that specific technology in order to use it in our Kubernetes cluster and make use of scaling or other specific features. |
| 35 | + |
| 36 | +## Related terms |
| 37 | + |
| 38 | +* [Stateless applications](/stateless-apps/) |
| 39 | +* [Stateful applications](/stateful-apps/) |
| 40 | +* [Clusters](/cluster/) |
0 commit comments