Kubernetes and containerization of applications brings many benefits to software development, enabling speed, agility, and flexibility. The maturation of the Kubernetes ecosystem accelerated quickly in the last few years, leaving users with a multitude of choices when it comes to Kubernetes tooling and services. The major cloud providers (AWS, Azure, and Google Cloud) have introduced services specifically to help users run their Kubernetes applications more efficiently and effectively. In this blog post, we'll explore two major services provided by AWS for containers - Elastic Container Service (ECS) and Fargate.

What is ECS?

AWS ECS (Elastic Container Service) is a managed container service from AWS that allows managing tasks that run on containers within the AWS cloud service. As an early AWS container service, ECS initially required you to manage the underlying EC2 instances that run the tasks within ECS. However, today, you can also use Fargate (see below) as a management console to manage the EC2 instances for a serverless experience.

What is Fargate?

AWS Fargate abstracts the underlying infrastructure in AWS ECS and delivers a serverless management experience for container workloads. Fargate can be used to manage workloads in both ECS and EKS, and pricing depends on the resources being used.

What are the major differences between ECS and Fargate?

The biggest difference between ECS and Fargate is in how tasks are executed. With the self-managed option of ECS, you are responsible for managing the underlying EC2 instances that execute tasks. Fargate is a serverless solution that abstracts away the management of the underlying compute resources. With Fargate, you define your task and allow Fargate to handle the execution end-to-end.

What are the limitations and challenges of ECS?

ECS requires more hands-on management than Fargate as you need to manage the provisioning, performance, security, and efficiency of the EC2 instances. While this gives you more granular control over cluster operations, it does come at the cost of a 'management tax'.

What are the limitations and challenges of Fargate?

Fargate has some restrictions in how much granular control you have over cluster operations. For example, Fargate does not support mounting of EBS storage volumes to have common storage for all containers running on it. Similarly, Fargate on ECS requires you to set the network mode to 'awsvpc,' which is also restrictive. Additionally, if your application needs specific instance types for better performance, Fargate doesn't allow choosing instance types. If you need these capabilities, you'll need to go the ECS way.

Running ECS on Fargate

Fargate can be selected as a 'launch type' within ECS. This is the easy way to manage container workloads within ECS as Fargate takes care of all the infrastructure scaling and management. AWS has done well to integrate these services seamlessly and allow ECS users to easily leverage Fargate for infrastructure management.

ECS & Fargate pricing

Both ECS and Fargate offer on-demand and spot instances, with spot instances delivering a saving of up to 70% with the caveat that these instances can be terminated at any time with short notice. To be sure, Fargate does not have a separate charge itself, but you pay for the resources consumed in the form of vCPU and memory used. However, with ECS you pay for the underlying EC2 instances by the hour. With ECS, the spot prices are more flexible as you can choose different instance types and opt for small instances for maximum savings. Fargate offers a single spot pricing which would work out to be more expensive than ECS.

When does it make sense to use ECS or Fargate?

ECS is a great option when you have unique requirements such as running machine learning tasks on GPU instances, or mounting EBS volumes, or networking with an alternate mode such as 'bridge' or 'host.' ECS delivers more control over the infrastructure, but the trade-off is the added management that comes with it.

Fargate is the better option for ease of use as it takes infrastructure management out of the equation allowing you to focus on just the tasks to be run. It works great for most workloads and enables a faster pace of operations. This is an important consideration for teams that are looking to move faster, be agile, and innovate.

What are the alternatives to ECS and Fargate?

If looking to stay within the AWS cloud, the closest option to self-managed ECS and ECS on Fargate is AWS EKS. EKS follows the Kubernetes model of managing containers in pods unlike ECS where tasks are the focus. If your organization is still early in its Kubernetes journey, you can avoid the steep learning curve that comes with EKS and opt for the simpler container-centric ECS. Outside of AWS, Azure and Google Cloud have similar options such as Azure Container Instances (ACI), Azure Kubernetes Service (AKS) and Google Kubernetes Engine (GKE).

Another alternative to Fargate isSpot by NetApp's Oceanwhich delivers serverless management of containers running on AWS ECS, EKS and other container orchestration solutions. In this sense Ocean is similar to Fargate in that it takes the pain out of managing compute ECS infrastructure. However, Ocean goes beyond this to offer a high availability SLA for workloads despite running them on spot instances. Ocean is able to preempt termination of spot instances and gracefully manage the migration of these workloads to other spot instances, available RIs and Savings Plans and if needed, to on-demand instances. In this way Ocean brings together the best of both worlds - the ease of serverless while maintaining full access and control of the underlying infrastructure, along with and the extreme cost savings of spot instances.

Ocean benefits

Ocean automates and simplifies container infrastructure management, continuously optimizes resource utilization and efficiency, and reduces cloud compute costs by up to 90%.

Ocean provides these benefits in two dimensions:

Infrastructure Optimization

  • Provisions nodes that perfectly match container resource requirements with intelligent bin-packing for optimal workload allocation.
  • Analyzes node utilization for right sizing container resource requirements.
  • Eliminates tedious and time-consuming compute infrastructure management.

Pricing Optimization

  • Reliably runs mission-critical and production container workloads on low-cost spot instances with enterprise-level SLA for high availability.
  • Guarantees workloads continuity with predictive algorithms allowing for proactive draining and replacement of at-risk spot instances along with automated fallback to on-demand instances (or available Savings Plans and RIs) as needed.

Conclusion

For organizations looking to simplify the management of containers in the cloud AWS ECS offers a capable managed service that greatly simplifies operations. To further simplify container operations ECS running on Fargate is the preferred option as it delivers a serverless experience that abstracts away infrastructure management, albeit with a few constraints in data storage and networking.

Spot Ocean is an alternative to ECS and Fargate which combines the ease of serverless with the cost savings of spot instances. The key benefit of Ocean is that it guarantees a high availability SLA despite running on spot instances - something that ECS and Fargate do not offer.

Whether you currently use the self-managed ECS, or the serverless Fargate, Spot Ocean is a step up from these services, able to simplify container management, deliver high availability, and do all this at almost half the cost.

Attachments

  • Original document
  • Permalink

Disclaimer

NetApp Inc. published this content on 25 August 2021 and is solely responsible for the information contained therein. Distributed by Public, unedited and unaltered, on 25 August 2021 07:33:09 UTC.