Reputation: 315
I have an ECS cluster consisting of container instances of instance type A, lets say its t2.small. The cluster consists of several machines running several services. Now, i am about to have a new sevice/task (lets call it "GreatRequirements") that will require a whole lot more cpu/memory than any of the other services/tasks. I would like to be able to boot up 1 large machine (Lets call it "LargeMachine) for the cluster, that the other tasks will never be placed on, so that this machine in the cluster is always available for my "GreatRequirements" service.
Is there any way that i can prevent all other services/tasks than "GreatRequirements" from being scheduled on that machine, other that making palcement constraints on ALL the other services/tasks that does so? Essentially, i want to prevent ECS form placing other services/tasks on the "LargeMachine", so that i wont end up in a situation where a bunch of small services/tasks prevents my "GreatRequirements" service from starting a task because it cant find a machine with sufficient cpu/memory.
Thanks
Upvotes: 1
Views: 985
Reputation: 315
I don't think there really is a good solution for this, other than changing the instancetype for all the instances, to a type that can handle the service with "GreatRequirements" - and somehow detect when a service cannot schedule a task because of insufficient cpu/memory, and scale additional instances into the cluster based on that.
Upvotes: 0
Reputation: 533
You can use the placement strategy/constraint of the tasks.
For example there are built-in attributes like:
In your task definition (Task placement section) you can have constraint like: attribute:ecs.instance-type == t2.medium
and this task will always be ran on a t2.medium
In your case I would rather use custom tag on my ECS containter instances `(Cluster -->choose the cluster --> ECS instances --> select the EC2 --> Click on Action --> click on View/Edit attributes and Add a custom attribute like Name=SomeName , Value=GreatRequirements.``
And in your task definition as constraint you can have:
attribute:SomeName == GreatRequirements
and that that will always run on that ec2 with that custom attribute
``attribute:SomeName != GreatRequirements` and that task will never be run on that ec2 instance with that custom attribute
And for more operation on those attributes, please check this out Operation on attributes
Hope this help.
Upvotes: 1