liveBook · Manning

Kubernetes operator

As explained in Kubernetes in Action, Second Edition

A Kubernetes Operator is a controller pattern that automates the management of a specialized application or workload by encoding operational knowledge.

A Kubernetes Operator is an application-specific controller that automates deployment and management of a specialized application. It encodes operational knowledge that basic StatefulSets cannot provide, such as reconfiguring a MongoDB replica set after scaling and responding to node failures. section 16.4

An Operator extends the Kubernetes API with custom object types. You create an instance of that custom resource; the Operator then creates the Deployments, StatefulSets, Pods, and supporting objects required to run the application. section 16.4 section 16.5

Figure 16.10 Managing an application through custom resources and operators
figure

The lifecycle relationship is: a custom resource represents the desired application, and the Operator reconciles it by creating the underlying Kubernetes objects. section 16.4

Installing the MongoDB Community Operator

Install the CustomResourceDefinition for the MongoDBCommunity kind, apply the supporting security manifests, and create the Operator Deployment in the mongodb namespace. Verify it with `kubectl get pods -n mongodb`; a Running Operator is ready to manage MongoDB, but does not deploy MongoDB until you create a MongoDBCommunity object. section 16.4.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains controller architecture and installation steps, but defers detailed Operator implementation and changing project-specific behavior.
Examples
Uses MongoDB scaling, replica-set reconfiguration, node failure recovery, and MongoDBCommunity installation as concrete examples.
What it assumes
Assumes a Kubernetes cluster, namespace, API access, and familiarity with applying manifests; introduces custom resource types through the installation workflow.
What you can do after
Apply it via kubectl by installing an Operator, extending the API, and creating a custom resource for the managed application.
How it connects
Connects custom resources, CustomResourceDefinitions, Kubernetes API, StatefulSets, Deployments, Pods, and MongoDB replica sets.

Also explained in

Compare how 7 books explain Kubernetes operator →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.