AWSECS


AWS ECS

Core Components

Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster. Launch types are

  1. EC2 Launch type

  2. Fargate Launch type (Fargate is easier than EC2 launc type when the task is created goto tasks and check the public ip, this will enable you to access your web application in the browser)

Amazon ECS is a regional service that simplifies running application containers in a highly available manner across multiple Availability Zones within a Region.

A Docker container is a standardized unit of software development(applications,libraries etc.),Containers are created from a read-only template called an image.

Images are typically built from a Dockerfile, a plain text file that specifies all of the components that are included in the container. These images are then stored in a registry from which they can be downloaded and run on your cluster.

Tasks

A task is the instantiation of a task definition within a cluster. After you have created a task definition for your application within Amazon ECS, you can specify the number of tasks that will run on your cluster.

The Amazon ECS task scheduler is responsible for placing tasks within your cluster.

Task Definitions

To prepare your application to run on Amazon ECS, you create a task definition.

Scheduler

Schedulers tasks

Service

Amazon ECS allows you to run and maintain a specified number of instances of a task definition simultaneously in an Amazon ECS cluster and this is called as a service.

If any of your tasks should fail or stop for any reason, the Amazon ECS service scheduler launches another instance of your task definition to replace it and maintain the desired count of tasks in the service depending on the scheduling strategy used.

Clusters

When you run tasks using Amazon ECS, you place them on a cluster, which is a logical grouping of resources. When using the Fargate launch type with tasks within your cluster, Amazon ECS manages your cluster resources.

When using the EC2 launch type, then your clusters are a group of container instances you manage.

An Amazon ECS container instance is an Amazon EC2 instance that is running the Amazon ECS container agent.

ALB

Application Load Balancers have a few primary components:

  1. The Load Balancer itself - from a CLI and API standpoint this is almost just a central point to attach options and configurations to.

  2. Target Groups - a common group of apps, in our case Tasks, that will receive load balanced traffic.

  3. Listeners - what ports and protocols is our Load Balancer listening on? i.e. Port 80, Protocol HTTP

  4. Listener Rules - when traffic arrives on a particular Listener, what do we do? i.e. Send it to a particular Target Group when the path is /

Container agent

The container agent runs on each infrastructure resource within an Amazon ECS cluster.

It sends information about the resource’s current running tasks and resource utilization to Amazon ECS as well as start/stop tasks when ECS tells it.

CloudWatch Container Insights is more detailed monitoring for containers

Control plane and Data Plane

Service

Amazon ECS allows you to run and maintain a specified number of instances of a task definition simultaneously in an Amazon ECS cluster.

Scheduling Engine(schedule tasks) and Placement engine(place the tasks on a cluster)

Service Scheduler

1.Replica scheduler strategy

2.Daemon scheduler strategy

3.Cron using Amazon Event Bridge

Constraints and Strategies(binpack and spread)

AWS Cloud Map is a cloud resource discovery service.

With Cloud Map, you can define custom names for your application resources, and it maintains the updated location of these dynamically changing resources.

This increases your application availability because your web service always discovers the most up-to-date locations of its resources.

Cloud Map natively integrates with ECS


These writings represent my own personal views alone.
Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.