GP - Fotolia


2 options to deploy Kubernetes on AWS: EKS vs. self-managed

AWS users face a choice when deploying Kubernetes: run it themselves on EC2 or let Amazon do the heavy lifting with EKS. See which approach best fits your organization's needs.

AWS users that want to deploy Kubernetes on AWS have two main options: go it alone or let Amazon do the heavy lifting. Each approach has its pros and cons.

Kubernetes, an open source container orchestrator, simplifies automation, deployment, scaling and operation of containerized applications. Kubernetes enables companies to reap the benefits of containers without having to deal with the complexity and overhead that previously went along with them.

AWS has a fairly successful managed container orchestration service of its own -- Amazon Elastic Container Service. Alternatively, users could run their own Kubernetes clusters on EC2. Eventually however, Amazon couldn't ignore the demand for a managed Kubernetes offering, and in late 2017, Amazon added Elastic Container Service for Kubernetes (EKS).

Let's take a closer look at EKS and compare it to self-hosting Kubernetes on AWS. Consider the benefits and downsides of each option to decide which one would better suit your needs.

Kubernetes on AWS: Know your options

With EKS, Amazon fully manages the control plane -- components like etcd and Kubernetes API server. The entire management infrastructure runs behind the scenes, across multiple availability zones, while AWS automatically replaces any unhealthy nodes in order to maintain high availability. AWS also handles all the upgrades and patching. For users, the EKS control plane is essentially a black box.

However, users still need to deploy and maintain the data plane through the worker nodes. Users choose the instance type and size, the number of instances and everything else related to the nodes that will run their containerized workloads.

Editor's note: At the 2019 re:Invent conference, AWS introduced an additional option for managed Kubernetes on AWS -- Amazon EKS on AWS Fargate. With this capability, users can run Kubernetes pods through Fargate without creating and managing EC2 instances for their EKS clusters. 

Kubernetes cluster

A developer can deploy an EKS cluster using eksctl. This third-party tool can provision an entire Kubernetes infrastructure, including the managed control plane and unmanaged worker nodes. It can also make subsequent modifications when required. Use kubectl to run actual commands against a Kubernetes cluster and manage the containerized resources within it. This is a standard tool, regardless of the Kubernetes version.

Alternatively, IT teams can run a self-hosted Kubernetes environment on an EC2 instance. Deploy with tools like kops, which help create and manage the Kubernetes cluster. In this case, the control plane will be visible and available to the users, who will be able to see components running on dedicated EC2 instances. Admins will also have to patch and maintain everything by hand, which can be inconvenient in many cases.

Kubernetes on AWS: Managed vs. unmanaged

When an organization has to decide how it will deploy Kubernetes on AWS, features and availability are the first things to consider. This is where EKS comes up short. It's not available in all AWS regions, and its release velocity is slow. As of publication, EKS is only running up to Kubernetes version 1.12, even though version 1.14 is already out. Additionally, EKS doesn't have all the features you can find with the self-hosted version. Amazon is slowly adding support for them. For example, it recently added private endpoints.

On the other hand, EKS certainly cuts the overhead of deploying and maintaining Kubernetes. This is one of its main selling points. Many companies don't have the resources or the willingness to manage a self-hosted Kubernetes cluster, so interest in running Kubernetes in the cloud rose significantly with the release of EKS.

Cost is another factor. EKS charges $150 per month for the control plane, and organizations still have to pay for the worker nodes on top of that. Because self-hosted Kubernetes can be deployed on various instance types, its cost will vary by use case. Smaller development environments will likely cost less than $150 per month, while larger production workloads can expect to easily surpass that figure.

Choosing the right option to deploy Kubernetes on AWS comes down to the use case and specific development requirements. The costs are likely similar for both options, but the available features and the simplicity -- or lack thereof -- will push organizations one way or the other.

Next Steps

Kubernetes cost management approaches to save money

An introduction to DevOps on AWS

Compare Amazon ECS vs. EKS

Key Amazon EKS monitoring best practices

Dig Deeper on AWS cloud development