Hosting Container Workloads on AWS: Here Are Your Options

Cagdas Ozbey
TysonWorks
Published in
5 min readFeb 25, 2024

In recent years, the adoption of containers has revolutionized the way applications are developed, deployed, and managed. This rise in popularity is attributed to significant advantages in terms of portability and isolation. Understanding the available options is crucial for making informed decisions aligned with specific workload requirements. While Kubernetes is a well-known solution for managing container workloads, it is not the only option. In this post, I will introduce other services that can be beneficial in choosing the right solution.

While Kubernetes is pretty robust and popular, it’s crucial to understand that it’s not the only option for managing container workloads. AWS provides a range of alternatives that can support your container workloads, potentially leading to optimized costs and efficiency. These alternatives include services like AWS Elastic Container Service (ECS), which offers easy integration with AWS infrastructure, and AWS Fargate, which allows for serverless container deployment. Additionally, AWS Elastic Kubernetes Service (EKS) can be an option for those who prefer Kubernetes but want deeper integration with AWS services. Each of these services offers unique features and benefits, making it important to evaluate them based on your specific requirements and objectives.

Main Platforms

EKS
EKS is AWS’s managed Kubernetes service, perfect for those who require the full functionality of Kubernetes without the overhead of managing the control plane. It’s particularly suited for environments with complex, multi-service architectures, offering the scalability and flexibility that Kubernetes is known for.

ECS
ECS is a fully managed container management service, ideal for users seeking a straightforward solution for running Docker containers. It excels in environments that value simplicity and seamless integration with AWS services, such as EC2 and Fargate. ECS offers a balance of control and ease of use, making it suitable for a wide range of applications, from simple web apps to more sophisticated microservices architectures. It is particularly appealing for those who prefer a less complex alternative to Kubernetes, without compromising on the essential features needed for effective container management.

AppRunner
AWS AppRunner is the simplest solution for running web applications and APIs, designed for users who prioritize ease of use and quick deployment over extensive customization. It’s a fully managed service, eliminating the need for infrastructure management, and is optimal for straightforward applications where default configurations suffice. AppRunner automatically scales resources to match demand, ensuring efficient operation with minimal manual intervention. This service is particularly suited for developers and businesses looking to rapidly deploy their applications without delving into the complexities of container orchestration or server management. While it offers less customization than services like ECS or EKS, AppRunner is an excellent choice for projects where speed and simplicity are the main requirements.

Computing Options

AWS Fargate:

Fargate is a serverless compute engine offered by AWS, specifically designed for running containers. It abstracts the underlying infrastructure, removing the need to provision and manage servers or clusters. When you use Fargate with ECS (Elastic Container Service) or EKS (Elastic Kubernetes Service), you simply specify the CPU and memory requirements for your containers, and Fargate handles the rest. It automatically allocates the compute resources, runs the containers, and scales them as needed, making it an ideal choice for users who prefer a hands-off approach to infrastructure management.

Amazon EC2:
Amazon EC2 (Elastic Compute Cloud) is a service that provides resizable compute capacity in the cloud, using virtual machines known as instances. When running containers on EC2, you have full control over these instances, meaning you can choose the type of instance, configure the operating system, and have complete control over the network and security settings. This level of control is particularly beneficial for applications that require specific configurations or optimizations. Using EC2 with ECS or EKS allows you to manage the underlying infrastructure for your container workloads, offering flexibility and control for more complex deployment scenarios.

Tooling
AWS Copilot: Designed for ECS: AWS Copilot is specifically built for Amazon ECS. It provides a command-line interface (CLI) that simplifies the process of deploying and managing containerized applications on ECS.
Copilot assists in setting up an entire ECS architecture, including the creation of ECS services, task definitions, and cluster configurations. It also aids in setting up CI/CD pipelines, load balancers, and logging.
It is designed to be user-friendly, making it easier for developers to start with ECS without needing to deeply understand all the underlying details of AWS services.

Kubectl: Kubectl is the command-line tool for Kubernetes and is used with AWS EKS. It allows users to deploy and manage applications on Kubernetes, control cluster resources, and view logs.
Kubernetes Operations: With Kubectl, users can perform a wide range of Kubernetes operations such as deploying applications, inspecting and managing cluster resources, and viewing logs and statuses of resources in the cluster.

For AWS AppRunner, the tooling is more integrated and abstracted, as AppRunner is a fully managed service with a focus on simplicity. Users typically interact with AppRunner through the AWS Management Console or AWS CLI. The service automates deployments and infrastructure management, so there’s less need for specialized tooling like Copilot or Kubectl.

So which one to use?

Choose EKS for:

  • Complex, large-scale applications.
  • Projects needing Kubernetes API support.
  • Migrating to a Kubernetes environment.
  • Cost-effective container deployment.
  • Deploying across multiple infrastructures.
  • Utilizing Kubernetes’ flexibility.

Choose ECS for:

  • Simple, easy application management.
  • Situations where advanced EKS features aren’t needed.
  • Exclusive AWS focus with limited Kubernetes know-how.
  • Deep AWS service integration.
  • Scenarios with limited resources for Kubernetes migration.
  • Quick, streamlined container management.

For Computing Options, Choose:

Fargate for:

  • Serverless container deployment.
  • Automated scaling and management.
  • Focusing on applications over infrastructure.
  • Variable workloads with a pay-as-you-go model.
  • Strong application isolation.

EC2 for:

  • Full control over the environment.
  • Customizable compute needs.
  • Long-running, steady workloads.
  • Detailed monitoring and configuration.
  • Stable workloads with cost-effectiveness.

For Tooling, Choose:

Copilot for:

  • Easy-to-use CLI for ECS and Fargate.
  • Streamlining application workflow.
  • Seamless AWS service integration.
  • Automated infrastructure management.
  • Simplified Docker management.

Kubectl for:

  • Managing Kubernetes clusters.
  • Detailed control over Kubernetes resources.
  • Versatile cluster operations.
  • Advanced Kubernetes management.
  • Access to a wide range of Kubernetes tools and plugins.

There you have it. There are many ‘whens’ and ‘ifs’. Generally, if you don’t have existing Kubernetes workloads and your primary goal is to run container-based services on AWS, I would recommend ECS. ECS also supports external instances on-premises through ECS Anywhere. As for computing options, if you prefer less overhead, then Fargate is a good choice. Regarding tooling, Copilot would be your best bet with these selections.

--

--