-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feature Request: Configurable minimumHealthyPercent and maximumHealthyPercent for ECS Service Hotswap #29618
Comments
Thanks for the feature request. I saw some related discussion on this topic and @pahud's comment here: #22241 (comment)
I think this request needs some further review and discussion, would be interested to get your thoughts on that comment. |
@tim-finnigan , answering for my co-worker @rexrafa as he is OoO. We mostly agree with @pahud's comment that |
### Issue #29618 ### Reason for this change We aim to speed up deployment times in our development environment by using the hotswap feature. However, our services have dependencies on each other, and the current hotswap behavior is too disruptive. ### Description of changes We modified the hotswap implementation for ECS services to pass the `minimumHealthyPercent` and `maximumHealthyPercent` configurable parameters. These parameters are exposed to the cli and can be passed as `--hotswap-ecs-minimum-healthy-percent <number>` and `--hotswap-ecs-maximum-healthy-percent <number>` The implementation is careful to maintain the existing behaviour. That is, if none of the new flags is used, the current `minimumHealthyPercent = 0` and `maximumHealthyPercent = undefined` values are used. ### Description of how you validated changes We added a unit test validating that the correct values are passed to the task definition. We also executed using the locally built version of cdk validating that the behavior is as expected: the parameters are respected during hotswap deployments, and the existing API is maintained. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues and PRs are hard for our team to see. |
Describe the feature
Currently, when using the --hotswap flag for deploying ECS services, the minimumHealthyPercent is hardcoded to 0, which can be disruptive for services with interdependencies. This can result in downtime as the current tasks are stopped before the new ones are fully up and running. To improve the flexibility of hotswap deployments, allowing users to set the minimumHealthyPercent and maximumHealthyPercent parameters would be beneficial.
Use Case
We aim to speed up deployment times in our development environment by using the hotswap feature. However, our services have dependencies on each other, and the current hotswap behavior is too disruptive. We want to keep the current tasks running until the new ones are fully operational. Configuring minimumHealthyPercent and maximumHealthyPercent would give us the control needed to ensure smoother transitions during deployments.
Proposed Solution
Modify the ECS service hotswap implementation to accept minimumHealthyPercent and maximumHealthyPercent as configurable parameters, with default values of 0 and 200, respectively. These parameters should be exposed in the CDK, allowing users to override them as needed.
For example, the current implementation at:
aws-cdk/packages/aws-cdk/lib/api/hotswap/ecs-services.ts
Line 108 in 0fee99b
It could be modified to accept these parameters from the user's CDK stack configuration.
Other Information
No response
Acknowledgements
CDK version used
2.117.0
Environment details (OS name and version, etc.)
Darwin Kernel Version 23.3.0
The text was updated successfully, but these errors were encountered: