Amazon’s Container Services
Should we go cloud-native? Which platform should we choose? Which precise services to procure? These are important questions. Questions that organisations must ask themselves. Questions to which the answers must be arrived at with robust diligence.
Will you go down the AWS pathway? Will it be the Google Cloud Platform? Or will Microsoft Azure be your platform of choice? Picking the right cloud platform is a significant decision. As more IT infrastructure, applications and systems are incrementally being ‘lifted and shifted’ from in-house datacentres to public cloud environments; ensuring selection of the right cloud services is critical to long term success.
The available market for cloud services providers is large and growing. There are several providers offering an even more significant number of services. From market leaders such as Amazon, Google and Microsoft through to middle-sized providers, to smaller niche players offering bespoke services – the choices are many.
So how precisely should an organisation go about selecting the right cloud provider from the abundance of suppliers? It must be based on your organisation’s unique set of needs. Once you have made your decision regarding the cloud provider, you must also select the right services for your infrastructure. If you decide to implement a microservice approach on AWS, there are multiple options for hosting your containerised services.
In the enterprise landscape today, there is a significant focus on scaling applications quickly and securely. Alongside the security and pace requirements, businesses must be mindful of resource utilisation and cost optimisation.
Containers provide a vehicle to package application code, configurations and dependencies into a single object. They also allow virtualisation to occur at the operating system level, rather than at the hardware stack layer. Users can run multiple containers atop the OS kernel directly.
Containers are faster, more mobile, and use less memory than virtual machines. They can be crucial in contributing to the success of a cloud environment. The management of containers at scale, also known as container orchestration, can be a source of confusion.
This article is a high-level comparison of Amazon ECS, Amazon EKS and where does AWS Fargate fit in. Let me review AWS Fargate vs other players in the AWS container orchestration mix, and which scenarios each is best suited to.
AWS Fargate is a compute engine for Amazon Elastic Container Service (ECS). It allows you to run ECS containers without the need to manage servers or manage clusters. AWS Fargate takes away the need to provision, configure, and scale clusters of virtual machines (VMs) to run containers.
Leveraging AWS Fargate removes the need to choose server types, to decide when to scale clusters, or to optimise cluster packing. Fargate eliminates the need to interact with servers, allowing you to focus on designing and building applications instead of managing the infrastructure.
When you select Fargate launch type in Amazon ECS, you package applications in containers, specify the CPU and the memory requirements, define networking and IAM policies, and launch the application.
Often, robust technologies offer convenience at the expense of reduced control. The same goes for AWS Fargate – a natural downside of choosing Fargate over managing servers and clusters is that you give away customisation options in exchange for ease of use.
How does AWS Fargate Work?
Why should you use Amazon Fargate?
- AWS Fargate removes the need to manage clusters. With no need to pick instance types, no need to manage cluster scheduling and no need to optimise cluster utilization, AWS Fargate allows you to focus on containers and focus on building your application.
- AWS Fargate makes application scaling relatively easy. The need to provision compute resources for container applications is eliminated. Once the application requirements have been defined, AWS Fargate manages the infrastructure and the scaling to run your containers in a highly-available manner. AWS Fargate allows you to launch thousands of containers in seconds, making it easy to run mission-critical applications. This removes the need to decide when to scale clusters or when to pack them for optimal utilisation.
- AWS Fargate effortlessly and seamlessly integrates with Amazon ECS. Just as you do for ECS, with Fargate, you define your application. You then package your application into task definitions and specify the CPU required and memory needed. You then define the networking and IAM policies that each container needs and upload everything to Amazon ECS. Once setup is completed, AWS Fargate launches and manages the containers for you.
AWS Fargate does not require upfront payments. You only pay for the resources that you utilise. For instance, you would pay for the amount of vCPU and memory resources consumed by your containerised applications.
AWS Fargate pricing is calculated based on the vCPU and memory resources used from the time you start to download your container image (docker pull) and until the Amazon ECS Task terminates. This is rounded up to the nearest second. Note that a minimum charge of 1 minute applies.
AWS Fargate starts the charges when your container workloads are running inside the underlying virtual machine. You are not charged for the total time the machine is running. Recently, AWS released a significant price reduction for Fargate (to the value of between 35%-50%). The new price reductions also include savings for containerised web servers and API services. You don’t pay for instant resources that your application does not use. The ‘pay-as-you-go’ pricing model is ideal for more extended running workloads. Fargate allows you to configure up to four vCPUs and thirty GBs of memory. The reduction in pricing has allowed many teams the opportunity to explore the benefits of a container management service.
Amazon Elastic Container Service (ECS)
Amazon Elastic Container Service (ECS) is an extremely scalable, high-performance container orchestration and management service. It supports Docker containers and allows you to easily run and scale containerised applications on AWS. ECS makes it easy to manage Docker containers, eliminating the necessity to operate your own container orchestration software. The need to manage a cluster of virtual machines, or schedule containers on those virtual machines is also eliminated.
Amazon ECS has two launch types
- Fargate Launch Type
You can host your cluster on serverless infrastructure. This infrastructure is managed by Amazon ECS, launching your services or by tasks using the Fargate launch type
- EC2 Launch Type
For increased control, you can host your tasks on a cluster of Amazon Elastic Compute Cloud (Amazon EC2) instances.
With simple API calls, you can launch Docker-enabled applications, stop them, query the state of your application, and access features such as IAM roles, security groups, load balancers, CloudWatch Events, CloudFormation templates, CloudTrail logs etc.
ECS handles the installation of containers, scaling, monitoring and managing these instances and allows you to simplify your view of EC2 cases. Developers can run applications in the cloud without worrying about configuration. It is effortless handling which you don’t need to think about constantly. The very idea of ECS removes complexities of running infrastructure at scale. If your business becomes complex, ECS ensures that this remains manageable. Amazon developed ECS as a result of the popularity of containerisation. Developers can use Docker containers for the hosting of a simple website, to running complex, distributed microservices which requires thousands of containers. The service can also be used to update containers or scale them up or down.
How does Amazon ECS Work?
Why should you use Amazon ECS?
You can run containers on Amazon EC2 Spot Instances to receive up to a 90% discount in comparison to On-Demand prices. Containers are fault-tolerant and this makes them a great fit for Spot Instances. To get the ideal blend of cost optimization, you can run ECS clusters at scale by mixing On-Demand, Spot Instances and Reserved Instances.
Containerisation without the need for servers
Amazon ECS features AWS Fargate. This allows deployment and management of containers without having to provision or manage servers. Fargate eliminates the need to select Amazon EC2 instance types. Fargate also eliminates to need to provision or scale clusters of virtual machines to run containers. And removes the need to schedule containers to run on clusters and maintain their availability. Fargate enables you to focus on building applications and running them, rather than the underlying infrastructure.
Containerisation of everything
Amazon ECS lets you build containerized applications. Be it long-running applications or microservices. Be it batch jobs or machine learning applications. Amazon ECS allows to migrate legacy Windows apps or Linux apps from on-prem to the cloud and run them as containerised applications.
Amazon ECS launches containers in an Amazon VPC. It allows you to use your VPC security groups and network ACLs. No compute resources are shared with other customers. You can assign granular access permissions for each of your containers using IAM to restrict access to each service. This level of isolation helps you use Amazon ECS to build highly secure and reliable applications.
Amazon ECS is built on highly scalable technology. It allows you to launch thousands of Docker containers in seconds with no additional complexity.
Amazon ECS is integrated with AWS services, including Elastic Load Balancing, VPC, IAM, ECR, Batch, CloudWatch, CloudFormation, CodeStar, and CloudTrail. This gives you a complete solution for building and running a wide range of containerized applications.
When should you use Amazon ECS?
Migrating Applications to the Cloud
Amazon ECS allows for legacy enterprise applications to be containerised and migrated to the cloud without requiring code changes.
Amazon ECS allows you to run microservices applications and allows for native integration to AWS services. It also enables continuous integration and continuous deployment.
Amazon ECS lets you run batch workloads with managed schedulers or custom ones, on Amazon EC2 On-Demand Instances, Reserved Instances, or Spot Instances.
Amazon ECS makes it easy to containerise ML models. It allows you to create ML models out of loosely coupled, distributed services that can be placed on several platforms, or close to the data that the applications are analysing.
AWS ECS Pricing
In terms of its pricing, ECS has two different charge models: Fargate Launch Type Model and EC2 Launch Type Model. Fargate’s pricing structure requires you to pay for the amount of vCPU and memory resources that your containerised application requests, calculated from the time of collation of your container images until termination. A minimum charge of 1 minute applies. The EC2 pricing structure requires no additional cost, other than the AWS resources used to store and run your application, without any upfront commitments.
AWS Fargate vs AWS ECS
Differentiating between Fargate versus ECS is not purely simplistic as both options have valid techniques for operating your containers reliably. The one you select is strictly dependent on what factors you wish to optimise.
- Orchestrates Docker containers as a service
- Integrates with other Amazon services
- Enables you to manage the structure behind the containers
- Uses task definitions to allow containers to run inside the cluster
- Serverless compute engine without the need to manage
- It is not necessary to configure, provision, or scale the resources where the containers are running
If you’re looking for a solution that combines simplicity and availability, while giving you advanced control over your infrastructure, then ECS is the way to go. If you are looking for simplicity without the need to manage local storage, while paying for what you use, Fargate is the best choice.
Amazon Elastic Kubernetes Service (EKS)
Kubernetes, in and of itself, is hugely beneficial and offers an automated and simplified way to take control of container workflow daily. Many businesses, as a core component of their IT strategy, run millions of containers on AWS every week. With Amazon Elastic Kubernetes Service (EKS), it just gets better. EKS offers flexibility and represents the best way to run containers on AWS. You get customisable container and node management with more granular control. It is a fully-managed service which means that you avoid the trouble of maintaining your infrastructure. It efficiently automates load distribution and parallel processing regardless of what workloads you run. There is no need to install, operate or maintain your Kubernetes control plane. EKS simplifies the process of building, securing, operating and maintaining Kubernetes clusters and brings the business benefit of container-based computing for businesses that want to focus on the building of applications.
How does Amazon EKS Work?
Why should you use Amazon EKS?
You can run containers on EC2 Spot Instances and receive an approximately 90% discount in comparison to On-Demand pricing arrangements. Containers are fault-tolerant and they are stateless. This makes them an ideal fit for Spot Instances. You can run EKS clusters at scale by mixing On-Demand and Spot Instances.
No control plane to manage
Amazon EKS runs Kubernetes management infrastructure across multiple AWS Availability Zones. It helps automatically detect and replace unhealthy control plane nodes. EKS also provides on-demand upgrades and patching. All you have to do is provision worker nodes and connect these to the EKS endpoint.
Secure by default
You Amazon infrastructure is secure by default. This is owing to the security and encrypted communication channels that are automatically setup between your worker nodes and the managed control plane.
Built with the community
AWS actively works with the Kubernetes community. This includes making contributions to the Kubernetes code base that help Amazon EKS users take advantage of AWS services.
Conformant and compatible
Amazon EKS is certified Kubernetes conformant, so applications managed by Amazon EKS are fully compatible with applications managed by a Kubernetes environment.
When should you use Amazon EKS?
Amazon ECS allows you to run microservices applications with deep integrations to AWS services. You also have the advantage of getting access to the complete feature set of Kubernetes functionality.
Hybrid container deployments
Amazon ECS allows you to run scalable Kubernetes clusters on AWS that are highly available. Alongside this, you maintain full compatibility with your Kubernetes deployments.
The Kubernetes Jobs API allows you to run parallel workloads on the Amazon EKS cluster. These workloads can be run on the EC2 On-Demand, Spot or Reserved Instances.
Amazon EKS allows you to easily containerize existing applications and migrate them without needing to refactor your code or change.
Amazon EKS Pricing
With the EKS pricing structure, you pay $0.20 per hour for each cluster you create. EKS splits the management responsibility between the cluster control plane (run and deployed by AWS) and worker nodes (handled by users). Control plane nodes dispersed across three availability zones enables EKS to create a highly available cluster automatically. The worker nodes have standard EC2 pricing. While EKS may not be the cheapest option, it provides consistent integration with other Amazon cloud services while working with existing virtual private cloud networks. A single EKS cluster is sufficient to run multiple applications.
AWS Fargate vs Amazon EKS
Fargate helps to focus on designing and building your applications instead of managing the infrastructure that runs them. Fargate has its fleet of EC2s ready for your tasks, giving you the ability to provision thousands of containers within seconds. EKS is a managed service and offers the advantage of running the same scheduler in AWS, and it can replicate the container environment to another live environment with minimal modifications. It extracts an additional layer of scheduling and clustering to a container environment. EKS makes it easier to provide security for your Kubernetes clusters due to its advanced features and integrations to AWS. On the other hand, seamless scaling is much more comfortable with Fargate as you define it at the task level, and then you’re good to go.
Fargate completely abstracts the underlying infrastructure, and you can see every one of your containers as a single machine. You only need to specify what resource you need for every container, seeing as the heavy lifting is complete already. Developers have been waiting for years for such innovation and to gain the control and flexibility they need. For any tech business, serverless deployment offers a competitive advantage, allowing you to focus on writing and deploying great code.
Use AWS Fargate – When your application requires something straight forward, is stateless with on-demand commercial requirements.
Use Amazon ECS – When more control and integration with your infrastructure is required.
Use Amazon EKS – If your team have already committed to Kubernetes and you would like the simplicity of a managed service.
PolarSeven is an Advanced AWS Consulting Partner with DevOps competency, running a number of projects in the Fargate space right now – with a wealth of ECS and EKS experience to boot. We help you make the right infrastructure choice for your application, provide the know-how to design and deploy it, and offer flexible managed services to keep it optimised.
For expert assistance on how to run AWS containers, visit https://polarseven.com/our-services.