Deploy Strategies
Mentat includes three rollout strategies because not every workload should be updated the same way. Fast stateless services, stateful APIs, and risky production changes all benefit from different deployment mechanics.
Configuration
deploy:
strategy: rolling # rolling | blue-green | canary
max_unavailable: 1 # max replicas down at once (rolling)
health_timeout_secs: 10 # wait time for health check
auto_revert: true # rollback on failure
canary_percent: 10 # % traffic to canary (canary only)
standby_secs: 600 # blue standby time (blue-green only)If a service does not define a deploy block, Mentat defaults to rolling updates with a conservative configuration.
How To Choose
| Rolling | Best default for fast stateless services |
| Blue-Green | Best when you want instant cutover and easy rollback |
| Canary | Best for high-risk changes you want to validate gradually |
Rolling
Rolling is the default strategy. Mentat replaces replicas in batches and keeps the service available while the rollout progresses.
1. Start a batch of new replicas
2. Wait for health
3. Stop the matching old replicas
4. Repeat until the rollout is complete
5. If health fails and auto_revert is enabled, roll back automaticallymt deploy api-gateway --image registry.example/api-gateway:v2Best fit: fast stateless services, especially when boot time is low and replacement is cheap.
Blue-Green
Blue-green creates a full replacement environment, waits until it is healthy, and then switches traffic in one move. The previous version can stay online for a defined standby window.
1. Start the full green set
2. Wait for all green replicas to become healthy
3. Switch traffic from blue to green
4. Keep blue on standby for rollback safety
5. Remove blue after the standby windowmt deploy api-service --image api-service:v2
mt rollback api-serviceBest fit: APIs and services where immediate reversal matters more than minimizing temporary overcapacity.
Canary
Canary sends a fraction of traffic to the new version first. The deploy remains in canary state until an operator promotes or aborts the change.
1. Calculate canary capacity from canary_percent
2. Start the canary replicas
3. Observe metrics and runtime behavior
4. Promote for full rollout or abort to revertmt deploy streamforge --image streamforge:v2 --strategy canary
mt canary promote streamforge
mt canary abort streamforgeBest fit: critical services and changes that should prove themselves in production before full exposure.
Rollback
Rollback works across all strategies. Mentat records the previous image so operators can reverse a change quickly when behavior diverges from expectations.
mt rollback <service>