Skip to content

Deployment Runbook: Local

Preconditions

  • k3d cluster akshaya-staging exists and is reachable (kubectl --context k3d-akshaya-staging get nodes).
  • Namespace-local mysql-local/redis-local pods running in the staging namespace.
  • akshayabazaar-local-secrets Secret already applied in staging.
  • hosts file entry: 127.0.0.1 staging.akshaya.local.

See Local Development → First-time setup if any of the above isn't true yet.

Backup/checkpoint

Not applicable - local data is disposable by design. If you want a checkpoint anyway:

kubectl exec -n staging deploy/mysql-local -- mysqldump -u root -p ecommerce_db > local-backup.sql

Build

.\scripts\build.ps1 -Local
Builds akshayabazaar-backend:local and akshayabazaar-frontend:local, imports both into the k3d cluster.

Deploy

.\scripts\deploy-local.ps1
Runs helm upgrade --install akshaya-local helm/akshayabazaar -f values-local-staging.yaml --set backend.image.tag=local --set frontend.image.tag=local --namespace staging --wait.

Database migration

Runs automatically as a pre-install,pre-upgrade Helm hook Job - no separate step. See Kubernetes → Helm → Migrations.

Verification

.\scripts\verify-staging.ps1 `
  -Context k3d-akshaya-staging `
  -Namespace staging `
  -ReleaseName akshaya-local `
  -IngressHost staging.akshaya.local `
  -IngressPort 80

Expected result

Summary: 14 PASS, 0 WARNING, 0 FAIL

Smoke testing

curl.exe -I http://staging.akshaya.local
# HTTP/1.1 200 OK

Monitoring

Not applicable to local - monitoring.enabled: false in values-local-staging.yaml. Watch pods directly:

kubectl get pods -n staging -w

Rollback

.\scripts\rollback-staging.ps1 -Context k3d-akshaya-staging -Namespace staging -ReleaseName akshaya-local -Yes
Or scale to zero without rolling back the release:
.\scripts\stop-staging.ps1 -Context k3d-akshaya-staging -Namespace staging -ReleaseName akshaya-local -Yes

Common failure scenarios

See Local Development → Troubleshooting.