Skip to content

u-ctf/controller-fwk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Controller Framework (ctrlfwk)

Pipeline Coverage Go Version Go Reference GitHub release License Go Report Card

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)

    stepper := ctrlfwk.NewStepper(logger,
        ctrlfwk.WithStep(ctrlfwk.NewFindControllerCustomResourceStep(r)),
        ctrlfwk.WithStep(ctrlfwk.NewResolveDynamicDependenciesStep(r)),
        ctrlfwk.WithStep(ctrlfwk.NewReconcileResourcesStep(r)),
        ctrlfwk.WithStep(ctrlfwk.NewEndStep(r, ctrlfwk.SetReadyCondition(r))),
    )

    return stepper.Execute(ctx, req)
}

Documentation

📚 Visit our Wiki for comprehensive guides and documentation:

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

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages