Skip to content

Add/blue green deploy workflow - #586

Merged
LaGodxy merged 2 commits into
StarkMindsHQ:mainfrom
oscarj007:add/blue-green-deploy-workflow
Apr 30, 2026
Merged

Add/blue green deploy workflow#586
LaGodxy merged 2 commits into
StarkMindsHQ:mainfrom
oscarj007:add/blue-green-deploy-workflow

Conversation

@oscarj007

Copy link
Copy Markdown

Summary

Adds a complete blue-green deploy workflow for EKS with manual dispatch, kubeconfig configuration, image build/push, post-switch health checks and automatic rollback.

What changed

.github/workflows/blue-green-deploy.yml: workflow (manual workflow_dispatch, build/push, aws eks update-kubeconfig, deploy + rollback)
blue-green-deploy.sh, blue-green-rollback.sh, integration_test.sh: deploy/rollback/integration test scripts
k8s manifests: deployment + service templates used by the workflow
IAM_CI_POLICY.md, SECRETS.md: instructions for IAM, OIDC and repository secrets

Why

Provide a safe blue/green rollout that lets owners run deployments from Actions or CI, verify health via service DNS, and automatically rollback on failure.
Required repository secrets

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION
EKS_CLUSTER_NAME

How to run (owner)

From Actions UI: select Blue-Green Deploy to EKS → Run workflow (choose branch/main).
Or merge to main (push will trigger it).
Example manual/test (locally with kube access):
Testing notes

Run in a non-prod namespace first (e.g., staging).
Ensure the service myapp-service exists and pods expose /healthz on the probe port.
The workflow will:
build and push image
update kubeconfig via aws eks update-kubeconfig
deploy the new colored deployment (myapp-blue / myapp-green)
patch myapp-service selector to the new version
run post-switch health checks (ephemeral curl pod)
rollback automatically if checks fail
Rollback / Recovery

Automatic rollback runs on failure.
Manual rollback:
Security & recommendations

Do NOT commit AWS keys or kubeconfig.
Prefer GitHub Actions OIDC to avoid long-lived AWS keys (see IAM_CI_POLICY.md).
Use least-privilege IAM role; map role to a restricted Kubernetes ClusterRole instead of system:masters where possible.
Checklist before merging

Add the required repository secrets listed above.
Confirm deployment-template.yaml and service.yaml match the running cluster (namespaces, probe path/port).

closes #460

@oscarj007
oscarj007 requested a review from LaGodxy as a code owner April 29, 2026 10:51
@LaGodxy
LaGodxy merged commit 807dfd7 into StarkMindsHQ:main Apr 30, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DevOps: Implement Blue-Green Deployment Strategy

2 participants