Declarative Unit Testing
ork simulate runs the operator reconcile loop against a fake in-memory cluster. No Kubernetes, no kubectl, no network — results in milliseconds.
Pages
| Page | What it covers |
|---|---|
| How it works | The fake cluster model, same reconciler, steady state detection |
| simulate.yaml | The recommended entry point — schema, expect:, assert mode, validation |
| Running simulate | All invocation forms: --cr, -f simulate.yaml, ./..., flags |
| Hooks and constructors | Custom binary, registry wiring, what the standard binary shows |
| Aggregator mode | ./... discovery and aggregator simulate files |
| Limitations | What simulate cannot cover and what to use instead |
The key property
ork simulate does not approximate what the reconciler does. It is the reconciler — the same GenericReconciler that runs in production, wired to a fake in-memory Kubernetes store. Template expressions, when: conditions, onCreate/onReconcile order, and status propagation all execute identically.
Use simulate as the fast inner loop while writing an operator. Use ork e2e as the outer gate before pushing.
ork simulate | ork e2e | |
|---|---|---|
| Requires cluster | No | Yes |
| Runs real reconciler | Yes | Yes |
| Tests webhooks | No | Yes |
| Tests external calls | Yes | Yes |
| Speed | Milliseconds | Minutes |
| Best for | Template correctness | System correctness |
Where to go next
- How it works — the fake cluster model, same reconciler, steady state detection
- simulate.yaml — schema,
expect:, assert mode, op-print mode, validation - Running simulate — all invocation forms,
--dev-server,./...discovery, flag reference
→ See also: ork simulate CLI reference