What problem does it solve?
Kubernetes controllers often fail in production due to non-idempotent reconciliation, broken finalizer lifecycles, incorrect RBAC, missed watch events, or inefficient workqueue patterns. This skill helps you design and review controller-runtime and Kubebuilder operators that behave correctly under deletes, conflicts, retries, and high event volume.
Core Features & Use Cases
- Production-grade reconciliation patterns: level-based reconciliation, NotFound handling, and strict idempotency guidance.
- Correct deletion behavior: finalizer setup, cleanup flow, and safe finalizer removal timing.
- Controller-runtime setup and watch correctness: predicates, MaxConcurrentReconciles, and safe secondary resource requeue mapping without fragile API calls.
- Error handling and retries: selecting the right requeue mechanism and handling optimistic concurrency with RetryOnConflict patterns.
- RBAC/CRD design best practices: kubebuilder marker examples for status subresources, finalizers intent, and validation/print columns.
- Performance and testing strategy: avoid blocking I/O in Reconcile, reduce API load via selectors/indexing, and test with fake clients + kind-based functional verification.
Quick Start
Use the k8s-controller skill when you are implementing or reviewing a Kubernetes controller and want to apply reliable reconcile, finalizer, RBAC, and watch patterns.