k8s-controller-reconcile

Implement idempotent Kubernetes controllers with level-triggered reconciliation.

3|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/missBerg/envoy-skills --skill k8s-controller-reconcile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: k8s-controller-reconcile
Source: https://github.com/missBerg/envoy-skills/tree/main/shared/contributors/skills/k8s-controller-reconcile
Command: npx skills add https://github.com/missBerg/envoy-skills --skill k8s-controller-reconcile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kubernetes controller development often suffers from non-idempotent behavior, brittle error handling, and inconsistent state management across resource events. This Skill provides proven patterns to build controllers that reconcile desired and actual state deterministically.

Core Features & Use Cases

  • Level-triggered reconciliation that derives desired state from the current world state to avoid missed or duplicate work.
  • Reconciler architectures: per-CRD controllers for isolation or mega-reconcilers when cross-resource translation is required.
  • Robust event handling, watches, and field index lookups to propagate changes efficiently.
  • Clear status management and ownership semantics to enable reliable lifecycle and garbage collection.
  • Structured logging and event recording to aid debugging and operator observability.

Quick Start

Set up a reconciler with SetupWithManager, define For/Owns watches, and implement a level-triggered Reconcile that derives the desired state from the current object.

Frequently Asked Questions about k8s-controller-reconcile

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an idempotent Kubernetes controller that handles reconciliation reliably?

Idempotent Kubernetes controllers use level-triggered reconciliation to derive desired state from current world state, ensuring deterministic outcomes. Apply patterns for robust error handling, status conditions, and requeue semantics to prevent duplicate work.

Why does my Kubernetes controller miss events or perform duplicate work during reconciliation?

Kubernetes controllers miss events or duplicate work when using edge-triggered logic. Switching to level-triggered reconciliation derives the desired state from the current object, avoiding missed or duplicate work across resource events.

What is the best way to structure a controller-runtime reconciler for cross-resource translation?

For cross-resource translation, use a mega-reconciler architecture to handle multi-resource ownership efficiently. Alternatively, use per-CRD controllers for isolation, setting up watches and field index lookups to propagate changes across resources.

How do I manage status conditions and ownership cleanup in a controller-runtime controller?

Manage status conditions and ownership cleanup by implementing clear status management and ownership semantics. This enables reliable lifecycle tracking and garbage collection, ensuring resources are cleaned up correctly during reconciliation.

Does controller-runtime support structured logging and event recording for operator observability?

Yes, controller-runtime supports structured logging and event recording to aid debugging and operator observability. Integrating these patterns into your reconciler helps track reconciliation behavior, monitor requeue semantics, and diagnose event-handling issues.