Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to Create an Amazon ECS Cluster? 

Amazon Elastic Container Service is a container management system that makes it easy to manage Docker containers on a Cluster. A cluster is a logical group of AWS EC2 instances. This short blog will explain how to create an ECS Cluster.

Let’s start with the basics first!  

What is an ECS Cluster? 

An Amazon ECS cluster is a logical grouping of tasks or services. We run the tasks and services on infrastructure that is registered to a cluster. The infrastructure capacity can be provided by AWS Fargate, a serverless infrastructure that AWS manages, Amazon EC2 instances that you manage, or an on-premise server or virtual machine (VM) that you manage remotely. 

How to Create an ECS Cluster? 

Here are the steps to create an ECS Cluster. 

Step 1: Open the Amazon ECS console (https://console.aws.amazon.com/ecs/) 

Step 2: Select the Region to use from the navigation bar. 

Step 3: Choose Clusters from the navigation pane. 

Step 4: Choose Create Cluster on the Clusters page. 

Step 5: To select Cluster Compatibility, choose one of the following options and select Next Step

Networking onlyThis cluster template creates an empty cluster. Optionally, you can create a new VPC to use. This cluster template is typically used for workloads hosted on either AWS Fargate or external instances (ECS Anywhere). 
EC2 Linux + NetworkingThis cluster template is used to create a cluster of Amazon EC2 instances to run Linux-based containers on. An Auto Scaling group is created for the Amazon EC2 instances. 
EC2 Windows + NetworkingThis cluster template is used to create a cluster of Amazon EC2 instances to run Windows-based containers on. An Auto Scaling group is created for the Amazon EC2 instances 
  1. Create an ECS Cluster (Networking only – AWS FARGATE) 

Step 1: Click on Create Cluster.

Creating a Cluster.
Choosing the “Networking only” option 

Step 2: Here you can enter your Cluster name, create an isolated VPC for your ECS cluster based on your project, or you can use your VPC while defining a cluster service, which we will discuss later. At the bottom, you have the option to enable CloudWatch Container Insights to view the metrics. 

Details of Step 2

Step 3: Your Fargate-based ECS Cluster now has been created.

Details of Step 3 

Step 4: Now, you can add services to your cluster to run your Docker-based containers. 

That’s all about creating the ECS Fargate Cluster!  

  1. Create an ECS cluster (EC2 Linux + Networking) 

We use this cluster template to create a cluster of Amazon EC2 instances to run Linux-based containers previously mentioned. 

Here’s how to do it! Let’s get started! 

Step 1: Login to your AWS account.

Step 2: Search for ECS, and click on create a cluster. 

Choose EC2 Linux and Networking

Step 3: Now click on Next. 

Step 4: You will now be directed to configure the cluster page. There you can configure the cluster as per your needs.

Configuring the cluster as per your requirements 

Step 5: Enter the name for your cluster, and choose the provisioning model as per your need. Over here, we have chosen an on-demand instance based on the project situation. 

Step 6: The next option while configuring is choosing what kind of EC2 instance we need. 

Based on your requirement, choose from the dropdown. 

We are using a “t2.micro” instance type as it is free. As we advance, select the number of instances you want for your EC2 cluster. This also depends on your scenario. 

We are using 1 as we need only one instance for our cluster. 

Step 7: Select the AMI, Disk Size, and Key Pair. The need for using Keypair is if you have the purpose of SSH into your EC2 instance that resides in the cluster. 

Caption: 

Step 8: The next part is Networking. Configure the VPC for your container instances to use. Here you can select your preconfigured VPC. For more see, Creating-an-Enterprise-VPC (http://192.168.1.208/devops/resources/-/wikis/AWS/Creating-an-Enterprise-VPC). 

Choose the subnets and security group.

Details of Step 8. 

Step 9: After that, use the Container instance IAM role if you have one and enable CloudWatch Container Insights and click on create. 

Details of Step 9. 

Now, wait for a few minutes. Your ECS EC2 cluster will take a few minutes to get created. 

Now we are done with creating both Fargate and EC2 Clusters. 

AWS CLI Method of Creating Clusters

Here’s how to create the clusters using the Amazon Web Services Command Line Interface. 

aws ecs create-cluster –cluster-name MYECScluster
OUTPUT { “cluster”: { “clusterArn”: “arn:aws:ecs:ap-south 1:226669242865:cluster/MYECScluster”, “clusterName”: “MYECScluster”, “status”: “ACTIVE”, “registeredContainerInstancesCount”: 0, “runningTasksCount”: 0, “pendingTasksCount”: 0, “activeServicesCount”: 0, “statistics”: [], “tags”: [], “settings”: [ { “name”: “containerInsights”, “value”: “disabled” } ], “capacityProviders”: [], “defaultCapacityProviderStrategy”: [] } }

Wrapping Up

The hassle of managing Docker is done simply by ECS. Hence, this facility is used to manage Docker instances. In this blog, we explained how to create an ECS Cluster. 

At SysAlly, we experiment with Cloud and the most useful information is passed on to the world as blogs. Signup for the updates.

Until later, here’s SysAlly signing off!



This post first appeared on Make IT Work - A Complete Solutions For IT Professionals, please read the originial post: here

Share the post

How to Create an Amazon ECS Cluster? 

×

Subscribe to Make It Work - A Complete Solutions For It Professionals

Get updates delivered right to your inbox!

Thank you for your subscription

×