reconciler-logic

Implement asynchronous reconciler logic for grafana-app-sdk resources.

213|18|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/grafana/skills --skill reconciler-logic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reconciler-logic
Source: https://github.com/grafana/skills/tree/main/skills/grafana-app-sdk/reconciler-logic
Command: npx skills add https://github.com/grafana/skills --skill reconciler-logic

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Reconcilers coordinate asynchronous business logic for grafana-app-sdk apps so that resource state changes (create, update, delete) are observed and the system is driven toward a desired state without race conditions or status conflicts.

Core Features & Use Cases

  • TypedReconciler Pattern: Strongly-typed reconcile functions that simplify type assertions and provide safer handler wiring.
  • Atomic Status Updates: Guidance to use resource.UpdateObject to avoid 409 conflicts and ensure consistent status writes.
  • Resilience & Coordination: Generation-based skips, requeueing for external async operations, finalizer management, informer configuration, and retry/dequeue policies for robust production controllers.
  • Use Case: Implement a controller that kicks off an external provisioning job, polls its status, updates resource status atomically, and cleans up external resources on deletion.

Quick Start

Write a TypedReconciler for MyKind that handles create, update, and delete events, updates status atomically with resource.UpdateObject, manages finalizers, and requeues to poll external async work.

Frequently Asked Questions about reconciler-logic

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

FAQPage Schema
How do I implement a Kubernetes reconciler loop for asynchronous resource state updates?

Implement a Kubernetes reconciler loop by writing a TypedReconciler that handles create, update, and delete events, using resource.UpdateObject for atomic status updates and requeueing to poll external async work. This prevents race conditions and status conflicts during asynchronous reconciliation.

Why do I get 409 conflicts when updating custom resource status in my controller?

409 conflicts during status updates happen when concurrent writes overwrite the resource version. Use resource.UpdateObject for atomic status updates to avoid 409 conflicts and ensure consistent status writes in your reconciler loop.

How do I manage finalizers for Kubernetes custom resources in an async reconcile loop?

Manage finalizers in an async reconcile loop by adding them upon resource creation and removing them only after external cleanup completes. The reconciler logic handles finalizer management to ensure external resources are properly deleted before the custom resource is removed.

What is the best way to skip redundant reconcile loops for unchanged Kubernetes resources?

Use generation-based skips to ignore update events where the spec has not changed. By comparing resource generations, the reconciler avoids redundant processing and only executes business logic when actual spec modifications occur.

How do I configure informer retry and dequeue policies for a Kubernetes controller?

Configure informer retry and dequeue policies by setting parameters in your grafana-app-sdk application's informer configuration. These policies control how the controller handles transient failures and manages the rate of resyncs for robust production controllers.

Can I use grafana-app-sdk to build a controller that polls external provisioning jobs?

Yes, you can use grafana-app-sdk to build a controller that kicks off an external provisioning job, polls its status, updates the resource status atomically, and cleans up external resources on deletion using requeueing and finalizer management.