Tech_Interview_Prep

Kubernetes Operators & CRDs

Extending Kubernetes with custom resources and controllers to automate operational knowledge, not just deployment.

What it is

Custom Resource Definitions (CRDs) extend the Kubernetes API with new object types; an Operator is a controller that watches those objects and automates operational logic — encoding what a human operator would otherwise do manually.

Key points

  • CRD: defines a new kind of Kubernetes object (e.g. a PostgresCluster) that behaves like any built-in resource — can be created, listed, and watched via kubectl.
  • Operator pattern: a controller continuously reconciles the actual state toward the desired state declared in the custom resource — the same reconciliation loop pattern Kubernetes itself uses for built-in resources like Deployments.
  • Why platform teams build them: an operator encodes operational expertise (how to safely upgrade a database, how to handle a failover) into automated code, instead of that knowledge living only in a runbook a human has to execute correctly under pressure.
  • Operators are how platform teams expose complex, stateful infrastructure (databases, message queues) through a simple, declarative interface to product teams.