Skip to content

Deployment

How to deploy, run migrations, and roll back. The full mechanics (CI/CD, image tags, manifests, GitOps) are in Infrastructure → Operations - this page is the quick recipe.

Environments

EnvHow it deploysNotes
localmake dev-<svc> / make dev-app-<name>hot reload
developDocker Composeper-service compose under infrastructure/deployments/
stagingmanual kubectl apply of the manifestsVNPAY cloud K8s
productionGitOps auto-deploymerge → pipeline → cluster

See the full per-environment sequence in Infrastructure → Operations → Deployment Sequence.

Deploy (quick)

  1. Build & push the image (CI does this on merge) - tag strategy in infra.
  2. Roll out: kubectl set image deploy/<svc> <svc>=<image>:<tag> -n nx-backend (staging) or merge for prod GitOps.
  3. Watch: kubectl rollout status deploy/<svc> -n nx-backend.

Database migrations

Migrations run as Jobs before the new version serves traffic - never hand-run against prod. Template + order in infra → Migration Jobs. Dev: bun run migrate:dev per package.

Rollback

  1. kubectl rollout undo deploy/<svc> -n nx-backend (back to the previous ReplicaSet), or re-deploy the last good tag.
  2. If a migration is involved, a rollback may need a compensating migration - do not blindly revert schema.
  3. Confirm health, then write the post-mortem.

Full rollback detail: Infrastructure → Operations → Rollback.

Secrets

Secrets are SealedSecrets decrypted into K8s Secrets - see Infrastructure → Configuration. Never put real secret values in the repo or this wiki.

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.