Operator
π§ Problem Operators Solve
β The Problem
Kubernetes manages stateless apps (like NGINX, APIs) easily via Deployments and Services. But stateful apps (like databases) need:
Backups
Restores
Scaling with persistent volume migration
Health checks + failover
Version-aware upgrades
Manually doing this is error-prone and non-repeatable.
Operators can be simple (e.g., restart app if it crashes) or advanced (e.g., auto-backup before upgrade).
π Real-Time Example
π Example: PostgreSQL Operator
Problem: PostgreSQL isnβt natively supported in Kubernetes for:
Safe backup/restore
Replication/failover
Version upgrades
PVC migration
Solution: Use an Operator like Zalando Postgres Operator
π‘ What It Does:
Deploys PostgreSQL clusters using a CRD like:
Automatically:
Creates StatefulSets with correct configs
Sets up replication
Monitors health
Performs failover
Manages backups (e.g., to S3)
π Operator Examples in Production
Operator
Manages
Features
Prometheus Operator
Prometheus, Alertmanager
Auto config, upgrades, alerting
Cert-Manager
TLS certs via Let's Encrypt
Auto renewals, validation
ArgoCD Operator
GitOps CD tool
Installs and maintains ArgoCD
Elastic Operator
Elasticsearch & Kibana
Handles cluster upgrades, scaling, snapshots
Kafka Operator
Apache Kafka
Handles topics, partitions, failover, scaling
π§ Summary
Concept
Description
CRD
Custom resource you define (e.g., PostgreSQL)
Controller
Logic to watch CRD and take action
Operator
Combination of CRD + controller logic, often packaged as a Helm chart or container
Why Use It?
To manage complex, stateful, or repetitive workloads like a human would
Last updated