Lab 24 :Elastic Container Service
- Get link
- X
- Other Apps
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.
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 .
- Get link
- X
- Other Apps











































Comments
Post a Comment