Platform Rollback
Platform rollback marks a deployment as rolled back and is used in conjunction with the CD pipeline's rollback scripts to revert to a previous platform version. The rollback endpoint updates deployment records to maintain an accurate history.
Marking a Deployment as Rolled Back
POST /api/v1/platform/deployments/tag/v2.1.0-abc1234/rollbackThis endpoint:
- Finds the deployment record by image tag
- Updates its status to
ROLLED_BACK - Records the rollback timestamp
- Returns the updated deployment record
Rollback Process
The full platform rollback involves multiple coordinated steps:
| Step | Action |
|---|---|
| 1 | Identify the target version from deployment history |
| 2 | Mark the current deployment as ROLLED_BACK via the API |
| 3 | CD pipeline deploys the target image tag |
| 4 | Record the new deployment (which points to the older version) |
| 5 | Verify platform health after rollback |
Finding Rollback Targets
To identify which version to roll back to, query the deployment history:
GET /api/v1/platform/deployments/history?environment=prod&limit=5Look for the most recent deployment with DEPLOYED status that predates the problematic deployment.
Rollback vs. New Deployment
A rollback is functionally a new deployment of an older version. The deployment history reflects this:
| Entry | Image Tag | Status |
|---|---|---|
| Latest | v2.0.0-def5678 | DEPLOYED (rollback target redeployed) |
| Previous | v2.1.0-abc1234 | ROLLED_BACK |
| Earlier | v2.0.0-def5678 | DEPLOYED (original) |
Rollback Safety
Before performing a rollback:
- Verify the target version's deployment record exists (
GET .../tag/:imageTag/exists) - Check that the target version's container images are still available in the registry
- Review the deployment notes for any migration steps that may need reversal
- Consider database migrations that may not be backward-compatible
Automated Rollback
The CD pipeline can be configured for automated rollback when health checks fail after a deployment. The automation:
- Detects health check failure within the configured window
- Identifies the previous successful deployment
- Marks the failed deployment as
ROLLED_BACK - Redeploys the previous version
- Sends a notification to the operations team