Choosing your container environment on AWS with ECS, EKS, and Fargate
The Control Plane
When deploying containers on AWS the control plane is your entry point to running your application. It is the interface that you will interact with when you want to launch an application, query the state of an application, or shut an application down. AWS now offers two fully managed control planes to choose between:
Amazon Elastic Container Service (ECS) is a fully managed, highly available, highly scalable container control plane. ECS is designed for AWS best practices, and for the orchestration of AWS services around your containers. You can use powerful AWS tools like AWS CloudFormation to manage your deployment, as well as open source tooling like coldbrew-cli.
ECS orchestrates an ever growing number of container workloads on ECS. Some key stats that were shared at re:Invent 2017 are:
- ECS user growth since 2016 is up 462%.
- Over 100,000 active clusters managed by Amazon ECS.
- Amazon ECS is managing containers across millions of instances each month.
- Customers launch hundreds of millions of containers each week with Amazon ECS.
For any customer that wants the best experience for their containers alongside other AWS services ECS is a clear choice.
Amazon Elastic Container Service for Kubernetes (EKS) is a managed Kubernetes control plane that is high availability, with three masters across three availability zones. This is something that used to be challenging to setup yourself. EKS is just running upstream Kubernetes so you can connect to it with kubectl just like a self managed Kubernetes.
The majority of companies running Kubernetes in the cloud already ran self-managed Kubernetes on AWS before EKS:
With the release of EKS it puts Kubernetes well within the reach of even small companies that don’t have the engineering resources to manage the complexity of operating the Kubernetes control plane themselves.
The control plane is only responsible for orchestration of your containers. In order to run the containers you need an underlying pool of resources that the control plane can use to launch your containers. There are two options for how to do this:
EC2 can be used by launching your own self managed EC2 instances, and adding them to a pool of available resources for your control plane to use. Both ECS and EKS will register any instance you have added, and will then be able to make use of it. You are able to use your own reserved instances, or even spot instances. Self managing gives you the most control and ability to customize each instance.
AWS Fargate is a new service for running containers without needing to manage the underlying infrastructure. Your control plane can just ask Fargate to run a container and Fargate takes care of all the details. Pricing is based on how much CPU and memory you reserve for the container to use, on a per second basis. Fargate supports ECS right now, and will support EKS in 2018.
As you choose how to run your containers on AWS you will need to pick a control plane, and then pick how you want the containers to run beneath that control plane.
ECS offers a first class experience for containers that are working with other AWS services. EKS offers a uniform experience between Kubernetes that you are running on-premise (or elsewhere) and Kubernetes that you are running in AWS.
When choosing the container execution strategy consider that managing your own EC2 instances gives you the most flexibility and control over configuration and price. But AWS Fargate gives you easy, hands off container execution without any management required.