-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Rolling Blue-Green Deployments for AWS-LB (ALB/*NLB) #1948
base: main
Are you sure you want to change the base?
Rolling Blue-Green Deployments for AWS-LB (ALB/*NLB) #1948
Conversation
6a11384
to
0627fa2
Compare
I can't tell if there is anything left to be done on this? |
@@ -61,6 +72,60 @@ The following attributes are exported in addition to the arguments listed above: | |||
* `id` - The ARN of the listener (matches `arn`) | |||
* `arn` - The ARN of the listener (matches `id`) | |||
|
|||
## Waiting for Capacity | |||
|
|||
A newly-created Target Group is initially empty, with it's eventual members usually |
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.
- s/it's/its/
## Waiting for Capacity | ||
|
||
A newly-created Target Group is initially empty, with it's eventual members usually | ||
composed of ASG instances that initialize as the ASG comes up to it's desired |
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.
- s/it's/its/
} | ||
|
||
// Poll causes the poller to continuously test the output of | ||
// it's configured url with the specified number of concurrent |
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.
- s/it's/its/
- s/url/URL/
|
||
errCount, err := p.waitForURLReady() | ||
if err != nil { | ||
return fmt.Errorf("Timed out waiting for url to become initially ready; %v", err) |
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.
- s/url/URL/
return nil | ||
} | ||
|
||
// waitForURLReady continuously pings the configured url until |
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.
- s/url/URL/
|
||
// Complete stops the poller's clients and returns | ||
// an aggregate error describing any of the errors | ||
// which occurred while polling the configured url |
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.
- s/url/URL/
- Punctuate this sentence.
} | ||
|
||
// rollingVersionPoller exists to continuously ping a particular | ||
// url, testing the string result returned, and treating it the 'version' for |
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.
- s/url/URL/
// after that, the endpoint is allowed to return one other value, considered the | ||
// 'green' version--once the endpoint has returned a value for the 'green' version, | ||
// it will be considered an error if the endpoint returns any other value. | ||
// |
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.
- Remove blank comment line.
Is this PR going to be merged? Is there another way to do this without it being merged? Thanks |
@aeschright @seh any chance this can be looked at? I really will make my life so much better. Thanks |
any chance this will get merged any time soon? It's causing production errors on apply.. |
This PR adds the capability of rolling (zero-downtime) deployments to the newer
aws_lb
resources, similar to the rolling deployment pattern used foraws_elb
resources.Even better, in this case, instances from the new ASG are available for routing until all of them are ready, and the change-over is seamless so that a given user will not received mixed-version answers from the app.
This solves #494, although the desired goal of no schema changes was not possible, due to the inherent differences in the new load-balancer resources and their decoupling from the autoscaling groups to which they route--however, if the defaults are acceptable, the 2 new optional attributes can be omitted, and the experience will be the same from the terraform user's perspective.
Changes: ( on the
aws_lb_listener
resource )Adds a
min_target_group_capacity
attribute (optional); during creation and updates, the listener will wait for this number of instances to report healthy status before updating the default action. When not specified, this value is determined from the (sum of)DesiredCapacity
value(s) on the autoscaling group(s) targeted by the target group. Set to0
to disable waiting.Adds a
wait_for_capacity_timeout
attribute (optional); this configures how long the listener should wait for the desired target group capacity before failing in error. Defaults to10m
.The waiting occurs on the
aws_lb_listener
resource since Target Groups only become eligible for health checks upon attachment to a Load Balancer. This approach uses a "dummy rule" (essentially non-routable) which serves to enable health checks on the target group before it is routed any requests from the load balancer.Edit (2017-10-23):
Note: NLB is not currently supported due to the lack of that capability in the provider overall (follow #1838 for details)