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
demandé il y a 3 mois384 vues
1 réponse
1
Réponse acceptée

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.

répondu il y a 3 mois
profile picture
EXPERT
vérifié il y a 3 mois
profile pictureAWS
EXPERT
vérifié il y a 3 mois
  • Thank you for the explanation.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions