BlueXP Blog

Kubernetes on AWS: 3 Container Orchestration Options

Written by Yifat Perry, Technical Content Manager | Jun 3, 2021 10:40:40 AM

Kubernetes is a highly popular open-source container orchestration platform. Amazon Web Services (AWS) is a top cloud computing vendor that provides a wide range of services—including running Kubernetes on the AWS cloud.

You can self-manage Kubernetes on Amazon Elastic Compute Cloud (Amazon EC2), by installing Kubernetes directly on EC2 instances. Alternatively, you can opt to use Amazon Elastic Kubernetes Service (Amazon EKS) to manage Kubernetes on AWS resources.

Another notable managed service is Amazon Elastic Container Service (AWS ECS), which provides container orchestration using Amazon-built technology—not using Kubernetes. ECS simplifies management while letting you control and fine-tune orchestration processes.

This is part of an extensive series of guides about microservices.

In this article, you will learn:

Kubernetes on AWS Deployment Options

Self-Managed Option: Kubernetes on Amazon EC2

It is possible to run Kubernetes directly on Amazon infrastructure, without using one of Amazon’s managed container services. This involves:

  • Creating the required Amazon EC2 instances—Amazon provides compute instances that host your Kubernetes nodes.
  • Installing Kubernetes—you will need to choose a Kubernetes distribution, set up and manage Kubernetes on your own.

Amazon Elastic Kubernetes Service (AWS EKS)

EKS manages Kubernetes for you, performing the following tasks:

  • Managing Kubernetes master nodes and control plane
  • Security configurations, patches and upgrades.
  • Scaling persistent backend layers and API servers
  • Replicating master schedulers across 3 availability zones to increase availability
  • Scanning for and replacing unhealthy nodes automatically

Because EKS is based on open-source platforms, it lets you move pods to a non-AWS environment without code changes.

EKS integrates with Amazon services including Amazon Virtual Private Cloud (VPC), Elastic Load Balancing (ELB), Identity and Access Management (IAM), and AWS PrivateLink.To use Amazon EKS, you provision worker nodes and connect them to Amazon EKS endpoints. You must select a Virtual Private Cloud (VPC) and specify security groups and IAM roles to help secure the VPC traffic. While it is possible to run all your clusters on a single VPC, it is recommended that you use a different VPC for each cluster to improve network isolation and enhance your overall security profile.

Learn more about EKS in our detailed blog posts:

Kubernetes on EC2 vs EKS

EKS is best suited for AWS, so it might be the best option if you are running Kubernetes on AWS. It is easy to set up and helps minimize your management burden. You can also run EKS on Outposts for on-premises workloads.

If you want more control, however, you can run Kubernetes on EC2 instances. This allows you to choose the tools and Kubernetes distribution that suit you. In contrast, EKS limits you to built-in tools and configurations.

Running Managed Containers on Amazon EC2 vs AWS Fargate

Amazon EKS supports two launch types: EC2 and Fargate. Containers managed as part of Kubernetes clusters can be deployed on either these services, or a combination of the two.

Running containers on EC2

You can run EKS clusters on top of regular Amazon Elastic Compute Cloud (EC2) instances. This gives you more control over customization of the infrastructure. For example, you can select specific types of instances, such as memory-optimized instances, or instances with graphics acceleration.

However, this also means you are responsible for patching, networking, and securing your environment, and monitoring instances to ensure they are properly utilized.

The price of an EC2-based launch type is fixed per hour, with the memory, CPU, and other hardware resources included in the instance type. You pay the full instance cost, no matter how many containers the instance actually runs.

Running containers on Fargate

Alternatively, you can use Amazon Fargate to launch Amazon EKS instances. EKS communicates with Fargate to run and manage containers. This saves the complexity and overhead of configuring and managing EC2 instances for your Kubernetes clusters. Fargate also improves security, by isolating resources for each application.

In terms of pricing, Fargate prices are generally closer to resource requirements. Fargate workloads are priced according to the CPU and memory used by individual containers, and AWS manages the deployment of containers across the infrastructure.

