Kubernetes Operator — pattern (+ tooling) for packaging complex stateful applications as native K8s resources. Operator = Custom Resource Definition (CRD) + Controller that reconciles desired state. Examples: Postgres-operator (provisions PostgreSQL clusters + backups), Redis Operator, Kafka Strimzi, cert-manager (SSL automation). OperatorHub.io — registry of 200+ operators.
Below: details, example, related terms, FAQ.
# Custom resource (Postgres Operator)
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: my-pg
spec:
instances: 3
storage:
size: 100Gi
backup:
barmanObjectStore:
destinationPath: s3://backups/
s3Credentials:
accessKeyId:
name: backup-key
key: ACCESS_KEYHelm — install + upgrade templates. Operator — ongoing management (backup, scale, heal). Operator — higher automation.
If you deploy a complex stateful app and need automation for backups, failover, schema migrations. Simple stateless app — Deployment is enough.
Operator SDK has an e2e test framework. kind/minikube local clusters for reconciliation testing.