Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BFD-3701: Update BFD Server load balancing to support Blue/Green Deployments #2546

Merged
merged 26 commits into from
Feb 13, 2025

Conversation

malessi
Copy link
Contributor

@malessi malessi commented Feb 11, 2025

JIRA Ticket:
BFD-3701

What Does This PR Do?

This PR implements Blue/Green deployments by utilizing a Network Load Balancer with multiple Listeners each pointing to separate Target Groups. These Listeners listen on separate ports allowing traffic to "green" instances to only hit "green" and vice-versa.

Additionally, some defects with the existing Blue/Green ASG implementation have been fixed:

  • Warm Pool management has been moved entirely to the null_resource.manage_warm_pool resource due to defects in the Terraform AWS Provider, specifically that the force_delete_warm_pool property is not respected and Terraform Warm Pool creation is sometimes inconsistent
  • Only the green ASG's Launch Template version is updated to the latest version rather than both ASGs being updated

IMPORTANT: This PR cannot be merged until a strategy for resolving existing DNS entries is determined.

What Should Reviewers Watch For?

If you're reviewing this PR, please check for these things in particular:

What Security Implications Does This PR Have?

Please indicate if this PR does any of the following:

  • Adds any new software dependencies

  • Modifies any security controls

  • Adds new transmission or storage of data

  • Any other changes that could possibly affect security?

    • Introduction of new Network Load Balancer
  • I have considered the above security implications as it relates to this PR. (If one or more of the above apply, it cannot be merged without the ISSO or team security engineer's (@sb-benohe) approval.)

Validation

Have you fully verified and tested these changes? Is the acceptance criteria met? Please provide reproducible testing instructions, code snippets, or screenshots as applicable.

  • terraform applying server in 3701-test with simulated changes causing a new Launch Template version to be created (from version 10 -> 11, in this case), verifying that:
    • The odd ASG is chosen as green and, after scale-out, is attached to the green Target Group (reachable by port 7443)
    • The even ASG remains blue and remains attached to the blue Target Group (reachable by port 443)
    • odd's warm pool is created as expected
    • even's warm pool remains active with the appropriate number of instances
    • odds Launch Template version becomes 11
    • even's Launch Template version remains 10 (the last accepted version of BFD Server from the previous server apply cycle)
  • Subsequently terraform applying server in 3701-test without further changes to the Launch Template (simulating green being accepted to blue), verifying that:
    • The odd ASG is chosen as blue and is immediately attached to the blue TG and detached from green
    • The even ASG is scaled-in to 0 and detached from the blue TG with its instances remaining for the 60 second deregistration (satisfying non-zero downtime deployment requirements)
    • odd's warm pool remains
    • even's warm pool is destroyed without any delay
  • Running a local Locust Regression Suite, continuously, during the above terraform apply cycle against the blue TG (port 443 on the NLB), verifying that:
    • There were no errors (green -> blue swapover is invisible to clients)

…r bugs; set launch template version so that blue's version is not changed on apply
…ploy; remove unnecessary target group null_resource
…target group attach/detach; enable connection termination on target groups
…ral; annotate legacy code for removal in follow-up ticket
…to green ahead-of-time; replace blue/green string literals with locals
@malessi malessi force-pushed the BFD-3701 branch 2 times, most recently from b26bc00 to 982c9a8 Compare February 13, 2025 23:15
Copy link
Member

@mjburling mjburling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for trying to keep this as simple as possible. This looks really straightforward! 🥇

@malessi malessi marked this pull request as ready for review February 13, 2025 23:31
@malessi malessi merged commit e41bea6 into master Feb 13, 2025
8 checks passed
@malessi malessi deleted the BFD-3701 branch February 13, 2025 23:31
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.

3 participants