Elastic Container Service

Elastic Container Service



Let's start with the question "What is container ?" and "What is serverless ?".

Container : is virtualization technology unlike the technology we have talked about before like hypervisor, it sits on top of host operating system (OS) of server and runs there. It is important information to know that you can run both Linux and Windows containers on Windows host machine but vice-versa is not true. Thanks to the Moby VM Windows OS uses, you can create Linux containers in Windows.

Serverless : is a thing we call when you deploy and run your application on cloud computing platform but it is fully managed but it. For example, there is a application which uses Lambda functions for, SQS, REST API, ECS, S3 bucket for all functionalities. And all those services managed by AWS. So we can call it serverless application. Mostly these applications are event-driven, auto-scaling, employes FaaS (Function as a Service) , very cost-efficient (you are billed for the usage not for the allocation).


Microservices changed the application development to the good. Thanks to loose coupling, fast development, independently deployable pieces of software, flexible usage of technologies applications are more efficient (Of course depends on case).
You can deploy microservices to bare metal servers as well. But it is not an optimal thing to do. So that is why containers are used for that. It is easy to deploy and manage. Kubernetes is used for orchestration of those containers. 

AWS Fargate

In AWS container service (ECS) and Kubernetes service (EKS) both uses fargate infrastructure under the hood. Fargate is fully aws managed technology allows seemless deployment and management.

Let's deploy very famous vulnerable web application called WebGoat
It is highly recommended to stop this container after testing, if public IP address is used. Otherwise you can use and stop whenever you want.

We must know few things before starting AWS Elastic Container Service. There are 2 main components of ECS. 

  1. Task - is used for short running jobs or batch jobs which you run once.
  2. Service - is used for long running application such as web applications. Unlike task, service manages tasks under the hood, so it can load balance them, or auto scale them. 
  1. Search Elastic Container Service in AWS





  2. First we need to create a cluster. Cluster consists of difference services and tasks.


  3. Check AWS Fargate, or you can check EC2 instances for containers but then you have to manage them all by yourself.  




  4. So after that we need to create a task definition, the tasks will be created based on the definition. During this step, ECS will ask you to provide image URI of container registry (basically image name from docker hub with tag). You can also set ports too. 









  5. Afterwards, create a service which will manage our web application tasks. Set desired tasks based on your needs but keep that in mind that you will need load balancer to successfully use all of them.




     
  6. After creating service click to it, find the task and click to it as well.



  7. In configuration, you will see the public IP address of that task. 

  8. When you append webgoat application path and port to it, you will be able to connect web server.



Comments

Popular posts from this blog

S3 - Create a static website

AWS - Databases DynamoDB, RDS

S3