Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are usually the basis on grouping Fargate applications under an ECS cluster?

Tags:

Based on amazon docs:

An Amazon ECS cluster is a logical grouping of tasks or services. If you are running tasks or services that use the EC2 launch type, a cluster is also a grouping of container instances. If you are using capacity providers, a cluster is also a logical grouping of capacity providers. When you first use Amazon ECS, a default cluster is created for you, but you can create multiple clusters in an account to keep your resources separate.

In our use case, we are not using EC2 launch types. We are mainly using Fargate.

What are the usual basis/strategy on grouping services? Is it a purely subjective thing?

Lets say I have a Payment Service, Invoice/Receipt Service, User Service, and Authentication Service. Do I put some of them in an ECS cluster or is it best practice to have them on separate ECS clusters.

like image 840
froi Avatar asked Jun 26 '20 17:06

froi


People also ask

What is cluster in ECS fargate?

Clusters. An Amazon ECS cluster is a logical grouping of tasks or services. You can use clusters to isolate your applications. When your tasks are run on Fargate, your cluster resources are also managed by Fargate.

Which of the following services are used during the creation of an ECS cluster?

There are three templates available for the ECS cluster. The Networking only template creates clusters using AWS Fargate. AWS Fargate is the latest technology provided by AWS to deploy ECS clusters. AWS Fargate is a serverless service to deploy ECS clusters, and you do not need to manage the nodes inside the cluster.

How many services are in ECS cluster?

Amazon ECS announces increased service quota for container instances per cluster. Amazon Elastic Container Service (Amazon ECS) today increased the default service quota for container instances per cluster. You can now launch up to 5,000 instances per cluster, an increase from 2,000.

Does fargate use security groups?

Security group policies for Fargate pods can be applied using the same Kubernetes native workflow that is already supported for pods running on Amazon EC2 worker nodes. Support for assigning security groups to Fargate pods is available for EKS clusters running Kubernetes version 1.18 and above.


1 Answers

A service is a functioning application, so for example you might have an authentication service or payment service etc.

Whilst services can speak between one another, a service by itself should contain all parts to make it work, these parts are the containers.

Your service may be as simple as one container, or contain many containers to provide its functionality such as caching or background jobs.

The services concept generally comes from the ideas of both service driven design and micro service architecture.

Ultimately the decision comes down to you, you could put everything under one service, but this could lead to problems further down the line.

One key point to note is the scaling of containers is done at a service levels so you would need to increase all containers that are part of your task definition. You generally want to scale to meet the demands of functionality.

An ECS Cluster may contain one service or contain a number of services that produce a deliverable. For example in AWS S3 is made up of more than 200 micro services, these would be a cluster. However you would not expect every AWS service to be part of the same cluster.

In your scenario you define several services, personally I would separate these into different clusters as they deliver completely different business functions.

like image 80
Chris Williams Avatar answered Sep 30 '22 19:09

Chris Williams