Skip to content

Quiz: Kubernetes Operators

← Back to quiz index

3 questions

L0 (1 questions)

1. What is a CRD (Custom Resource Definition) and what does it enable?

Show answer A CRD extends the Kubernetes API with your own resource types. After creating a CRD for, say, 'Database', you can kubectl get databases, kubectl describe db my-database, etc. It lets you define a schema with validation. Combined with a controller (operator), CRDs let you manage complex stateful workloads like databases or message brokers through declarative YAML, the same way you manage Deployments and Services.

L1 (1 questions)

1. What is the reconciliation loop in a Kubernetes operator, and what are its steps?

Show answer The reconciliation loop is the core pattern: (1) Watch for changes to custom resources, (2) Compare desired state (CR spec) with actual state in the cluster, (3) Act by creating, updating, or deleting resources to match desired state, (4) Update the CR status subresource with current state, (5) Repeat. The loop must be idempotent — calling Reconcile multiple times for the same state must produce the same result.

L2 (1 questions)

1. Why are owner references important for operator-managed resources, and what problem do finalizers solve?

Show answer Owner references let Kubernetes garbage collect child resources (StatefulSets, Services, etc.) when the parent custom resource is deleted. Without them, child resources become orphans. Finalizers solve the opposite problem: they let the operator run cleanup logic (e.g., take a final backup) before the CR is deleted. The operator detects the deletion timestamp, runs cleanup, removes the finalizer, and then Kubernetes completes deletion.