-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
malessi
commented
Feb 11, 2025
…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
…y apply regardless of state or latest version
…only valid deployment_states
…e need to update it for the NLBs
b26bc00
to
982c9a8
Compare
mjburling
approved these changes
Feb 13, 2025
There was a problem hiding this 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! 🥇
aschey-forpeople
approved these changes
Feb 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
null_resource.manage_warm_pool
resource due to defects in the Terraform AWS Provider, specifically that theforce_delete_warm_pool
property is not respected and Terraform Warm Pool creation is sometimes inconsistentgreen
ASG's Launch Template version is updated to the latest version rather than both ASGs being updatedIMPORTANT: 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 dependenciesModifies any security controlsAdds new transmission or storage of dataAny other changes that could possibly affect security?
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 apply
ingserver
in3701-test
with simulated changes causing a new Launch Template version to be created (from version 10 -> 11, in this case), verifying that:odd
ASG is chosen asgreen
and, after scale-out, is attached to thegreen
Target Group (reachable by port7443
)even
ASG remainsblue
and remains attached to theblue
Target Group (reachable by port443
)odd
's warm pool is created as expectedeven
's warm pool remains active with the appropriate number of instancesodd
s Launch Template version becomes11
even
's Launch Template version remains10
(the last accepted version of BFD Server from the previousserver
apply cycle)terraform apply
ingserver
in3701-test
without further changes to the Launch Template (simulatinggreen
being accepted toblue
), verifying that:odd
ASG is chosen asblue
and is immediately attached to theblue
TG and detached fromgreen
even
ASG is scaled-in to 0 and detached from theblue
TG with its instances remaining for the 60 second deregistration (satisfying non-zero downtime deployment requirements)odd
's warm pool remainseven
's warm pool is destroyed without any delayterraform apply
cycle against theblue
TG (port443
on the NLB), verifying that:green
->blue
swapover is invisible to clients)