Kubernetes Operator is a Kubernetes controller that automates the lifecycle of an application or infrastructure component using custom Kubernetes resources. In practical terms, it lets you manage complex systems, such as databases, message queues, certificate issuers, or cloud resources, through Kubernetes APIs instead of manual runbooks.
An Operator encodes operational knowledge into software. It watches Kubernetes resources, compares the current state with the desired state, and takes action to close the gap.
Common responsibilities include:
Most Operators are built around two Kubernetes concepts:
PostgresCluster, Kafka, or Certificate.For example, a platform team might create a custom resource that says, “run a PostgreSQL cluster with 3 replicas, 100 GiB of storage, and daily backups.” The Operator then creates the required StatefulSets, Services, ConfigMaps, Secrets, storage claims, and backup jobs. If a pod dies, the Operator helps restore the expected state.
Without an Operator, running Kafka on Kubernetes often means your team writes scripts and runbooks for broker configuration, persistent storage, rolling upgrades, partition reassignment, user management, and recovery.
With a Kafka Operator, you define a Kafka custom resource. The Operator creates and manages the underlying Kubernetes objects, then keeps watching for changes. If you update the Kafka version in the custom resource, the Operator can perform a controlled rolling upgrade according to its logic.
Database resource, while hiding implementation details.A Kubernetes controller is any component that watches resources and reconciles state. A Kubernetes Operator is a specialized controller that usually manages a complex application or external system using one or more CRDs.
All Operators are controllers, but not every controller is considered an Operator. For example, the built-in Deployment controller manages ReplicaSets and Pods. A PostgreSQL Operator manages a higher-level database system, including Kubernetes resources and database-specific operations.
A Helm chart packages Kubernetes manifests and helps install or upgrade them. It usually acts when you run a Helm command or when a GitOps controller syncs the chart.
An Operator keeps running after installation. It watches the cluster and continuously manages the application. Helm is often enough for stateless services. An Operator is more useful when the application needs ongoing lifecycle logic, such as failover, backup scheduling, certificate renewal, or safe version upgrades.
Operators are useful when a platform team wants to offer higher-level building blocks through Kubernetes. Instead of asking product teams to manage low-level manifests, the platform team can define custom resources with safe defaults.
For example, a startup platform team might expose a PostgresDatabase resource. Developers request a database in Git, a GitOps tool applies the manifest, and the Operator provisions the database, credentials, backups, and monitoring. The same pattern can extend to cloud services with Crossplane, including workflows that deploy a Kubernetes app with AWS resources using Crossplane.