Maintenance Mode

Manage maintenance windows with automatic container stop and start.

Operation Modes

ReadyStackGo tracks the operational state of each deployment separately from health status. This allows you to distinguish between planned downtime and actual failures.

Available Modes

đŸŸĸ Normal

Standard operation, all services should be running

🔧 Maintenance

Planned maintenance, services may be stopped

🔄 Migrating

Upgrade or migration in progress

🔴 Failed

Operation failed, requires intervention

âšī¸ Stopped

Stack intentionally stopped

Automatic Container Lifecycle

When entering maintenance mode, containers are automatically managed:

Container Lifecycle:

  • Normal → Maintenance: All stack containers are stopped
  • Maintenance → Normal: All stack containers are started

Excluding Containers

Some containers (like databases) should continue running during maintenance. Use the rsgo.maintenance label:

services:
  postgres:
    image: postgres:16
    labels:
      rsgo.stack: my-app
      rsgo.maintenance: ignore  # Won't be stopped

  api:
    image: myapp/api:latest
    labels:
      rsgo.stack: my-app
      # No rsgo.maintenance = will be stopped

Use Cases

  • Database Migrations: Stop app containers, run migrations, restart
  • Backup Windows: Stop services during backup operations
  • Configuration Updates: Safe config changes without traffic
  • Upgrades: Controlled version transitions with rollback support

Maintenance Observers

Automatically synchronize maintenance mode with external systems. Configure observers to monitor external state and trigger maintenance mode automatically.

SQL Extended Property

Monitor database properties from legacy or backend systems

SQL Query

Execute custom queries for complex maintenance conditions

HTTP Endpoint

Monitor external status APIs or maintenance endpoints

File Observer

Watch for maintenance flag files from legacy systems

# Example: Sync with ERP maintenance mode
maintenanceObserver:
  type: sqlExtendedProperty
  connectionString: ${DB_CONNECTION}
  propertyName: ams.MaintenanceMode
  maintenanceValue: "1"
  normalValue: "0"
  pollingInterval: 30s

Real-time UI Updates

Mode changes are pushed instantly via SignalR:

  • Dashboard shows current operation mode
  • Health status interpreted in mode context
  • Actions available based on current mode
  • Mode history for audit trail

API Integration

PUT /api/deployments/{id}/operation-mode
{
  "newMode": "Maintenance",
  "reason": "Scheduled weekly backup"
}

Benefits

  • Controlled downtime: Clear distinction between planned and unplanned outages
  • Automatic lifecycle: No manual container stop/start needed
  • Selective exclusion: Keep critical services running
  • Audit trail: Track who changed mode and when