Deployment Runbook
Overview
This runbook covers deploying Shinkansen Commerce to production using Kubernetes.
Pre-Deployment Checklist
- All tests passing
- Code reviewed and approved
- Migration scripts prepared
- Environment variables configured
- Database backups enabled
- Monitoring configured
- Rollback plan documented
Deployment Steps
1. Build Docker Images
bash
make docker-build2. Push to Registry
bash
make docker-push3. Apply Kubernetes Manifests
bash
cd deploy/k8s
kubectl apply -f namespace.yaml
kubectl apply -f configmaps.yaml
kubectl apply -f secrets.yaml
kubectl apply -f services/
kubectl apply -f deployments/4. Verify Deployment
bash
kubectl get pods -n shinkansen
kubectl logs -f -n shinkansen -l app=gatewayRolling Updates
Update Single Service
bash
kubectl set image deployment/gateway \
gateway=docker.io/afasari/gateway:v1.0.1 \
-n shinkansenRollback if Issues
bash
kubectl rollout undo deployment/gateway -n shinkansenMonitoring After Deployment
Check Health
bash
curl https://api.shinkansen.com/healthCheck Logs
bash
kubectl logs -f -n shinkansen --all-containers=trueTroubleshooting
Pods Not Starting
bash
kubectl describe pod <pod-name> -n shinkansenServices Not Accessible
bash
kubectl get svc -n shinkansen
kubectl get ingress -n shinkansenRollback Procedure
Immediate Rollback
bash
kubectl rollout undo deployment/gateway -n shinkansenFull Rollback
bash
kubectl delete -f deploy/k8s/
kubectl apply -f deploy/k8s/previous/