AWS::ECS::Cluster
Container runtime
service- Container applications run in the OS just as a process
- With ECS you must provision and maintain the underlying EC2 instances
- ECS is basically a scheduler! To decide to which instance the container will be provisioned
- A
ECS Cluster
is a collection ofECS Container Instances
- The
services
run in the ECS cluster. Each service is compose of one or moretasks
- Services can be exposed by a Load Balancer
- Container: Container
- Task: Pod
- Service: Deployment
- Cluster: Cluster
Scaling
- A
CloudWatch
alarm can be set in order to emit events based on theservice metrics
Autoscaling
can be enabled based on the metrics- For EC2 Launch Type,
Scale ECS Capacity Providers
to scale the ec2 instances
Properties
Type: AWS::ECS::Cluster
Properties:
CapacityProviders:
- String
ClusterName: String
ClusterSettings:
- ClusterSettings
Configuration:
ClusterConfiguration
DefaultCapacityProviderStrategy:
- CapacityProviderStrategyItem
ServiceConnectDefaults:
ServiceConnectDefaults
Tags:
- Tag
CapacityProviders
-
EC2 Launch Type
-
An
ECS Agent
runs inside each EC2 instances - This agent
registers
the instance to theECS Cluster
- Registered instances can receive
ECS Tasks
, which are container workloads - Charged based on EC2 instances and EBS volumes
- In order to forward requests to the applications, dynamic port mapping is used
-
Fargate Launch Type
-
No need the provision the underlying infrastructure. Simpler! Serverless!
- Each
ECS Task
is associated with a newENI
in theEC2 Cluster
(needs a long range VPC) -
Charged based on vCPU and memory resources
-
For forwarding traffic, the Load Balancer forwards to each IP (each task has a unique ENI)