Files
pos-system/docs/en/runbooks/rollback-procedure.md
Ho Ngoc Hai b104fafa85 Refactor auth-service to iam-service and update related documentation
- Renamed auth-service to iam-service across various files for consistency.
- Updated Dockerfiles, deployment configurations, and documentation to reflect the service name change.
- Enhanced testing commands in documentation to point to the new iam-service.
- Removed outdated auth-service files and configurations to streamline the project structure.
- Improved bilingual documentation for clarity on the new service structure and usage.
2025-12-30 20:54:21 +07:00

1.3 KiB

Rollback Procedure

When to Rollback

  • Service is down or unstable
  • Critical bugs introduced
  • Performance degradation
  • Data corruption risk

Rollback Steps

Kubernetes Rollback

  1. Identify current version

    kubectl get deployment iam-service -n production -o jsonpath='{.spec.template.spec.containers[0].image}'
    
  2. Rollback to previous version

    kubectl rollout undo deployment/iam-service -n production
    
  3. Verify rollback

    kubectl rollout status deployment/iam-service -n production
    
  4. Check service health

    curl https://api.goodgo.vn/health
    

Database Migration Rollback

Note: Prisma doesn't support automatic rollback. Create a new migration to reverse changes.

  1. Create reverse migration:

    cd services/iam-service
    pnpm prisma migrate dev --name rollback_previous_change
    
  2. Apply reverse migration:

    pnpm prisma migrate deploy
    

Docker Compose Rollback

  1. Stop current containers:

    docker-compose down
    
  2. Checkout previous version:

    git checkout <previous-commit>
    
  3. Rebuild and start:

    docker-compose up -d --build
    

Post-Rollback

  1. Verify functionality
  2. Monitor metrics
  3. Document rollback reason
  4. Plan fix for next deployment