The project behind koprs, a high-level Kubernetes operator library for Rust.
Operators make it easy to manage complex stateful applications on top of Kubernetes. However writing an Operator today can be difficult because of challenges such as using low level APIs, writing boilerplate, and a lack of modularity which leads to duplication.
The Operator SDK for Rust is a framework that uses kube and kube-runtime libraries to make writing operators easier by providing:
- High level APIs and abstractions to write the operational logic more intuitively
- Tools for scaffolding and code generation to bootstrap a new project fast
- Extensions to cover common Operator use cases
This repository contains the core framework, its proc macros, and the manifest generation tooling for CRDs and RBAC.
| Crate | Description | Docs |
|---|---|---|
koprs |
Core generic runtime framework | |
koprs-derive |
Proc macros — implementation detail | |
koprs-gen |
CRD and RBAC manifest generation CLI |
operator-framework-rs/
├── Cargo.toml # workspace manifest
├── Cargo.lock
└── crates/
├── koprs/ # core library
├── koprs-derive/ # proc macros
└── koprs-gen/ # codegen CLI
If you are here to build a Kubernetes operator, you want koprs. Start there.
If you want to generate CRD or RBAC manifests from your annotated Rust types, you want koprs-gen.
Contributions are welcome. Please open an issue before submitting a pull request for anything beyond small fixes, so the approach can be agreed on first.
- Rust stable toolchain
- A local Kubernetes cluster for integration tests (kind recommended)
# build all crates
cargo build
# build a specific crate
cargo build -p koprs# unit tests (no cluster required)
cargo test
# integration tests
kind create cluster --name operator-framework-rs-test
cargo test --features integration --test integration
kind delete cluster --name operator-framework-rs-testcargo-ci.sh runs all quality checks in sequence — format, type-check,
unit tests, integration tests, coverage, release build, docs, and audit.
./scripts/cargo-ci.sh # run all steps
./scripts/cargo-ci.sh --fast # fmt + check + unit tests only (no coverage)
./scripts/cargo-ci.sh --no-audit # skip cargo-audit
./scripts/cargo-ci.sh --no-integration # skip integration tests
./scripts/cargo-ci.sh --no-doc # skip cargo doc
./scripts/cargo-ci.sh --no-coverage # skip llvm-cov coverage report
./scripts/cargo-ci.sh --bench # also compile benchmarks (slow, opt-in)
./scripts/cargo-ci.sh --coverage-fail-under=80 # fail if line coverage drops below N%publish.sh handles the full pre-flight and publishes all three crates to crates.io in
dependency order — koprs-derive, koprs, koprs-gen.
./scripts/publish.sh # full pre-flight + publish all crates
./scripts/publish.sh --dry-run # stop before cargo publish
./scripts/publish.sh --skip-ci # skip CI checks, publish only
./scripts/publish.sh --crate koprs # publish a single crateA 20 second delay is applied between each crate to allow crates.io to index before the next crate resolves it as a registry dependency.
See the CI script docs for the full list of flags.
MIT