Below a certain threshold, Fargate offers more cost-effective pricing over EC2-based deployment. managing your own set of EC2s is more cost-effective than using Fargate.

Comparing EC2 vs. Fargate pricing for containerized workloads

When comparing Amazon EC2 and Fargate, both services may be more cost effective, depending on your scenario.

As shown in the graph below, the cost advantage of Fargate is not dependent on the pricing plan, but is strongly affected by CPU and memory reservation rates. The higher the utilization of an EC2 instance, the more cost effective EC2 becomes. The lower the utilization, the more cost effective Fargate will be.

Image Source: AWS

The AWS Kubernetes Alternative: Amazon Elastic Container Service (AWS ECS)

ECS is a container management service that facilitates the management of multiple containers in a cluster. ECS is not based on Kubernetes - it is a simple, lightweight alternative you can use to orchestrate container workloads.

You can run, stop and maintain a number of containers (defined as “tasks”) within a grouping of tasks known as a “service”. You can use either a serverless infrastructure, which is managed by AWS Fargate, or manage your own cluster of Amazon EC2 instances, which gives you more control over your infrastructure.

Scheduling

Amazon ECS provides two schedulers that deploy containers in clusters. ECS schedulers allow you to:

  • Deploy containers according to availability requirements or computing needs (RAM, CPU, etc.).
  • Schedule long-running applications or services and batch jobs.
  • Integrate AWS Blox (an open-source container orchestration tool) with Amazon ECS to schedule containers or, alternatively, use a third-party scheduling option supported by ECS.
Docker Integration

ECS supports Docker so you can use Docker containers across EC2 instance clusters. Each instance runs a Docker daemon, which can deploy any application that is packaged as a container—either on Amazon ECS or locally—without the need to alter the container.

Networking

ECS also supports Docker networking, allowing you to integrate with Amazon Virtual Private Cloud (Amazon VPC) to isolate containers. You control the interactions of your containers with external traffic and services.

Cluster Management

You launch a cluster of container instances, specifying your desired tasks, and allow Amazon ECS to handle the management. ECS can install and operate:

  • Cluster management software
  • Configuration management systems
  • Monitoring systems
  • Infrastructure to manage the scalability and availability of each system
Kubernetes on EC2 vs ECS

Here are some of the key differences between deploying Kubernetes on EC2 and ECS.

ECS characteristics include: 

  • Better integration with other Amazon cloud services
  • Cannot be extended into other clouds
  • Does not support directly transferring hosted workloads to other locations (except for an AWS Outposts environment installed on-premises) -- however containers are portable, so you can easily migrate them to other platforms

Kubernetes characteristics include:

  • Open-source platform, available on any major public clouds
  • Can run on premises and outside of AWS
  • Supported by a large and dynamic open-source community, providing extra features such as add-ons and extensions that are not available with ECS.

Learn more in our blog post: AWS ECS vs Kubernetes: An Unfair Comparison?

Optimizing Kubernetes Storage with Cloud Volumes ONTAP

NetApp Cloud Volumes ONTAP, the leading enterprise-grade storage management solution, delivers secure, proven storage management services on AWS, Azure and Google Cloud. Cloud Volumes ONTAP capacity can scale into the petabytes, and it supports various use cases such as file services, databases, DevOps or any other enterprise workload, with a strong set of features including high availability, data protection, storage efficiencies, Kubernetes integration, and more.

In particular, Cloud Volumes ONTAP supports Kubernetes Persistent Volume provisioning and management requirements of containerized workloads 

Learn more about how Cloud Volumes ONTAP helps to address the challenges of containerized applications in these Kubernetes Workloads with Cloud Volumes ONTAP Case Studies.

 

Learn more about Kubernetes on AWS:

AWS ECS vs Kubernetes: An Unfair Comparison?

Amazon Elastic Compute Service (ECS) is a container orchestration service that runs and manages containers. It manages cloud machine instances, scales and schedules groups of containers across multiple Availability Zones (AZ). By contrast, Kubernetes is the world's most popular container orchestration platform, which can run in the Amazon cloud but also on other cloud platforms and providers.

