Kubernetes Operators: The Most Efficient way to Manage Containerized Apps at Scale
Photo by Dan Lohmar on Unsplash

Kubernetes Operators: The Most Efficient way to Manage Containerized Apps at Scale

As per Harvey Nash / KPMG CIO Survey 2019, Increasing Operational Efficiencies ranks 3rd in the Top 5 Board Priorities for IT Operations. Enterprises are increasing their investments in Digital Technologies, and at the same time driving Efficiencies and Cost Optimization in their IT Operations.

Application Management at Scale: 

Application Management has traditionally been a Human-centric affair. Large Ops Teams were tasked with managing the day-to-day operations of the Apps. These teams had experts with deep domain and functional knowledge of the App and its platform, and often relied on heroes to save the day when an outage occurred. 

When the number of Apps and their complexities started growing, inefficiencies and cost overruns crept in. IT Organizations resorted to Tools to address these challenges. As a result, the Ops team evolved into a Tool-centric team, relying on tools and automation for tasks like monitoring, alerting, patching, backup/restore etc. 

Application Management

In due course, this approach created new challenges and made way for the wide-spread adoption of DevOps and SRE approaches to elevate efficiencies in Operations. Alongside, the fundamental approach to designing and building Apps has changed: Cloud, Containers and Micro-services have taken center-stage and users have begun to take elasticity, scalability and resiliency for granted. Relying on Humans and Tools alone won’t help anymore.

The answer is a Code-centric approach to managing an App’s lifecycle. In code-centric approach, the Ops team transforms itself into a group of Software engineers with a goal to codify all of the domain knowledge and operational tasks required for managing an App. Code becomes the fundamental asset for managing the App, with Humans and Tools augmenting wherever needed. Let’s call this codified asset as Ops-App. An Ops-App is often built by SREs using the same language, framework and constructs used by the App it manages. The Ops-App handles all the operational activities of the App viz. Deployment, Upgrade, Patching, Backup/Restore, Monitoring, Alerting, Scaling etc.

What is Kubernetes? 

Kubernetes allows you to pool Compute Resources from a group of physical and virtual servers, and makes these resources available to Containerized applications on-demand. It manages the lifecycle of containers, and provides various critical capabilities: automation, self-healing, persistent volumes, RBAC, auto-scaling etc. Kubernetes has had a resounding success as a Container platform, so much so, other competing platforms have either disappeared or have reluctantly embraced Kubernetes as their core orchestration engine. Kubernetes’ supremacy as the de-facto Container platform is already established. The benefits offered by Kubernetes, far outweighs the complexities involved.

What is a Kubernetes Operator? 

Kubernetes Operator

In simple terms, a Kubernetes Operator is an Ops-App for a Containerized App running in Kubernetes. Kubernetes has inherent support for several basic App management tasks like self-healing, scaling, monitoring etc. A Kubernetes Operator “amplifies” these basic capabilities into a fully blown Ops-App that has the entire domain knowledge of the App embedded in it. It does this, by simply extending or enhancing the capabilities of the Kubernetes cluster that hosts the App (Kubernetes allows users to add new API resources via a feature called Custom Resource Definition (CRD)). A user can then use the native Kubernetes command line tool (kubectl) or APIs to interact with the Ops-App, in the same way the user interacts with the Kubernetes Control plane. And, you get to run both the App and the Ops-App in the same Kubernetes cluster, allowing you to use existing CI/CD pipelines to manage the release of the App and its corresponding Ops-App. In Kubernetes parlance, the Ops-App is called an Operator. 

Let's assume the Dev Team has written a Java Spring boot Application and has Containerized the App into a Container Image. The Ops Team has to deploy this App into a Production Kubernetes Cluster and manage the App. Rather than deploying this App directly, the Ops team would write an Operator for this App. The Operator “knows” how to programmatically deploy the App into the Cluster with the right configuration, resource requirements etc. The Operator can also be written in a fashion that it knows much more than Deploying the App: it knows how to apply patches, roll-out upgrades, back up the App’s data, monitor the metrics of the App, initiate scaling, restore the backup etc. A human being would be required to intervene only for tasks which the Operator cannot perform. As a result, managing an App becomes highly efficient and cost optimized. This is a powerful pattern for managing Apps in Kubernetes.

The Operator Framework 

Operator SDK

A Kubernetes Operator brings much needed efficiencies in managing a Containerized App. Excellent! However, writing an Operator today can be difficult because of challenges such as using low level APIs, writing boilerplate, and a lack of modularity which leads to duplication. The Operator Framework removes the pain out of writing a Kubernetes Operator. It is an open source toolkit to manage Operators in an effective, automated, and scalable way. It provides a SDK which can be downloaded. Refer to this blog to get in-depth understanding on using the Operator SDK for writing an Operator. 

If you are looking for pre-built, readily usable Operators, it’s available in operatorhub.io. This is a collection of Open-sourced Operators for popular Applications. You can either use them as-is or download the source code and modify it as per your use case. As of this writing the repository has 91 Operators for Apps ranging from Akka to Wildfly. You could submit your Operator to operatorhub.io for others to discover and use it. 

Conclusion:  

Kubernetes Operators can be very valuable in managing Containerized Applications in Kubernetes. If you could build a group of SREs with the right skillset for writing and maintaining Operators, you benefit a lot. I believe this article has been helpful to you in getting a big picture of Kubernetes Operators and its benefits. Share your feedback in the comments section. 

Sanil Kumar D

Founder CEO Caze Labs | Industry Awarded Technologist | Providing innovative products and solutions in AI/GenAI, Cloud & Cyber Security | Help with Open Source Expertise | Ongoing PhD on Observability | Speaker | Trainer

5 年

Nice one!

回复

要查看或添加评论,请登录

Senthil Raja Chermapandian ?的更多文章

社区洞察

其他会员也浏览了