Are you grappling with deciding which container management service to use in the AWS cloud? Do you need to build microservices and complex architectures? Do you need to manage containers, or do you want to run containers without managing servers? If so, this blog is for you.
At nClouds, we are on a mission to deliver innovation faster, and containers can help you to accelerate your time to market. Sometimes selecting which container management service to use in the cloud can be a harder choice than actually containerizing your application on AWS. Of course, I’m exaggerating, but this is the most common question we hear from our customers.
In this blog, we’ll share the pros and cons of running workloads on Amazon ECS, AWS Fargate, and Amazon EKS to help you make that decision more easily.
Note: While there are other ways to run containers on AWS — like installing Kubernetes and Rancher (which schedules services to specific hosts) on Amazon EC2 instances — we believe that running a scheduler overcomplicates the infrastructure and only makes sense for certain types of workloads.
So, let’s get started.
A lot of companies running modern applications use Docker containers to build microservices and complex architectures, or to increase the reliability and availability of their applications. Many tools and frameworks help companies automate the deployment, scalability, and monitoring of their containers and help them build more reliable software. So, how do you decide which container management service to use on AWS — Amazon ECS, AWS Fargate, or Amazon EKS?
Let’s take a look at each of them.
Amazon Elastic Container Service (Amazon ECS) is a fast, highly scalable, high-performance service that manages Docker container orchestration using the compute capabilities of Amazon.
Some of Amazon ECS’ characteristics are the following:
Source: https://aws.amazon.com/ecs/ accessed 3/4/19
Source: https://aws.amazon.com/ecs/getting-started/ accessed 3/4/19
The architecture example above shows an application running two services (A and B). It has an API Gateway that receives the request from the users and sends them to a load balancer.
The load balancer sends the request to the corresponding service that is running inside containers monitored by AWS Auto Scaling and Amazon ECS. Amazon ECS ensures that the containers are healthy and replaces them when needed, using Docker images stored on Amazon ECR.
Fargate is AWS’ containers as a service. It is a serverless compute engine that complements Amazon ECS.
AWS Fargate is one of the two ECS launch types available. You don’t need to determine the placement of resources or do the scheduling, scaling, and patching. Just indicate the memory and CPU parameters, the network and roles that Fargate needs to assume, and which application it needs to run. Fargate takes it from there and handles the provisioning and configuration.
Source: https://aws.amazon.com/fargate/ accessed 3/5/19
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html accessed 3/5/19
The above architecture example shows different tasks running in two different ECS services using AWS Fargate launch type with the following configuration:
Amazon Elastic Container Service for Kubernetes (Amazon EKS) is Amazon’s Kubernetes as a service. It allows you to deploy, manage and scale containers using Kubernetes and Amazon’s cloud infrastructure. Amazon EKS runs infrastructure management using three different availability zones, to increase reliability and eliminate a single point of failure.
Some of EKS’ characteristics are the following:
Source: https://aws.amazon.com/eks/ accessed 3/4/19
https://aws.amazon.com/getting-started/projects/deploy-kubernetes-app-amazon-eks/ accessed 3/4/19
The above architecture example shows an application running inside an EKS cluster with the following configuration:
|Amazon ECS||AWS Fargate||Amazon EKS|
|Free Amazon service||Pay for the amount of memory and vCPU used by the containers||Fee of $0.20 per cluster per hour, around $144 per cluster per month|
Where it runs
|Only available on AWS||Only available on AWS as part of Amazon ECS||Runs based on Kubernetes and can be migrated in and out of AWS anytime|
|Migrating an application to Amazon ECS requires more work than to Amazon EKS||Requires more work than EKS migration, but it’s easier to configure and deploy than the usual EC2 launch type on ECS.||Easy migration from on-premises to AWS cloud.|
Ease of use
|Learning curve of Amazon ECS architecture is lower than that of Amazon EKS||Same learning curve as Amazon ECS, but easier to deploy and manage||More complex to use and deploy containers.|
What it supports
|Supports AWS Management Console, to access and manage AWS through a simple and intuitive web user interface (WUI)||Supports AWS Management Console, as ECS does||Supports Kubernetes plugins integration|
|Windows containers compatibility||Limited compatibility with some Amazon services (e.g., you can’t attach persistent storage to Fargate)||Every configuration needs to be done using kubectl|
AWS provides three different solutions to run containerized applications in the cloud. Each of them has distinct advantages and suits different purposes:
Need help with containers on AWS? The nClouds team is here to help with that and all your AWS infrastructure requirements.