k8s-maestro
A Kubernetes workflow orchestrator with minimal requirements and full power.
k8s-maestro provides a high-level, type-safe Rust API for orchestrating complex workflows on Kubernetes. Built with test-driven development principles, it offers a clean builder pattern for creating multi-step workflows with dependencies, conditional execution, and powerful networking capabilities.
Features
- Multi-step Workflows: Define complex workflows with multiple steps and dependencies
- Conditional Execution: Execute steps based on conditions (success, failure, output values)
- Multiple Step Types: Support for Kubernetes jobs, exec steps, WASM, and custom step types
- Services & Ingress: Built-in support for exposing services and configuring ingress
- Sidecar Containers: Easily add sidecar containers to workflow steps
- File Observer: Monitor file changes and trigger workflow execution
- Checkpointing: Automatic checkpointing and recovery for long-running workflows
- Multi-tenant Security: Role-based access control and namespace isolation
- Builder Pattern: Fluent API for easy workflow and resource construction
- TDD Approach: Extensive test coverage with unit, integration, and E2E tests
Installation
Add this to your Cargo.toml:
[]
= "1.0"
Enable Kubernetes support with the appropriate version feature:
= { = "1.0", = ["k8s_v1_28"] }
Available features: k8s_v1_28, k8s_v1_29, k8s_v1_30, k8s_v1_31, k8s_v1_32
Migrating from v0.3.0?
If you're upgrading from v0.3.x to v1.0.0, check out our Migration Guide for detailed instructions on updating your code to the new workflow-centric API.
Quick Start
use ;
use KubeJobStep;
use MaestroK8sClient;
async
Usage Examples
Basic Workflow
use ;
use KubeJobStep;
use MaestroK8sClient;
async
Workflow with Dependencies
use ;
use ;
use KubeJobStep;
use MaestroK8sClient;
async
Workflow with Services
use ;
use KubeJobStep;
use MaestroK8sClient;
use BTreeMap;
async
API Documentation
Examples
Check out the examples directory for comprehensive examples including:
- use_workflow_builder.rs - Building workflows with the WorkflowBuilder
- apply_and_watch_workflow.rs - Applying and watching workflow execution
- delete_workflow.rs - Cleaning up workflow resources
- use_services.rs - Creating and managing services
- use_sidecar.rs - Adding sidecar containers
- multi_step_workflow.rs - Multi-step workflows with dependencies
- dependency_system.rs - Using the dependency system
Contributing
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Write tests for your changes (TDD approach)
- Ensure all tests pass (
cargo test --verbose) - Run clippy (
cargo clippy) - Format your code (
cargo fmt) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Testing
# Run unit tests (fast, no cluster needed)
# Run integration tests (requires Docker and Kind)
# Run specific test
License
This project is dual-licensed under:
- MIT License (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
Contact
For questions and support:
- André Claudino - @andreclaudino
- Pedro Braga - @braga-rp
- Romulo Tavares - @tavaresrft
Documentation
Additional documentation is available at: