Hi everyone! ![]()
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
- An overlay, e.g.
crates/providers/cloudflare/openapi/cloudflare.dns-record.overlay.yaml, and the matching example inexamples/. crates/koof/src/resource.rs: the contract between generated code and the runtime.crates/koof/src/controller/mod.rs: the main reconcile loop.
Any comments are welcome: issues, PR comments, or just reply here. Thanks! ![]()