Koof: Kubernetes OpenAPI Operator Framework

Hi everyone! :waving_hand:

For my bootcamp project I built koof, a framework that generates Kubernetes operators from OpenAPI specs. You describe resources with a few x-kube-* extensions in OpenAPI Overlays, and it generates CRDs, controllers and end-to-end tests. As examples, there are two generated providers: Cloudflare and Sentry.

I'd really appreciate a review, even just ideas or first impressions. I'm also planning to use these providers at work, so maybe the project will be useful to someone else too.

PR: Implementation by anasinnyk Β· Pull Request #1 Β· anasinnyk/koof Β· GitHub

Project structure

  • crates/koof β€” runtime library: Crossplane-style reconciliation, the provider HTTP client, config, metrics, manifest generation and a fake provider API for tests.
  • crates/koof-gen β€” code generator: OpenAPI + overlays β†’ provider crate (CRD types, descriptors, API operations) and Chainsaw e2e tests.
  • crates/providers/cloudflare β€” Cloudflare provider: upstream OpenAPI spec + our overlays; the Rust code is almost entirely generated.
  • crates/providers/sentry β€” Sentry provider; experimental, never run against the real service.
  • deploy β€” Kustomize manifests (shared base + generated per-provider CRDs and RBAC).
  • scripts β€” regenerate code, check generated files, run e2e tests on kind.

What I'd love feedback on

  • The overall idea and architecture: does generating operators from OpenAPI make sense, and what would you do differently?
  • The overlay format (x-kube-resource, x-kube-operation): is it understandable?
  • The reconciliation logic in crates/koof/src/controller (drift detection, late initialization, deletion).

Where to start

  1. An overlay, e.g. crates/providers/cloudflare/openapi/cloudflare.dns-record.overlay.yaml, and the matching example in examples/.
  2. crates/koof/src/resource.rs: the contract between generated code and the runtime.
  3. crates/koof/src/controller/mod.rs: the main reconcile loop.

Any comments are welcome: issues, PR comments, or just reply here. Thanks! :folded_hands:

1 Like