Uncloud updates your services without downtime by replacing containers one at a time. Each new container must pass health checks before the deployment continues, ensuring your service stays available throughout the update.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/psviderski/uncloud/llms.txt
Use this file to discover all available pages before exploring further.
How rolling updates work
When you runuc deploy, Uncloud updates containers sequentially:
For a service with 3 replicas using the default
start-first order:
- Start new container 1, wait until healthy
- Stop and remove old container 1
- Start new container 2, wait until healthy
- Stop and remove old container 2
- Start new container 3, wait until healthy
- Stop and remove old container 3
Update order
The update order controls whether the new container starts before or after stopping the old one.start-first (default)
Start the new container before stopping the old one:- Pros: Zero downtime, service always available
- Cons: Briefly runs both containers simultaneously
- Best for: Stateless services (web apps, APIs, workers)
stop-first
Stop the old container before starting the new one:- Pros: Only one container runs at a time, prevents data corruption
- Cons: Brief downtime during the transition
- Best for: Stateful services (databases, services with volumes)
Automatic order selection
Uncloud automatically chooses the update order based on your service configuration:| Scenario | Order | Reason |
|---|---|---|
| Default | start-first | Minimize downtime |
| Host port conflicts | stop-first | Old container must free the port |
| Single replica + volume | stop-first | Prevent concurrent writes to same volume |
| Multi-replica + volume | start-first | Concurrent access already happening |
Health monitoring
After starting each new container, Uncloud monitors it for failures.Default monitoring period
By default, Uncloud waits 5 seconds and checks that the container:- Stays running (doesn’t crash)
- Doesn’t restart repeatedly
- Becomes healthy if it has a health check
Change monitoring period
Adjust the monitoring period for your service:Skip monitoring
Set to0s to skip monitoring entirely:
--skip-health flag:
Global default
Change the default monitoring period for all services:monitor settings override the global default.
Health checks
Configure health checks to make deployments safer and faster.Why use health checks
- Faster deployments: Container marked healthy as soon as the check passes
- Safer rollouts: Detect broken deployments before they affect traffic
- Automatic recovery: Unhealthy containers removed from load balancing
Configure in Compose file
Configure in Dockerfile
Health check behavior during deployment
- Container starts
- Health check runs according to
interval(orstart_intervalduringstart_period) - If container becomes
healthybefore monitoring period ends, deployment succeeds early - If container is
unhealthyafter monitoring period, Uncloud rolls back - Transient
unhealthystates during monitoring are tolerated
Health check formats
Three formats are supported: Shell command:Example health check endpoints
Node.js (Express):Rollback on failure
If a new container fails health monitoring, Uncloud automatically rolls back:Inspect failed containers
After a failed deployment:Retry after failure
Fix the issue and runuc deploy again. Uncloud skips successfully updated containers and only redeploys the remaining ones.
Update strategies for different scenarios
Stateless web application
Stateful database
Single replica with volume
stop-first to prevent concurrent writes to volume.
Multi-replica with volume (safe concurrent access)
Host port binding
stop-first because old container must free port 9090 before new one can bind.
ServiceSpec and UpdateConfig reference
Based on the source code, here are the key structures:ServiceSpec fields
UpdateConfig fields
Stop grace period
Time to wait after SIGTERM before sending SIGKILL:Advanced scenarios
Canary deployments
Deploy to a subset of machines first:Forced recreation
Force container recreation even if nothing changed:- Picking up external volume changes
- Resetting container state
- Testing deployment process
Emergency rollback
Quickly roll back to previous version:--skip-health flag speeds up the rollback but skips health checks.
Monitoring deployments
Watch deployment progress
uc deploy shows real-time progress:
Check service health after deployment
Verify all containers are healthy
Best practices
Always configure health checks
Always configure health checks
Health checks make deployments safer and faster. Every service should have one:
Use appropriate update order
Use appropriate update order
Let Uncloud choose automatically unless you have specific requirements:
- Stateless services:
start-first(automatic) - Stateful services:
stop-first(automatic for volumes) - Host ports:
stop-first(automatic)
Test deployments in staging
Test deployments in staging
Always test deployments in a staging environment before production:
Monitor during rollout
Monitor during rollout
Watch logs and metrics during deployment:
Plan for rollback
Plan for rollback
Keep previous versions available for quick rollback:
Next steps
Health Checks
Deep dive into container health checks
Scaling
Scale services horizontally
Docker Compose
Learn about Compose file features
Deploying Services
Deploy with uc run
