DEV Community

Cover image for Containers on AWS Overview: ECS | EKS | Fargate | ECR
TechWorld with Nana
TechWorld with Nana

Posted on

Containers on AWS Overview: ECS | EKS | Fargate | ECR

If you want to run a containerized application on AWS you have multiple options and combinations, depending on your application requirements.

Topics covered:

  • Elastic Container Service (AWS ECS)
  • Elastic Kubernetes Service (AWS EKS)
  • EC2 instance or AWS Fargate as host server
  • Elastic Container Registry 🐳

In this video I will go through these options one by one.

ECS vs EKS

Elastic Container Service and Elastic Kubernetes Service are both Container Orchestration Tools.

This means AWS is managing the container lifecycle for you:

Elastic Container Service

The scheduling and orchestration happens through the Control Plane. On these servers the managing services are running.

For ECS these services are AWS specific.
On the other hand, EKS is a managed Kubernetes cluster and the Control Plane are the Kubernetes Master Nodes with K8s Master Processes running on it. So this is not specific to AWS.

The ECS or EKS cluster only includes the Control Plane, so where are your containers running? Which virtual machines are used? 🤔

EC2 vs Fargate

When creating an ECS or EKS cluster you can choose the launch type, where your containers should run:
Container Service Combinations

With EC2 instances you still need to manage the virtual machine yourself. Meaning you have to

  • create the EC2 instance,
  • join to the cluster,
  • check the available resources,
  • manage the operating system etc.

So with this option you have delegated the container management, but not your infrastructure. One big benefit though: you have full access and control of your infrastructure.

With the AWS Fargate alternative, you can also delegate the infrastructure management to AWS. So you don't have to provision and manage servers. It's a serverless way to launch your containers. "Serverless" meaning that there are no servers created in your AWS account, but hosted by AWS.

The advantages are the following:
AWS Fargate advantages

Elastic Container Registry - ECR

Elastic Container Registry is the private Docker Repository of AWS, where you can store your Docker Images. As you would assume, it integrates well with other AWS Services.
E.g. if you use EKS with EC2 instances it will be easier to connect and configure it with ECR than with other Docker Repositories.

Watch the full video here 🤓


► 5-month to start your career as a DevOps engineer: DevOps Bootcamp - more info
► Get 30% off - with this code: UDEMY_NANA_NOV2020: Udemy course here
Kubernetes 101: Compact and easy-to-read ebook bundle 🚀
It's a handy way to quickly look something up or refresh your knowledge at work and use it as your cheatsheet 😎

Like, share and follow me 😍 for more content:

Oldest comments (4)

Collapse
 
imthedeveloper profile image
ImTheDeveloper

Nice overview 👍

Collapse
 
andrewbrown profile image
Andrew Brown 🇨🇦 • Edited

When you are deploying to ECS with CodeDeploy you can create your installation scripts using bash scripts, when it's with Fargate you have to use Lambda functions.

You can run Fargate Tasks and Services on EKS.

Fargate being serverless containers means that it has cold starts, so this might be a problem for most people, but being serverless you don't have to do any right sizing.

With ECS you still have to right-size your EC2 instances so have the needed capacity to deploy both the old and new containers when you want to do an in-place deployment.

You can do blue/green with ECS and that is where you create a cluster every time, I don't really like this method since you have slow deploys.

It is possible to SSH into a Fargate running service, but it's quite the pain and generally not recommended.

I did a comparison talk which also includes AWS Lambda last year at the AWS Toronto Summit. lol

Collapse
 
techworld_with_nana profile image
TechWorld with Nana

Thanks Andrew, very interesting talk! 💡

Collapse
 
jiayanguo profile image
jguo

As far as know, you can run a container service on AWS in these ways.

  1. ECS
  2. EKS
  3. Elastic beanstalk.
  4. Lambda (you have to use lambda base image.)