| Field | Value |
|---|---|
| Runbook ID | RB-02 |
| Scope | Application deployment rollback |
| Owner | Platform / DevOps Team |
| Last Review | 2026-05-15 |
Roll back when all of the following are true:
Do not roll back if:
# Check rollout history
kubectl rollout history deployment/ums-auth-api -n ums-prod
# Rollback to previous revision
kubectl rollout undo deployment/ums-auth-api -n ums-prod
# Rollback to specific revision
kubectl rollout undo deployment/ums-auth-api -n ums-prod --to-revision=3
# Verify rollback status
kubectl rollout status deployment/ums-auth-api -n ums-prod --timeout=120s
# Confirm running image
kubectl get deployment ums-auth-api -n ums-prod -o jsonpath='{.spec.template.spec.containers[*].image}'
Warning: Only execute if the migration was destructive (dropped/renamed columns). If data was inserted, coordinate with DBA.
# Check current migration version (TypeORM)
kubectl exec -n ums-prod deploy/ums-auth-api -- npx typeorm migration:show
# Run down migration for last applied
kubectl exec -n ums-prod deploy/ums-auth-api -- npx typeorm migration:revert
# Verify schema state
kubectl exec -n ums-prod deploy/ums-db-pod -- psql -U ums_app -d ums_prod \
-c "SELECT version, name, run_on FROM migrations ORDER BY run_on DESC LIMIT 5;"
When a DB migration has already run and rollback is not safe:
main[hotfix] in commit message)# Disable feature flag via CLI (if using OpenFeature / LaunchDarkly)
ums-admin feature-flag disable --name "new-auth-flow" --env prod
# Or via kubectl ConfigMap patch
kubectl patch configmap ums-feature-flags -n ums-prod \
--type merge \
-p '{"data":{"NEW_AUTH_FLOW_ENABLED":"false"}}'
# Restart pods to pick up config change
kubectl rollout restart deployment/ums-auth-api -n ums-prod
kubectl get pods -o wide)curl https://ums.internal/healthAnnotations → Create annotation)| Back to Operations Index | Back to Master Index |