Quick Reference: Deployment Commands
Environment Variables (Set Before Running)
1. Initial Infrastructure Deployment
2. Deploy Application (Simple)
3. Deploy with Blue-Green (Recommended for Production)
4. Rollback (Emergency)
5. Database Operations
View Database Info
Run Migrations
Backup Database
Restore from Backup
6. Cache Operations
Check Redis Health
Flush Cache
7. Monitoring & Logging
View Logs
View Metrics (via kubectl)
View Metrics (via Grafana)
Search Traces (Jaeger)
8. Troubleshooting Commands
Check Cluster Status
Debug Pod
Check Network Connectivity
Check Secrets
9. Scaling Operations
Scale Deployment
Scale Node Group (AWS)
10. Infrastructure Validation
Validate Terraform
Validate Deployment
11. Emergency Procedures
Service Restart
Scale to Zero (Pause Service)
Force Delete Stuck Pod
Delete and Recreate Deployment
12. Useful Aliases
Add to.bashrc or .zshrc:
13. Common Workflows
Weekly Status Check
Pre-Deployment Checklist
Post-Deployment Validation
Quick Fixes
| Issue | Quick Fix |
|---|---|
| Pod CrashLoop | kubectl logs <pod> -n sparki-engine → check logs for errors |
| High latency | kubectl top pods -n sparki-engine → check CPU/memory |
| DB connection errors | nc -zv $DB_HOST 5432 → verify connectivity |
| Image pull error | kubectl describe pod <pod> -n sparki-engine → check image tag |
| Out of memory | kubectl scale deployment sparki-engine -n sparki-engine --replicas=<new-count> |
| Pod pending | kubectl describe pod <pod> -n sparki-engine → check resources/affinity |
Emergency Contact
- On-Call SRE: Page via PagerDuty
- Platform Lead: @alexarno
- Incident Commander: @incident-commander
Last Updated: December 2025
Version: 1.0