[ECS] [request/bug?]: Add scale in protection on hosts running a task via RunTask
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
When using a ECS cluster with EC2 auto scaling group as capacity provider.
When starting tasks via RunTask actions on ECS the EC2 instance, where the task gets placed on, should be protected from scale in. Those are markes as protected from scale in, but still gets stopped when auto scaling group is scaling down/in.
**Which service(s) is this request for?**
ECS with EC2 ASG as capacity provider
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
We are using ECS to manage our background processors (Rails app with resque workers running inside a task).
We have two kind of jobs, short-running interrupt able or repeatable jobs (image processing) and long running not interrupt able jobs (video processing and streaming). The short running jobs are managed by a ECS Service.
As we can't tell ECS Services, which jobs should be stopped, when scale in, we needed to implement our own 'scaling logic' for long running jobs. We use RunTask for scheduling new workers and stop tasks by them self, when scaling down.
*Bug or unexpected behavior:*
When we start a new task via RunTask action, we would expect the instances, where the task gets started on to be marked as protected from scale in, but it doesn't.
**Are you currently working around this issue?**
We manually observe the task count and start additional tasks, if any task got stopped due to the termination of the underlying EC2 host.
**Additional context**
We would not need to use our own scaling logic via RunTask, if scale in for services would be controllable, see:
https://github.com/aws/containers-roadmap/issues/125
Contributor guide
Assessment
This issue has not been assessed yet.