What is ECS ?
ECS, short for Elastic Container Service, stands as Amazon Web Services' (AWS) comprehensive managed container orchestration service. It streamlines the process of running and overseeing Docker containers on a group of virtual machines (known as EC2 instances) without requiring direct management of the underlying infrastructure.
Through ECS, effortlessly deploy, supervise, and expand your container-based applications via the AWS Management Console, AWS CLI, or API. This service supports both "Fargate" and "EC2 launch types," giving you the choice to operate your containers on AWS-managed infrastructure or your personalized EC2 instances.
What's more, ECS seamlessly integrates with various AWS services like Elastic Load Balancing, Auto Scaling, and Amazon VPC, empowering you to construct scalable and resilient applications. Furthermore, ECS provides compatibility with Docker Compose and Kubernetes, simplifying the transition for existing container workflows.
In essence, ECS emerges as a robust and adaptable container orchestration service, greatly easing the deployment and administration of containerized applications within the AWS environment.
Difference between EKS and ECS ?
ECS follows a centralized architecture, employing a control plane to oversee container scheduling on EC2 instances. In contrast, EKS operates on a distributed architecture, dispersing the Kubernetes control plane across multiple EC2 instances.
Kubernetes Support:
EKS operates as a fully managed Kubernetes service, providing native support for Kubernetes workloads on AWS without the need to manage the Kubernetes control plane. On the other hand, ECS utilizes its proprietary orchestration engine and doesn't inherently support Kubernetes.
Scaling:
EKS is designed for automatic scaling of Kubernetes clusters based on demand, while ECS necessitates manual configuration of scaling policies for tasks and services.
Flexibility:
EKS offers greater flexibility for container orchestration, allowing customization and configuration of Kubernetes to suit specific requirements. In contrast, ECS presents fewer options for container orchestration.
Community:
Kubernetes boasts a vast and active open-source community, benefiting EKS with extensive community-driven development and support. Conversely, ECS relies more heavily on AWS itself and has a smaller community presence.
In essence, EKS proves advantageous if leveraging Kubernetes to manage containerized workloads on AWS is the priority, while ECS serves well as a simpler, more managed platform for running containerized applications.
Task :
Set up ECS (Elastic Container Service) by setting up Nginx on ECS.
Solution
Step 1: Go to AWS Console and search for ECR service and select create a repository.
Step 2: Select private or public(here selecting public). This way anyone will be able to access the repository and Give a name to the repo and submit create repo button
Step 3: We could access newly created ECR in dashboard now.
Step 4: connect to EC2 instance and from CLI will connect to ECR and push niginx image in repository.
Make sure you have already installed AWS CLI and Docker on ec2 system.
Before connect to ECR, use AWS configure and submit AWS user details.
Once connected , go to ECR repository and view for push code and paste first commands in terminal
We have successfully register ECR.
Step 5: Lets Pull NGINX image from docker-hub.
before pushing local nginx image to ECR will rename image with below syntax
docker tag <local-image> <ECR>/<new-image-Name>:<tag>
Now pushed an image to ECR.
Verify image details in AWS ECR.
Step 6:
Copy public URL from repository to run docker image .
We could see our container is running and we can verify deployment using public-ip:80
I hope this article proves valuable and enriches your understanding.
Thanks,
Kishor Chavan