I am learning docker and containerization in AWS, so i may be asking a very trivial question. I want some clarification on the ECS Fargate concept. I understand from the documentation, that when i run my ECS cluster with Fargate for managing my containers (TASKS) , all the compute is handled by AWS Fargate. With the same idea in mind, I created a sample application.
- Uploaded the docker image in ECR
- Created task definition
- Launched an ECS Cluster and Started a service referencing the above created Task definition
However, the tasks kept on failing to start. When I linked an EC2 instance to the cluster(also called as ECS Container instance), only then my tasks ran(started).
Can someone please explain me the below -
- What role does ECS container instance (EC2) plays in ECS with fargate?
- Why is it needed? Can an application run without EC2 instance in this case?
- How would you determine the size of EC2 instance to link with ECS Fargate?
Appreciate your time and help. Thank you.