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)