[DevOps] Zero-Downtime Blue-Green & Canary Deployment Infrastructure with Kubernetes & Helm
Overview & Background
As FlowFi's transaction volume grows, deploying backend updates, indexer fixes, or database migrations cannot incur service disruptions or dropped WebSocket/SSE client streams. Production-grade high-availability infrastructure requires standardized Kubernetes manifests, Helm charts, and automated Blue-Green / Canary deployment pipelines with automated rollback capabilities.
Detailed Problem Statement
- Downtime During Deployments:
- Simple rolling updates can terminate active long-polling SSE connections or interrupt in-flight indexer batch ingestion.
- Database Migration Desync:
- Running Prisma migrations directly on startup can cause race conditions if multiple container replicas spin up simultaneously.
- Lack of Standardized Orchestration:
- The repository currently relies on basic Dockerfiles and shell scripts, without enterprise-grade Helm charts for multi-cloud deployments (AWS EKS, GCP GKE, DigitalOcean).
Technical Specification & Architecture
1. Production Helm Chart (deploy/charts/flowfi/)
Structure:
deploy/charts/flowfi/
├── Chart.yaml
├── values.yaml
├── values-production.yaml
└── templates/
├── backend-deployment.yaml
├── indexer-statefulset.yaml
├── frontend-deployment.yaml
├── ingress.yaml
├── hpa.yaml
├── pdb.yaml
└── migration-job.yaml
2. Architecture & Deployment Mechanics
- Indexer Isolation: Run indexer as a singleton
StatefulSetwithreadinessProbechecking ledger synchronization lag, preventing duplicate worker execution. - API Pods Blue-Green / Canary:
- Deploy backend API pods with Horizontal Pod Autoscaler (HPA) targeting 70% CPU / Memory utilization.
- Ingress controller (NGINX / Traefik / AWS ALB) manages weighted canary traffic splitting (e.g. 10% canary -> 100% stable).
- Graceful Termination Handling:
- Implement
preStophooks sendingSIGTERMand allowing 30-second graceful drain for active SSE clients before pod eviction.
- Implement
- Pre-Upgrade Migration Job:
- Execute Prisma database migrations in a dedicated Helm
pre-upgradehook job with advisory locking before launching new API pods.
- Execute Prisma database migrations in a dedicated Helm
3. Automated Rollback Trigger
- ArgoCD / GitHub Actions monitors Prometheus error rates (
flowfi_http_requests_total{status=~"5.."}). If 5xx error rate exceeds 1% during canary rollout, immediately abort and roll back.
Target Files
deploy/charts/flowfi/Chart.yamldeploy/charts/flowfi/values.yamldeploy/charts/flowfi/templates/backend-deployment.yamldeploy/charts/flowfi/templates/indexer-statefulset.yamldeploy/charts/flowfi/templates/migration-job.yaml.github/workflows/deploy-canary.yml
Acceptance Criteria
- [ ] Helm chart successfully renders templates and passes
helm lint. - [ ] Pre-upgrade migration job runs to completion before new application pods are scheduled.
- [ ] Backend pods gracefully drain active SSE connections on
SIGTERMwithout abrupt connection termination. - [ ] Indexer runs strictly as a singleton to eliminate dual-indexer race conditions.
- [ ] Documentation includes complete deployment guide for AWS EKS, GCP GKE, and local Minikube.
@EneGab has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
Hi maintainer, please assign me this issue
ℹ️ Repo Maintainers: To accept this application, review their application or assign @EneGab to this issue.
@code-ony has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
I would love to work on this issue, please assign it to me
ℹ️ Repo Maintainers: To accept this application, review their application or assign @code-ony to this issue.
Congratulations, @code-ony! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @code-ony: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
@AkpakaProsper has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
I would love to work on this issue
ℹ️ Repo Maintainers: To accept this application, review their application or assign @AkpakaProsper to this issue.
@Hotmopo has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
Hello maintainer, i would like to work on this issue
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Hotmopo to this issue.
Congratulations, @Hotmopo! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.
🧑💻 @Hotmopo: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
This issue has been completed by @Hotmopo as part of the Stellar Wave Program's 10th Wave 🥳
😎 @Hotmopo: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.