Will AWS ECS Task with ECS & Fargate compatibilities run on managed EC2 instances?

0

In aws ecs, i have created task to be fargate type, and in managed EC2 i have few tooling vm ec2 instances, i know that fargate is aws managing the underlying infrastructure and it can be running under any machines and we have no ideal on, my question is since i have few tooling vm ec2 instances provisioned. will aws spin up my task in one of my tooling vm ec2 sometime?

My task definition configured below:

.... ** "placementConstraints": [], "compatibilities": [ "EC2", "FARGATE" ], "requiresCompatibilities": [ "FARGATE" ],** ...

ON
已提问 3 个月前384 查看次数
1 回答
1
已接受的回答

If your ECS task is configured to use Fargate, it will not run on your manually managed EC2 instances. Fargate is a serverless compute engine for containers that abstracts the underlying infrastructure, meaning AWS manages the compute resources required to run your tasks. This allows you to focus solely on defining your containerized applications without managing the underlying EC2 instances.

Understanding ECS and Fargate Compatibility ECS on Fargate:

When you specify requiresCompatibilities as FARGATE, ECS will run your task using AWS Fargate, and the infrastructure is fully managed by AWS. You have no control over the specific EC2 instances on which your tasks run, as Fargate handles provisioning, scaling, and managing the compute resources. ECS on EC2:

When you run ECS tasks using EC2, you are responsible for managing the EC2 instances that serve as the underlying compute infrastructure for your tasks. Tasks with requiresCompatibilities set to EC2 will run on the EC2 instances that you have provisioned and registered to your ECS cluster. Task Definition Example Given your task definition configuration:

Json:

"placementConstraints": [],
"compatibilities": [ "EC2", "FARGATE" ],
"requiresCompatibilities": [ "FARGATE" ],

This configuration specifies that the task can run on both EC2 and Fargate (compatibilities: [ "EC2", "FARGATE" ]), but it requires Fargate (requiresCompatibilities: [ "FARGATE" ]). Key Points Fargate Tasks: If your task requires Fargate, it will not run on your managed EC2 instances. Fargate tasks run on infrastructure managed by AWS. EC2 Tasks: To run tasks on your specific EC2 instances, you need to set requiresCompatibilities to EC2 in your task definition. Example of EC2-Only Task Definition If you want to run a task on your managed EC2 instances, you need to configure your task definition like this: Json:

"placementConstraints": [],
"compatibilities": [ "EC2", "FARGATE" ],
"requiresCompatibilities": [ "EC2" ],

Summary Fargate: Tasks defined with requiresCompatibilities: [ "FARGATE" ] will not utilize your manually managed EC2 instances. EC2: Tasks defined with requiresCompatibilities: [ "EC2" ] will run on your manually managed EC2 instances. In your case, since your task definition requires Fargate, AWS will manage the underlying infrastructure, and your tasks will not run on your tooling VM EC2 instances.

已回答 3 个月前
profile picture
专家
已审核 3 个月前
profile pictureAWS
专家
已审核 3 个月前
  • Thank you for the explanation.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则