Terraform & IaC (50 Qs)•Part 3: Kubernetes Infrastructure as Code & GitOps (31 - 42)
What is the Kubernetes Operator Pattern and Custom Resource Definitions (CRDs)?
senior LevelMost AskedKubernetes
In Simple Words: An Operator encodes human operational domain knowledge (backup, failover, scaling) into software:
- CRD (Custom Resource Definition): Extends Kubernetes API with new resource types (e.g.
apiVersion: postgres-operator/v1, kind: PostgresCluster). - Custom Controller: Runs a continuous Reconciliation Loop:
Actual State -> Desired State. If a database replica fails, the operator provisions a new one and triggers replication catch-up automatically.