Creating the sample web Application on ECS(Elastic Container Service)

In the previous post , we learned about the ECS basics, In this blog, we are going to implement the sample web application using the ECS. Cr...

In the previous post, we learned about the ECS basics, In this blog, we are going to implement the sample web application using the ECS.


Creating Elastic Container Service (ECS);

             We are going to run our container(docker image) on top of the cluster, so we are going to create 4 main steps.

Container definition:

     It is basically to choose an image for the containers, Already had three images available by default. If you want to customize the image, we can use the customized image. Here we are using the default image (Nginx webserver).


Task definition:

 Task definition is the second step to implement the ECS. 

 Click edit and edit your preference 

Task definition name --> Give the name of the task 

Network mode ---> Always must to be an aws vpc

Task execution role --> The IAM role used by your task.

FARGATE --> Launch type

Task size:  Task memory can give up to 30GB

                   Task Cpu can give up to 4vcpu then save and click the next option.


Define the service:

The service can use as a load balancer, If not using load balancer it will automatically create a security group. A security group is created to allow all public traffic to your service, only on the container port specified. You can further configure security groups and network access outside of this wizard, After this step click next to create a cluster. 


Cluster:

       Type any name for the cluster it must be unique, click next.

Once completed the all steps, now check the final result all show a green color.

Review all four configurations of Task definition, service, and cluster. Once all okay with that

Next click to create the ECS cluster, it creates all the services, it took 3 to 4 minutes.

Once the ECS is created, Click the view source to show all details of the ECS elements.

It will show the cluster details like services(what are the services now running like Nginx), Tasks(inside the task it have task details and task definition of ECS instance), Metrics( it had a graph of CPU, memory utilization, and reservation), scheduled task(if you want a scheduled task can create and schedule the task), Tags(tag the cluster name).

Now the cluster is fully configured and the status has gone to the active stage. Click the services It shows the currently running service details like load balancing, network access.

Click the load balancing target group name it will redirect to the load balancing page 

Load balancing has the following items Basic configuration, security groups, and attributes inside the description.

it has a  DNS A record that records will point out the cluster nginx service.


Tasks: Inside the task, it will have task and task Definition

Task Definition:
                       It was a JSON script and already created task details, Click the task it will have details such as tag, and logs, network and container information.
Now all the setup was completed, need to check the A RECORD DNS working for the nginx server,


Finding the A record:

Go to ECS AWS cluster, open the cluster, click the services, service name(nginx-service), and click the load balancing target group name (it redirects to Load balancing Target group). click again load balancer. it goes to the load balancer. The description had a DNS name, A record.

Open the browser and paste the A record of a load balancer, It shows the Nginx webserver welcome page.
booyah!! we have Successfully configured the ECS using the default Nginx docker image.






COMMENTS

Name

AWS,1,Devops,11,linux,9,
ltr
item
Techie View: Creating the sample web Application on ECS(Elastic Container Service)
Creating the sample web Application on ECS(Elastic Container Service)
https://1.bp.blogspot.com/-tG_0f0M1Z2Q/X_WAixoSBDI/AAAAAAAAAPU/8tYZimTWKlQRS7uOjx71KregYX-iFRVkgCLcBGAsYHQ/s320/Amazon-ECS-logo.jpg
https://1.bp.blogspot.com/-tG_0f0M1Z2Q/X_WAixoSBDI/AAAAAAAAAPU/8tYZimTWKlQRS7uOjx71KregYX-iFRVkgCLcBGAsYHQ/s72-c/Amazon-ECS-logo.jpg
Techie View
https://www.techiev.com/2021/01/creating-sample-web-application-on.html
https://www.techiev.com/
https://www.techiev.com/
https://www.techiev.com/2021/01/creating-sample-web-application-on.html
true
7013663511659419322
UTF-8
Loaded All Posts Not found any posts VIEW ALL View Full Article Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy