AWS EC2 Container Service – ECS

AWS EC2 Container Service – ECS
AWS EC2 Container Services – ECS is a high-performance, scalable container management service that supports Docker containers. It also allows you to run applications on a managed cluster EC2 instances.
ECSis a regional service that makes it easy to run application containers across multiple AZs in a region.
This eliminates the need for cluster management infrastructure installation, operation, and scaling.
It helps to schedule the placement of containers throughout the cluster based upon the resource requirements and availability requirements.
Allows integration of third-party or custom schedulers to meet specific business or application requirements.
AWS Fargate.ECS Launch Types offers a serverless option
Type of EC2 Launch
EC2 Launch Type – Create and deploy EC2 instances within your cluster to run your containers.
The EC2 launch type is appropriate for the following workloads. Workloads that require consistent high CPU core and memory utilization
Large workloads that must be optimized for price
Applications require access to persistent storage
Your infrastructure must be managed directly
Type of AWS Fargate Launch
AWS Fargate, a technology that allows you to use Amazon ECS to run containers and pay-as-you go with Amazon ECS, is a technology that makes it easy to manage Amazon EC2 instances without the need to manage servers.
AWS Fargate eliminates the need for clusters of virtual machines to run containers. It also eliminates the need for server types to choose, scale, optimize cluster packing, and decide when to scale them.
The Fargate launch type is suitable to the following workloads.
You may have small workloads, but you might experience a brief burst of productivity.
Minimal workloads
Batch workloads
ECS Components
Images and containers
ECS applications must be designed to run in Docker Containers. This is a standard unit of software development that contains all the components required to run an application.
Containers are made from a read-only template known as an image.
Images are usually created from a Dockerfile. They are stored in a registry that can be downloaded and used on container instances.
ECS can be configured for access to a private Docker image Registry within a VPC or Docker Hub, or integrated with EC2 Container Registry.
Clusters
An ECS cluster is a logical grouping EC2 container instances that run tasks or services.
ECS downloads container images from the specified registry, and runs them on your container instances within your cluster. Task Definitions
Task definition is a description for an application that includes one or more containers of docker.
To prepare an application for ECS, you need to define the task.
Task definition is a JSON file that describes one or several containers in your application.
Task definitions define various parameters for the application. These include containers to use, their repositories and ports to be opened.
The ECS agent and the container runtime environment use Task Execution Role to prepare containers for running, e.g. Pull images from ECR, manage logs, etc. It is not used for the task itself.
Task Role grants additional AWS permissions to containers that are running in the task.
Network mode is the Docker networking mode that will be used for containers in the task. None, bridge, awsvpc and host are valid values.
A task is the invocation of a task definition on an instance of the container within the cluster.
Once you have created a task description for the application within ECS you can specify how many tasks will run on the cluster.
ECS task scheduler is responsible to place tasks on container instances. There are many scheduling options available.
ECS Service allows you to manage and maintain a set number of