Containers on AWS Overview: ECS | EKS | Fargate | ECR
Tags: aws, devops, kubernetes, tutorial
Published: 2020-11-29 14:31:26

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](https://youtu.be/AYAh6YDXuho) 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](https://dev-to-uploads.s3.amazonaws.com/i/vl5h8yjbn3o7rtfn7v43.png)

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](https://dev-to-uploads.s3.amazonaws.com/i/pp0832bhnkfp72hzazy5.png)

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](https://dev-to-uploads.s3.amazonaws.com/i/14s5ekdzpzajyfjxourk.png)


### 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 🤓
{% youtube AYAh6YDXuho %}

-----------------
► 5-month to start your career as a DevOps engineer: [DevOps Bootcamp - more info](techworld-with-nana.com/devops-bootcamp)
► Get **30% off** - with this code: UDEMY_NANA_NOV2020: [Udemy course here](https://bit.ly/35qF26i)
► **Kubernetes 101**: [Compact and easy-to-read ebook bundle 🚀](https://www.techworld-with-nana.com/e-books) 
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:
- [Private FB group](https://www.facebook.com/groups/techworldwithnana)
- [Twitter](https://twitter.com/Njuchi_)
- [YouTube](https://www.youtube.com/channel/UCdngmbVKX1Tgre699-XLlUA?sub_confirmation=1)
- [Instagram](https://www.instagram.com/techworld_with_nana/)
- [LinkedIn](linkedin.com/in/nana-janashia)