1

I am confused about how Service AutoScaling automately works. Will it create EC2 instance automately? I create it and add it to a Cluster's service, but it does no create EC2 for placing my required number of tasks. Is any thing wrong with my settings? I check the [Events] and see "service s2 was unable to place a task because no container instance met all of its requirements. ", but shouldn't it create a EC2 if no instance met? Please give me some advice, thanks in advance.

Rocky
  • 1,287
  • 3
  • 15
  • 37

2 Answers2

3

but shouldn't it create a EC2 if no instance met

Not really. There are two types of scaling policies: scaling policies on an ECS service and scaling policies on the ECS cluster. Instances are added based on cluster scaling policies, and that's what you should set up in addition to your service scaling policy.

AWS has a couple of detailed tutorials on scaling ECS clusters: https://aws.amazon.com/blogs/compute/automatic-scaling-with-amazon-ecs/ https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch_alarm_autoscaling.html

Sergey Kovalev
  • 9,110
  • 2
  • 28
  • 32
3

AWS Elastic Container Services has two methods to deploy containers over aws environment

Where you no need to worry about orchestration of containers (task in aws)

  1. Fargate (Available in few regions like N.Virginia)
  2. Using EC2 in ECS

I guess you are using 2nd option to deploy application over ECS where you can provide details of scaling tasks/containers not ec2 instances.

For Auto-scaling of ec2 instances you should look into ASG of AWS.

As far as AWS ECS is concerned you need some building blocks which are as follows-

  1. Cluster
  2. Task definition (Memory, Network and Storage configs of tasks)
  3. Service contains EC2 instance configuration
  4. Auto scaling policies if you want to auto-scale tasks
Shubham Nigam
  • 3,844
  • 19
  • 32
  • Yes I use the 2nd. For ECS services also have auto scaling settings, so I mistaken that it will automatically increase the EC2 instance :) – Rocky May 01 '18 at 07:54