- 新しい順
- 投票が多い順
- コメントが多い順
Hi! So if you register the EC2 instance to join the ECS Cluster (and therefore also be an ECS Instance), you can create services that the cluster will then deploy in the available pool of ECS instances.
You can create deployment constraints, which are rules to say "deploy this service, in that way, on nodes that have these properties", which means it will try only create tasks if there are ECS instances, with available capacity, that match these rules to deploy the containers to.
If you prefer to not have to manage EC2 instances anymore, you can go down the Fargate route. If your use-case is simple enough, that's my go-to recommendation, as the (for on-demand) the maybe extra costs, IMHO, are outweight by simplicity. In that case each service' tasks gets their own host, which further ensures isolation.
If you want to scale in the same or similar way as Fargate does but not have to worry about provisioning the EC2 instances, you can create an Autoscaling Group and give that as a Capacity provider to your ECS cluster. ECS will then drive the autoscaling based on the number of needed containers for your services, and still allows to respect placement rules (strategies) as mentioned above.
When creating your service, you can specify which target groups of a load balancer you would like to register. ECS and ELB then communicate together to automatically register new containers, send traffic to them, or de-register these if unhealthy.
If you want to deploy with something docker-compose compatible which deals with creating all your services definitions, IAM rules, permissions etc, and lots more, try out ECS Compose-X | the labs.
関連するコンテンツ
- 質問済み 3年前
- AWS公式更新しました 2年前
So, does this mean that if I have a t3.medium instances. I can run all containers inside this instance without provisioning other instances?
Technically, yes, if that is the only instance you have. But now, know that the ECS agent will report the CPU/RAM available to the containers. So if you have 10 tasks which require a minimum of .5GB of RAM and .25 CvPUs, then would that all fit in the instance type ? You might run out of space really quickly.
If you want HA with failover, running a cluster with a single instance is not quite the way to go.