Comparing Kubernetes to ECS is not an apples-to-apples comparison, because ECS provides both container orchestration and a managed service that operates it for Amazon users. Kubernetes offers only the first aspect, not the second. Learn how ECS compares to Kubernetes and also to a managed Kubernetes services that offer both aspects - Amazon Elastic Kubernetes service.

Read more about AWS ECS vs Kubernetes

AWS Kubernetes Cluster: Quick Setup with EC2 and EKS

Amazon Web Services provides several convenient options for setting up Kubernetes clusters. In this post we’ll explain how clusters work and provide quick tutorials for two options—running Kubernetes clusters directly on EC2 and via the Elastic Kubernetes Service (EKS). We’ll also show how NetApp Cloud Volumes ONTAP can help provision persistent Kubernetes storage on AWS.

Read more about AWS Kubernetes Cluster

AWS EKS Architecture Explained

Amazon Elastic Kubernetes Service (Amazon EKS) is a managed Kubernetes service that scales, manages, and deploys containerized applications. Learn how Amazon EKS works and discover key components of the AWS EKS Architecture including clusters, nodes, and networking.

Read more about AWS EKS Architecture Explained

EKS vs GKE: Managed Kubernetes Giants Compared

Learn the differences between Amazon’s Elastic Kubernetes Service (EKS) and Google Kubernetes Engine (GKE), and which solution is best for your organization.

Read more about EKS vs GKE: Managed Kubernetes Giants Compared

AWS ECS vs EKS: 6 Key Differences

Amazon Elastic Container Service (Amazon ECS) is a scalable managed service that lets you run and orchestrate a large number of containers. Amazon Elastic Kubernetes Service (EKS) lets you run Kubernetes on AWS as a managed service, while retaining compatibility with the open source K8s project. Learn more about these two services, their differences, and which is right for you.

Read more: AWS ECS vs EKS: 6 Key Differences

EKS vs AKS: Head-to-Head

Amazon Elastic Kubernetes Service (EKS) and Azure Kubernetes Service (AKS) are popular managed Kubernetes services offered by the world’s two leading cloud providers. See EKS and AKS go head-to-head on upgrades, pricing, availability, ease of onboarding, and more.

Read more: EKS vs AKS: Head-to-Head

AWS ECS in Depth: Architecture and Deployment Options

Amazon Elastic Container Service (ECS) is a cloud-based and fully managed container orchestration service. Learn about Amazon Elastic Container Service (ECS) components, and how to deploy ECS containers using Amazon EC2 and Fargate.

Read more: AWS ECS in Depth: Architecture and Deployment Options

AWS Container Features and 3 AWS Container Services

Containers are an effective way for developers to deploy and package their applications. Learn about unique features AWS provides to help you run containerized applications in the cloud and learn about Amazon’s three popular container services.

Read more: AWS Container Features and 3 AWS Container Services

AWS EKS: 12 Key Features and 4 Deployment Options

Amazon Elastic Kubernetes Service (EKS) is a cloud-based container management service. Understand key EKS features that take the pain out of managing Kubernetes, and four ways you can use the service, both in the cloud and on-premises.

Read more: AWS EKS: 12 Key Features and 4 Deployment Options

How to Build a Multicloud Kubernetes Cluster in AWS and Azure Step-by-Step

While multicloud deployments have gained in popularity, they haven’t lost any of their complexity. Orchestrating such environments in Kubernetes can be a considerable challenge. This added complexity extends directly to increased costs.

In this blog we’ll demonstrate an example of this complexity by showing you how to build a stateful multicloud Kubernetes cluster that leverages AWS and Azure step by step.

Check out the full walkthrough in How to Build a Multicloud Kubernetes Cluster in AWS and Azure Step by Step.

See Additional Guides on Key Microservices Topics

Together with our content partners, we have authored in-depth guides on several other topics that can also be useful as you explore the world of microservices.

Application Mapping

Authored by CodeSee

Kubernetes Persistent Volume

Authored by NetApp

Kubernetes Statefulset

Authored by NetApp