Skip to content
EgyKode
Guided lab

Amazon EKS Cluster & Managed Node Group Provisioning

31 minIntermediate

This creates billable resources. Run it in a dev environment and destroy it when you finish. Set a budget alarm first.

Success criteria

0 of 3

What you are building#

What is Amazon EKS?#

Amazon EKS (Elastic Kubernetes Service) is a managed Kubernetes service that eliminates the operational burden of deploying and maintaining the Kubernetes Control Plane (API Server, etcd, Controller Manager, Scheduler) across multi-AZ availability zones.

  • Managed Node Groups: AWS handles provisioning, updating, and auto-repairing EC2 instances acting as Kubernetes worker nodes.
  • OIDC Provider: Enables IRSA (IAM Roles for Service Accounts) so Kubernetes pods can assume IAM roles natively.
text
                                AMAZON EKS CLUSTER ARCHITECTURE
                                
  +-----------------------------------------------------------------------------------+
  |  AWS MANAGED KUBERNETES CONTROL PLANE (Managed by AWS)                            |
  |  - API Server (kube-apiserver)                                                    |
  |  - High-Availability etcd Key-Value Store                                         |
  |  - Controller Manager & Scheduler                                                 |
  +----------------------------------------+------------------------------------------+
                                           |
                                           | Secure Control Plane Communication
                                           v
  +-----------------------------------------------------------------------------------+
  |  PRIVATE SUBNETS (VPC) — EKS MANAGED NODE GROUP                                   |
  |                                                                                   |
  |  +-------------------------------+     +---------------------------------+        |
  |  | Worker Node 1 (us-east-1a)    |     | Worker Node 2 (us-east-1b)      |        |
  |  | Type: t3.medium               |     | Type: t3.medium                 |        |
  |  | - Kubelet & Containerd        |     | - Kubelet & Containerd          |        |
  |  | - AWS VPC CNI Plugin          |     | - AWS VPC CNI Plugin            |        |
  |  +-------------------------------+     +---------------------------------+        |
  +-----------------------------------------------------------------------------------+

Steps#

Step 1: Deploy EKS Cluster (~15-20 Minutes Creation Time)#

Terminal
cd 01-Infrastructure-Terraform/Lab05-EKS-Cluster-Provisioning
terraform init
terraform apply -auto-approve

Step 2: Configure Local kubectl Context#

Terminal
aws eks update-kubeconfig --name nti-devops-eks --region us-east-1

Verify it worked#

Terminal
kubectl get nodes

Expected Output:

text
NAME                             STATUS   ROLES    AGE     VERSION
ip-10-0-10-42.ec2.internal       Ready    <none>   3m20s   v1.34.0
ip-10-0-11-89.ec2.internal       Ready    <none>   3m18s   v1.34.0


Clean up#

Run this even if you did not finish. Everything above is destroyable, and an account full of half-built experiments is how a surprise bill starts.

DestructiveThis removes real resources. Check which environment you are in first.

Terminal
terraform destroy -auto-approve
# The control plane is the expensive part. Confirm no cluster survives:
aws eks list-clusters --query 'clusters'
# Node groups can outlive a failed destroy:
aws ec2 describe-instances --filters Name=instance-state-name,Values=running --query 'Reservations[].Instances[].[InstanceId,InstanceType]' --output table
# And load balancers created by Kubernetes Services are not in Terraform state:
aws elbv2 describe-load-balancers --query 'LoadBalancers[].LoadBalancerArn'

Cost of this lab: Billable, and never free. An EKS control plane is $0.10/hour (~$73/month) from the moment it exists, with no free tier — plus the node group's EC2 instances and any NAT Gateway. Budget a few dollars for an afternoon, and destroy the cluster the same day.

The concept behind it

Ready to try it without help?Do the challenge