EN

How to create a Managed Kubernetes in 5 minutes with AWS EKS

Why create a managed cluster and how to easily set up your lab to test it. (Part 1)

CTO

João Brito

Why use Kubernetes?

In the middle of 2024, it is almost certain that you have already heard of Kubernetes. If you are starting out now, this article is perfect for you! We will guide you through the first steps with Kubernetes in a simple and direct way.

You will learn not only how to set up your own Kubernetes cluster, but also understand the benefits it brings to your projects, as well as important tips to avoid common pitfalls.

This is a series of articles, covering each of the Cloud Providers. So, let's start with AWS.

What are the benefits of using Kubernetes in your environments?

  • Scalability: Kubernetes simplifies the scalability of your applications, allowing you to scale them with ease as your demand grows.

  • Resilience: With Kubernetes, your applications are highly resilient. It automatically detects and replaces failed containers or nodes, keeping your applications running reliably.

  • Portability: Kubernetes is an open-source platform and can run in virtually any environment, whether locally, in public, or private clouds. This offers the flexibility to move your applications between different cloud providers without major modifications.

  • Automation: With Kubernetes, you can automate application deployment, updating, and scaling tasks, saving time and reducing human error.

  • Giant Ecosystem: Kubernetes has a vast ecosystem of tools and services, facilitating integration with other technologies and accelerating application development.

A brief history

Here are some of the most important moments in the history of Elastic Kubernetes Service (EKS) on AWS:

  • 2017: AWS announces Amazon Elastic Container Service for Kubernetes (EKS) at AWS re:Invent, offering customers the ability to run Kubernetes as a managed service on AWS.

  • 2018: Amazon EKS is made generally available (GA), allowing customers to easily deploy and manage Kubernetes clusters on AWS. Also this year, AWS announces integration with AWS Fargate, offering customers the option with even more abstractions.

  • 2019: AWS launches AWS App Mesh, a service mesh for Amazon EKS.

  • 2021: AWS introduces Amazon EKS Anywhere, allowing customers to create and manage Kubernetes clusters in on-premises environments or other clouds.

Hands-on

So this is the time to get this Kubernetes thing up and running.

Since this is a very straight-to-the-point article, we are going to create a cluster using AWS's native tool, eksctl. It can be the simplest alternative to clickops and I intend to write more about this in the future.

Installing eksctl on Linux (others: here)
# for ARM systems, set ARCH to: `arm64`, `armv6` or `armv7`
ARCH=amd64

PLATFORM=$(uname -s)_$ARCH

curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"

# (Optional) Verify checksum
curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check

tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz

sudo mv /tmp/eksctl /usr/local/bin
Creating a cluster

To avoid creating a cluster that already has very large machines, we will use a basic configuration file here and create this cluster in 2 steps:


1 - Create a "cluster-basico-config.yaml" file

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: cluster-basico
  region: us-east-1
nodeGroups:
  - name: nodegroup-1
    instanceType: t4g.medium
    desiredCapacity: 2

2 - Run the command pointing to this file:

eksctl create cluster -f cluster-basico-config.yaml

I took advantage of this configuration file above to use ARM machines, which have a much lower cost while maintaining great performance. For more options, use the documentation: https://eksctl.io/usage/arm-support/

Do not forget to delete this test cluster
eksctl delete cluster --name=cluster-basico --region=us-east-1


Banner

Exclusive benefits

AWS is a leader in the cloud market and has a vast product portfolio, services that you can easily integrate with your applications.

One of these integrations is the AWS Fargate service, a serverless option where the main feature is not needing to manage the nodes of your Kubernetes cluster. Recommended if you are looking for a simplified operation. 

Costs

Just the EKS service already has an average monthly cost of $73 and besides that, you must take into account the costs of the nodes which are the famous EC2, storage costs, networking costs among others. As this can vary greatly, you can evaluate in advance in the AWS calculator.

A tip for choosing the size of your nodes is a calculator launched by the team at LearnK8s.

Important tips

  • A cost that can directly impact your billing is traffic between zones, pay close attention when creating your multi-zone cluster;

  • When creating the cluster's subnets, pay attention to the amount of IPs for the subnet that will have nodes with more IPs than those that won't;

  • Use Cluster Autoscaler  or Karpenter with nodegroups configured to the minimum;

  • Utilize EBS CSI Driver;

  • Utilize ARM architecture machines that have a lower cost.

Next steps

Just having a Kubernetes cluster is not enough. Kubernetes spans a wide range of infrastructure, including networking, storage, processing, and more. This results in a massive cognitive load and is almost impossible to master in all the necessary detail, especially considering that every 4 months we have a new version. Your cloud native journey with Kubernetes is just beginning, and you will certainly encounter a whole ecosystem of tools, such as monitoring, centralized logging, CI/CD, and, of course, your own applications.

So do not miss our next content here on the blog, also follow the Kubicast, where you can hear about experiences, cases and learn a lot about the cloud native world.

See you next time with a new cloud provider!

Newsletter Getup.

Atualizações sobre Kubernetes e Software Supply Chain Security todos os meses.

Operating Kubernetes in production for more than 13 years. With Quor, this experience extends to software supply chain security as well.