Skip to content

Latest commit

 

History

111 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Controller Framework Logo

Controller Framework (ctrlfwk)

Pipeline Coverage Go Version Go Reference GitHub release License

A powerful and extensible framework for building Kubernetes controllers using controller-runtime. Transform your imperative controller logic into a declarative, step-based system that's easier to understand, test, and extend.

Key Features

  • Step-based Reconciliation: Break complex logic into manageable steps
  • Declarative Resources: Builder pattern for resource and dependency management
  • Type Safety: Full generic support for custom resources
  • Minimal Migration: Works with existing Kubebuilder controllers
  • Built-in Observability: Instrumentation, logging, and tracing

Quick Start

Installation

go get github.com/u-ctf/controller-fwk

Example Usage

Transform your Kubebuilder controller with minimal changes:

func (r *TestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
    logger := logf.FromContext(ctx)
    fwkCtx := ctrlfwk.NewContext[*testv1.Test](ctx, r)

    stepper := ctrlfwk.NewStepperFor[*testv1.Test](fwkCtx, logger).
        WithStep(ctrlfwk.NewFindControllerCustomResourceStep(fwkCtx, r)).
        WithStep(ctrlfwk.NewResolveDynamicDependenciesStep(fwkCtx, r)).
        WithStep(ctrlfwk.NewReconcileResourcesStep(fwkCtx, r)).
        WithFinalStep(ctrlfwk.NewReadyConditionFinalStep(fwkCtx, r, ctrlfwk.SetReadyConditionFromResult(r))).
        Build()

    return stepper.Execute(fwkCtx, req)
}

Documentation

📚 Read the docs for guides and reference:

Support & Community

Contributing

We welcome contributions! Please see our Contributing Guide for details.


Built with ❤️ by the U-CTF team

About

A framework to make easy-to-read, easy-to-build Kubernetes Operators

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages