In Part 1 of this series about containerization and EKS, we looked at containerization and how you can utilize containers on AWS, including options like running Docker containers, ECS, and self-hosted Kubernetes. We also introduced AWS EKS, a managed AWS Kubernetes solution. So let’s continue where we left off and take a look at AWS EKS features, pricing, downsides, and more. We will also consider your options when looking to deploy EKS in your AWS Cloud environment.
AWS EKS: Use Cases and New Features
EKS seems to be getting a lot of attention lately, and now, AWS EKS Anywhere (expected this year) will allow you to deploy Kubernetes clusters on any sort of machine you desire—not only on AWS but also on your bare metal hardware in a data center or even on a virtual machine. Plus, with EKS Anywhere, you’ll still be able to use the AWS console and EKS dashboard to monitor your clusters.
AWS EKS can be used for a multitude of different use cases, such as reliably running your web applications and having them scale automatically across multiple availability zones, as well as fully integrate with other AWS services like load balancers, etc.
You can even implement machine learning on EKS and have access to Deep Learning Containers, ready with pre-installed deep learning frameworks like TensorFlow and Apache MXNet.
Another great use case that many are looking forward to is a hybrid deployment environment, thanks to the EKS Anywhere feature we mentioned earlier.
And as AWS matures, more and more third-party tools will be supported as well. For example, Terraform (the most popular infrastructure-as-a-service tool right now) works really well with EKS.
AWS EKS Pricing
AWS EKS does come with a cost. You will pay $0.10 per hour for each of your AWS EKS clusters that are running (the price had been twice as much, but Amazon decided to cut it in half in January of 2020). This is actually quite cheap for what you get, especially since you can utilize namespaces to run everything on a single EKS cluster, without the need to provision a new one for each project.
Downsides of AWS EKS
There are many benefits that EKS provides, but there are also some downsides. Like all other managed Kubernetes alternatives, EKS fully relies on upstream Kubernetes development. And as Kubernetes is getting new releases and updates very fast, this means that Amazon has to keep up.
Also, while the managed control plane is a great way to remove the overhead of having to deploy and administer everything yourself, it ties you to the specific set of things being offered—you can’t just turn API features on or off as desired.
Another thing worth mentioning is that unless you are relying on AWS Fargate, node provisioning and management is a complex and time-consuming process.
When Should You Use ECS Instead of EKS
Kubernetes, which is offered by EKS, is a de facto open-source solution for container orchestration in the cloud. This means there is a vast community that now not only works on improving Kubernetes itself but also provides various tools that work with it. Kubernetes is a robust orchestrator that can handle almost any task you throw at it, but it is also complex, and to work with it, you need people with specific skills.
This can be a huge downside, as there are thousands of small companies (and even more startups) that simply do not have experienced DevOps people on their team. Instead, they usually rely on developers to handle this work.
ECS, on the other hand, is very easy to run, with minimal configuration needed. So even without any prior experience, you can still run your containers in the cloud, with just a little time invested in looking at the documentation. So, unless your company has a DevOps team, or people with prior Kubernetes experience, ECS is a great alternative.
How to Deploy EKS
If you do decide to try out EKS on your AWS Cloud, there are a few options available to you. You can deploy it by hand, use a templating solution, or even implement a third-party tool to help you out.
Deploying EKS Manually
Deploying EKS clusters manually can be done either via the AWS web console or the command line interface (CLI). Both are fairly straightforward. To use the web console, just go to the EKS service, click on “Create Cluster,” and follow the steps. To use the CLI, you can consult the EKS CLI documentation page here. Keep in mind that both these options let you create an EKS cluster only, meaning an additional step will be required to configure worker nodes.
Overall, manual EKS deployment is rare, as it leaves much to be desired, and using a template or wrapper tool is usually a better choice.
Deploying EKS Using Templates
Infrastructure as code has been very popular lately and is a great option to deploy your EKS cluster, especially if you’re already relying on templates to provision other resources within your cloud infrastructure.
There are two main options here: CloudFormation and Terraform. CloudFormation is fairly easy to use (though it does require some experience) and can help you bring up EKS very quickly with just a few lines of code. AWS has full documentation for the deployment of EKS clusters using CloudFormation, as well as documentation for provisioning worker nodes.
Terraform is an industry-standard tool that has matured a lot over the past few years. Its documentation has a detailed guide on how to deploy EKS clusters along with the worker nodes, but keep in mind that in order to use Terraform in your cloud environment, you need to do some prep work as well—you can’t just go in and simply create an EKS resource. For this reason, Terraform should only be used to deploy EKS if you’re already utilizing it or if you have people who have some prior experience working with it.
Deploying EKS Using eksctl
eksctl is a command line interface tool that makes EKS deployment so much easier. This tool is written in Go and is being updated constantly. It uses CloudFormation, but all you have to do is issue the command “eksctl create cluster” with the desired parameters, and an EKS cluster with worker nodes will be provisioned for you.
You will have your EKS up and running with the following default settings:
- Exciting auto-generated name, e.g., “fabulous-mushroom-1527688624”
- Two m5.large worker nodes—this instance type suits most common use cases and is good value for your money
- Using the official AWS EKS AMI
- Us-west-2 region
- A dedicated VPC (check your quotas)
Of course, a more complex command gives you much more control, for example:
eksctl create cluster --name=eksctl-test --node-ami=auto --nodes=3 --node-type=c5.large --nodes-min=0 --nodes-max=4 --node-volume-size=50 --ssh-access --ssh-public-key=test.pem --region=us-east-1 --tags env=testing --node-private-networking --vpc-private-subnets=subnet-04123e9ff975a684,subnet-0a555faba2ba23ba3,subnet-02393aa6bb599389 --vpc-public-subnets=subnet-0b76c22b527767c,subnet-0ad2225fb809d0b,subnet-044b8cc766dfab237
This will give you your desired number of nodes (as well as a set range for the minimum and maximum count), instance type to be used, and disk size, as well as an SSH key to be added to the worker nodes, tags, and private and public subnets.
eksctl has added lots of features over time, and you can now use it to not only provision your clusters and worker nodes but also enable CloudWatch logging, implement a custom AMI, or utilize Fargate for node provisioning.
Unless your company relies on Terraform or uses CloudFormation to provision all of its resources, eksctl is a recommended option.
Summing it up
In this two-part article, we’ve reviewed containerization on AWS and delved deeper into the Elastic Kubernetes Service, a managed offering on Amazon’s public cloud.
EKS brings many desired benefits with it and is also priced very fairly, but it comes with some downsides as well—including not always being the best tool for the job, depending on your specific use case. So before opting for it (or any other solution for that matter), make sure to understand your needs and choose what will work best for your organization.
In case you do decide to go with EKS, we’ve shown you a few different ways to deploy it, whether you have experience in the cloud or not.