Content

                                                  Content How to create an AWS free Account? Lab 1: To launch amazon Linux EC2 instance Lab 2: To Connect to the instance from Linux client Operating System Lab 3:To Launch amazon windows instance Lab 4: Installing apache in EC2 instance Lab 5: Installing Nginx in EC2 instance Lab 6: Changing Host Name Lab 7: Creating a user and making as a sudoer Lab 8:Assigning an Elastic ip Lab 9:Creating ebs,attach and detach the volumn to the instance Lab 10:Creating an S3 Bucket and creating cross replication in another region Lab 11:Load Balancer Lab 12:Two instances with Application Load Balancer Lab 13:Launching two instances with load Balancer Lab:14 Creating Own VPC  Lab 15: Two instances which classic load Balance with own VPC Lab 16:Two instances with Application load Balancer with own VPC Lab 17: Relational Data B...

Lab 24 :Elastic Container Service

                                                         Elastic Container Service





What is Elastic Container Service?

Amazon Elastic Container Service (ECS) is a highly scalable, high performance container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances. Amazon ECS eliminates the need for you to install, operate, and scale your own container orchestration software,manage and scale a
cluster virtual machines,or schedule containers on those virtual machine . 

With simple API calls, you can launch and stop Docker-enabled applications, query the complete state of your cluster, and access many familiar features like security groups, Elastic Load Balancing, EBS volumes, and IAM roles,security groups,load balancers,Amazon Cloud watch events,AWS Cloud formation templates,and AWS cloud trails logs.

Why we use?

CONTAINERS WITHOUT SERVERS

Amazon ECS features AWS fargate ,so you can deploy and manage containers without having to provision or manage servers .with fargate ,you no longer to select amazon EC2 instant types,provision , and scale clusters of virtual machines to run containers or schedule containers to run on clusters and maintain their availblity. Fargate enables you to focus on building and running applications ,not the underlying infra structure .

CONTAINERIZE EVERYTHING

Amazon ECS lets you easily build   all types of containerized applications ,from long running applications and micro services to batch jobs and machine learning applications . you can migrate legacy linux or windows application from on premises to the cloud and run them as containerized  applications using amazon ECS.

Secure:

Amazon Elastic Container Service launches your containers on your own EC2 instances. No compute resources are shared with other customers. Your clusters run in a VPC allowing you to use your own VPC security groups and network ACLs. These features provide you a high level of isolation and help you use Amazon ECS to build highly secure and reliable applications.

Performance at Scale:

Amazon Elastic Container Service is built on technology developed from many years of experience running highly scalable services. You can launch tens or tens of thousands of Docker containers in seconds using Amazon ECS with no additional complexity.

AWS Integration:
 
Amazon Elastic Container Service (ECS) integrated with AWS services including Elastic Load Balancing ,Amazon VPC ,AWS,IAM,Amazon ECR,AWS Batch,Amazon Cloud Watch,AWS cloud Formation,AWS codestar,and AWS cloud Trail.This gives you a complete for building and running a wide range of Containerized applications.

Lets create an ecs

Lab:create an ecs

Creating a cluster

Create a repository

Create a task definition and add a container

Create a ALB

Create a service

Cluster : 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 s also grouping of container instances.when you first use amazon ECS,a default cluster is created for you,but you can create multiple clusters in an account keep your resources separate

Go to ECS dashboard

Click on cluster

Click on create a cluster

 

Click on create a cluster

Select ec2 +linux net working

Click on next step

 


Give a name of a cluster

Select number of instances 2

 


Select a key pair

 


Select default vpc as per now

If you have your own vpc select your own vpc

Select all subnets

 


Select default security group


 

Leave all as default

Then click on create

 



Click a repository

Refer above how to create a repository

As per lab am using the same repository which I have created above

Now create a task definition

In ecs dash board

Select task definition

 

 

 

Click on create task definition

Select ec2

And click on next

Give a name to the task definition

Leave all as default

 


Come down near container definition

Click on add container

 


You will get a page like this


 

Give a name to the container

Near images:give the url which you have created in the repository.

 


Copy this url to images

Add in memory limits select soft limits and give 128

 


Near port number give host port  as 0 and container port 8080 node js will run on 8080

 

Leave all default

And check box near log configurations



Then click on add

 



Then click on create

 


Now create application load balancer and attach the target groups to the service

Go to ec2 dashboard

Click on load balancer click on application load balancer

 


Click on create

Give a name to the load balancer

Select all availability zones

 

 

 


Click on configure security settings

 


Click on security group

Select the default security group

 


Click on next

Give a name to the target group

And leave all as default


 

Click on register targets

 


Click on Review

Click on create

 


Now go the ecs dash board

Select cluster you have created

Select service

Click on create


 

select ecs

give a name to the service


 

no of tasks give 2

 


leave other as default

click on next

 


select application load balancer

select service Iam role aws service role for ecs

select created application load balancer

select container port ecs 0:8080 and click on add to load balancer


 


you will get container to load balancer after click on add to load balancer

·    Near target group name select target  which you have created in the application load balancer

 


Then uncheck service discovery integration


 

Then click on next step

 


Then click on next

Click on create the service

 

 


Go to the cluster page

Select the cluster you have created

 


Node js service in active status

 


Go to application load balancer

Take the end point of alb check the page in browser


 



Exercise :create an end to end ecs with flask app and nodjes app connect the alb end point to the route53 .





Comments

Popular posts from this blog

Lab 21:Installing docker in instance and build an image

Lab 22:Pushing a docker image to docker hub

Lab 5: Installing Nginx in EC2 instance