Learn what a Kubernetes Operator is, why this operator concept even emerged and when you should use them
OVERVIEW:
To give you an overview, operators are used mainly for stateful applications. So I first compare how Kubernetes manages stateless and stateful applications. And then compare deploying and managing stateful applications without an operator compared to deploying it with a Kubernetes Operator.
- 1. StateLESS applications on Kubernetes ๐
- 2. StateFUL applications WITHOUT Operator ๐คฏ
- 3. StateFUL applications WITH Operator ๐ฆ
โบ Watch the complete video ๐ฌ here: Kubernetes Operators explained
1. Stateless applications on Kubernetes ๐
Kubernetes can manage the complete lifecycle of stateless applications in a fully automated way, because these applications donโt have business logic for deployment.
This means K8s doesnโt need to know any application-specific business logic to automatically create, update and delete them. ๐
So basically, once you deployed the application, you donโt have to sit there and control that your application is running properly. And when you carry out small changes, like update or scale up, it works pretty much without problems.
That's great! ๐
2. Stateful applications without Operator ๐คฏ
For stateful applications, like databases, the whole process isnโt as straightforward.
They need more "hand-holding" during its whole lifecycle, because the replicas of stateful apps aren't identical.
Each has its state and identity. This means, they need to be started, updated and destroyed in a certain order. These details will even vary for each application: Mysql will have its own specific way of doing this, Postgres and Elasticsearch have another way of doing it etc. ๐
So, Kubernetes natively/internally doesnโt have all the knowledge required ๐คท๐ปโโ๏ธ to automate the process of deploying every single stateful application.
Thatโs why these kind of applications require manual intervention - people who "operate" these applications. ๐ฉ๐ปโ๐ป
3. Stateful applications with Operator ๐ฆ
Operator solves this problem and basically replaces this "human" operator with a "software" operator.
All the manual tasks that devOps teams would do is now packed into a program that has the knowledge and intelligence about how to deploy that specific application, like Postgres or Prometheus. ๐ก
So how does Operator do this? ๐ค
At its core it has the same control loop mechanism that k8s has, that watches for changes in the application state.
It also uses CRDs, which is basically a custom K8s component which extends the Kubernetes API.
So, it takes the basic Kubernetes resources and its controller concept as a foundation to build upon, and on top of that includes domain or application-specific knowledge to automate the entire life cycle of the application it "operates":
More details in the video here ๐ฉ๐ปโ๐ป
Kubernetes 101 โบ Compact and easy-to-read ebook bundle ๐
It's a handy way to quickly look something up or refresh your knowledge at work and use it as your cheatsheet ๐
Like, share and follow me ๐ for more content:
Top comments (0)