Harness Blue-Green Traffic Shifting introduces a progressive rollout mechanism that incrementally directs traffic between your blue and green environments, minimizing risk and enabling real-time validation. With built‑in approval gates and automated rollback criteria, it offers precise control over deployments on AWS ECS, Auto Scaling Groups, and Spot Elastigroup. Teams can now observe performance under real load and revert changes instantly, ensuring stability and confidence in every release.
Imagine streamlining every rollout with pinpoint precision—no more all-or-nothing flips that put your users at risk. Harness just unveiled the Blue-Green Traffic Shifting feature, and it’s set to revolutionize deployments across AWS ECS, Auto Scaling Groups, and Spot Elastigroup clusters. Say hello to incremental rollouts, real-time monitoring, and rollback options that keep your services humming without missing a beat!
Traditional blue-green deployments switch all user traffic from an existing environment ("blue") to a new environment ("green") in a single operation. While this approach isolates new versions in a separate environment, it also creates a high blast radius: any undetected issue in the green environment affects 100% of users, and rolling back requires switching all traffic back, which can take minutes and disrupt user experience.
The Deployment Dilemma: Full Traffic Shifts
When traffic is shifted in one operation, you lose the ability to validate the new version under real user load. A critical error—unexpected latency, resource exhaustion, or code regression—impacts every transaction until the rollback completes.
The Solution: Incremental Traffic Shifting
Blue-Green Traffic Shifting implements a canary-style rollout by adjusting traffic weights on the load balancer in discrete steps:
- Initialize Weighted Routing
Configure two target groups on an AWS Application Load Balancer (ALB)—one for blue, one for green. Harness can auto-create and manage these when you add the Traffic Shifting step.
- Define Traffic Increments
Start with a small percentage (e.g., 5%) to green and the remainder to blue. Specify subsequent increments (for example, 25%, 50%, 75%, then 100%).
- Monitor Metrics
Use CloudWatch, X‑Ray, Datadog, or another APM to track latency, error rates, CPU, and memory usage on green instances.
- Pipeline Weight Adjustments & Approvals
Define traffic-shift increments directly in your Harness pipeline and include approval steps after each change. This lets you verify key metrics (latency, errors, resource usage) and approve the rollout before proceeding to the next weight increment.
- Automate Rollback
Define failure criteria (for example, >1% HTTP 5xx errors over 60 seconds). If triggered, Harness resets traffic weights back to 100% blue.
- Complete Cutover
When green reaches 100%, the new version becomes primary. Optionally, Harness can decommission blue or retain it as a standby.
How Traffic Shifting Solves the Problem
- Risk Mitigation: Limit the impact of undetected defects to a small subset of real user traffic.
- Production Validation: Test new code under actual traffic patterns and data conditions that test environments can’t fully replicate.
- Fast, Controlled Rollback: A single API call reverts weights—no environment teardown or DNS delays.
- Operational Insight: Each weight adjustment acts as a checkpoint, giving your team measurable confidence before proceeding.
Leveraging AWS ALB and Elastigroup APIs
- AWS Application Load Balancer (ALB): Harness configures and manages weighted target groups on your ALB listener, using incremental weight adjustments to control traffic routing between blue and green ECS or ASG environments.
- Spot Elastigroup Control‑Plane API: Harness interacts with Spot Elastigroup’s control plane to register blue and green instance groups and adjust traffic weight parameters, enabling progressive rollouts on Spot instances.
Comparison: Traditional vs. Traffic Shifting
Traditional Blue-Green
- Traffic Change Method: Single 100% cutover in one API call
- Rollback Complexity: Requires tearing down or rebuilding environments, potential DNS or load balancer propagation delays
- Blast Radius: High (100% of traffic impacted)
Blue-Green Traffic Shifting
- Traffic Change Method: Incremental weight adjustments via successive pipeline steps
- Rollback Complexity: Single weighted reset call reverts traffic instantly
- Blast Radius: Low and configurable (only the chosen percentage)
Supported Platforms
- AWS ECS
Defines two ECS service deployments (blue and green) behind an ALB, enabling weighted routing for container-based workloads. Learn more.
- AWS Auto Scaling Groups
Configures blue and green EC2 instance fleets managed by an ASG, using ALB target groups to shift traffic between scaling groups. Learn more.
- Spot Elastigroup deployments
Manages Spot instance groups with Spot Elastigroup, registering blue and green groups and adjusting weights via the Elastigroup control-plane API. Learn more.
What’s Next
Explore ready-to-use pipeline samples for ASG, ECS, and Spot Elastigroup Blue-Green Traffic Shifting in the Harness Community GitHub repository: