AWS ECS(Elastic Container Service)

 Task definition

The first object that should be created for the ECS. It is literally the template that is referred to when the task is made.

It is very much likely a 'docker run' command. It defines things like

1. Launch type(EC2 or Fargate)

2. Container environment(OS, Architecture, CPU, RAM size, etc)

3. Network mode(vpc, host, etc)

4. docker image(through URI)

5. Port Mapping

6. Environment variables 

7. Logging options

One important thing is, that you can put multiple containers in a single task definition. Those containers can communicate through link settings. Regarding it, Task definition might be closer to docker-compose up rather than docker run.

+ However, container-per-task is highly recommended because putting multiple containers in a  single task might hinder effective scaling.


Task definition consists of 'family name' and 'revision'. When you create a brand new Task definition, you can grant it a 'family name' and revision number is 1. If you make a revision out of it, the revision of it has a same family name with revision number of +1.


Task

Task is a set of containers actually deployed through ECS. Task is a basic unit for ECS, and it requires deployment configuration to run:

1. Task definition

2. Desired tasks: Desired number of tasks

3. Task group: All tasks with the same task group name are considered as a set when performing spread placement



Service

Service is a unit that manages the lifecycle of tasks. It has attributes like

1. Deployment options: Deployment strategy when the service is updated.

2. Load Balancing

3. Auto Scaling

etc.


Cluster

Cluster is a biggest unit of ECS. It is important that it is a unit that manages 'the computing resources'. Its parameters are 

1. Infrastructure: basically Fargate or EC2. If EC2, it requires extra fields like AMI, instance type, and Desired capacity(the number of instances)

2. Network: VPC, security groups, etc.

And also there are 2 different important objects in the cluster.


Container instances

It might sound like something different from EC2 instances, but it's almost the same. You can just think it as another logical name for EC2 instance used for ECS's management.


Capacity Provider
It is controller of the capacities. When cluster is EC2-based, the capacity provider is Auto-Scaling Group; this might get you straight through the point. It creates, deletes instances and runs tasks in the instances.

댓글

이 블로그의 인기 게시물

Interface of Java

Data Analytics Overview(OLTP vs OLAP)

Leetcode