Getty Images/iStockphoto

Amazon ECS vs. Kubernetes: Which should you use on AWS?

Learn the basics about Amazon ECS and Kubernetes, as well as EKS and Fargate, before you choose an application architecture for your workloads on AWS.

IT teams have several options for running containerized applications on AWS. Some organizations will opt for Kubernetes, an open source service that is the de facto choice for container orchestration, while others will want to use AWS' proprietary orchestration service instead.

IT teams have the choice of controlling the underlying VMs themselves or leaving those management tasks to Amazon. Deciding which approach to take depends on several factors. Explore options for deploying containers on AWS, and see which container orchestration service is best for your project.

What is Amazon ECS?

Amazon Elastic Container Service (ECS) is a managed container service that is based on a proprietary orchestrator developed by Amazon. ECS integrates with other AWS services, such as Amazon EC2, AWS Fargate and Amazon Elastic Container Registry, and streamlines container application deployment and management.

Amazon ECS benefits

The key benefits of ECS include the following:

  • Fully managed service. ECS customers don't need to install container orchestration software or provision the underlying host infrastructure. The service provides all the core resources necessary to deploy containerized apps as a fully managed service.
  • Multiple deployment options. ECS supports container deployment using EC2 instances that customers manage themselves. This increases management effort somewhat but provides more control. Additionally, customers can use AWS Fargate, which automatically provisions the container host infrastructure.
  • Native security. Amazon ECS integrates natively with the AWS Identity and Access Management (IAM) framework, as well as its monitoring software, to provide basic access control and security monitoring needs.
  • Discount opportunities. Users receive instance discounts when they use it to deploy containers on EC2 cloud server instances.

Amazon ECS disadvantages

Compared to Amazon Elastic Kubernetes Service (EKS) and other Kubernetes-based container orchestration services, the main disadvantage of Amazon ECS is that it uses a proprietary orchestration technology and can't benefit from open source extensions.

Organizations that choose Amazon ECS for their container deployment needs are likely to find themselves limited to the tools and service integrations that are available from AWS since few third-party commercial tools integrate with Amazon ECS.

Compare container orchestration services on AWS

What is Kubernetes?

Kubernetes is an open source container orchestration engine that can deploy and manage containerized applications on virtually any platform or hosting environment, including public and private clouds, as well as on-premises infrastructure. This specific example is talking about Kubernetes in general, not Amazon EKS, which is based on Kubernetes but offers additional features.

Kubernetes benefits

The key advantages of Kubernetes versus other container orchestration services include the following:

  • Open source community. As a fully open source platform, Kubernetes benefits from a large and dynamic open source community. It's easy to add extra features to Kubernetes by deploying extensions or add-ons from open source projects.
  • Popularity. Since Kubernetes is the most popular container orchestration engine, it is easy for users to find documentation and other resources related to Kubernetes. Most engineers who have experience working with containerized apps are also familiar with Kubernetes. That may not be true of other orchestrators, like Amazon ECS and Docker Swarm.
  • Flexible deployment options. Kubernetes is compatible with virtually any host infrastructure. No matter where you want to deploy containers, Kubernetes most likely works with your stack.

Kubernetes disadvantages

Kubernetes also has disadvantages, such as the following:

  • Complexity. Kubernetes is a complex platform that requires extensive experience to deploy in production.
  • Time. Setting up Kubernetes environments can take some time, especially for teams that manage the underlying infrastructure themselves.

Managed Kubernetes services, including Amazon EKS, can make the Kubernetes learning curve and management challenges a little easier to conquer.

Compare Amazon ECS vs. Kubernetes on various key features

When to use Amazon ECS vs. Kubernetes

If you're choosing between Amazon ECS and Kubernetes, Amazon ECS is a better option for your workloads given the following:

  • A simple container management experience is a priority.
  • You are deploying ordinary containerized apps and don't require a complex tool or control over your infrastructure.
  • You are willing to rely extensively on services within the Amazon ecosystem.

In contrast, Kubernetes is generally a better option given the following:

  • You have the expertise necessary to set up and manage Kubernetes effectively.
  • You need features or add-ons, such as the ability to orchestrate VMs in addition to containers, that aren't supported by other orchestrators.
  • Control over your configuration and infrastructure is a priority.

In general, factors like workload type and size are not important considerations when comparing Amazon ECS to Kubernetes because both solutions work well with any type of container-based workload at any scale. The differences boil down to issues like ease of use, where Amazon ECS has the upper hand, and control and independence from specific vendors' services, which you get by using Kubernetes.

Other ways to deploy containers on AWS

Amazon also offers a managed container service, Amazon EKS, that is based on Kubernetes. Unlike pure open source Kubernetes, Amazon EKS integrates natively with various AWS services to simplify aspects of Kubernetes setup and management.

Like Amazon ECS, Amazon EKS enables users to deploy containers either using AWS Fargate -- in which case, infrastructure is automatically provisioned and managed for them -- or using self-managed EC2 instances. However, unlike Amazon ECS, Amazon EKS is compatible with many of the add-ons and extensions that the Kubernetes community offers. Some add-ons or extensions may not work with EKS because they are not compatible with the AWS networking and infrastructure resources that EKS depends on.

On top of this, it's also possible to run Kubernetes on EC2 without the use of Amazon EKS. Under this approach, customers set up EC2 instances to serve as nodes for their Kubernetes cluster and then deploy and manage Kubernetes on them entirely on their own.

This strategy offers more control than using Amazon EKS because users are not limited to the Kubernetes version and architecture that it implements -- but it tends to be a lot more work. Typically, running Kubernetes on AWS doesn't save much money because the bulk of costs is from the infrastructure that workloads consume, which is basically the same under both Amazon EKS and self-managed Kubernetes environments. Amazon EKS costs may be slightly higher because it also charges a management fee, but for production-scale deployments, that is minimal compared to the cost of cloud servers.

Chris Tozzi, senior editor of content and a DevOps analyst at Fixate IO, has worked as a journalist and Linux systems administrator with particular interest in open source Agile infrastructure and networking.

Next Steps

Compare EKS vs. self-managed Kubernetes on AWS

Dig Deeper on Cloud provider platforms and tools

Data Center