AWS EKS

πŸ”Ή AWS EKS Cluster Architecture (AWS Infrastructure Side)

This guide covers: βœ… EKS Cluster Architecture from AWS perspective βœ… How AWS components interact with EKS βœ… Real-world enterprise deployment example βœ… Networking, Load Balancing, and Compute considerations

Karpenter, aws alb, ebs driver ALL THIS CONTROLLER EXPOSE DEFAULT METRICS AT /METRICS PATH by default


πŸ”Ή AWS Components Used in EKS Cluster

Before setting up EKS, let’s understand how AWS services work together to provide a fully managed Kubernetes cluster.

Component

Description

EKS Control Plane

AWS-managed Kubernetes control plane that schedules workloads and manages the cluster.

VPC (Virtual Private Cloud)

Provides networking for the cluster, including subnets, NAT Gateway, and internet access.

Subnets (Public & Private)

Nodes are deployed in private subnets; public subnets are used for Load Balancers.

Elastic Load Balancer (ELB)

Used for Ingress; Application Load Balancer (ALB) or Network Load Balancer (NLB) routes traffic.

EKS Node Groups

EC2 instances that run worker nodes to host pods.

Fargate

Serverless compute for running pods without managing EC2 instances.

IAM (Identity and Access Management)

Provides access control to AWS resources for EKS components.

Security Groups & NACLs

Controls network traffic to and from nodes and workloads.

Route Table

Defines network communication rules within the VPC.

ECR (Elastic Container Registry)

Stores container images used by EKS workloads.

CloudWatch & Prometheus

Monitors logs and metrics for EKS.

Auto Scaling

Automatically scales worker nodes based on demand.


πŸ”Ή EKS Deployment - AWS Infrastructure

Scenario: A company wants to deploy a highly available, production-ready EKS cluster. βœ” The application should be accessible via an ALB. βœ” Workloads must be securely deployed in private subnets. βœ” The cluster should auto-scale based on demand. βœ” Fargate should be used for some serverless workloads.

EKS Infrastructure Diagram


πŸ”Ή Step-by-Step AWS Console Setup for EKS

1️⃣ Create a VPC for EKS

  1. Go to AWS Console β†’ VPC Dashboard β†’ Create VPC

  2. VPC Name: EKS-VPC

  3. CIDR Block: 10.0.0.0/16

  4. Click Create VPC

βœ… Common Issue: "EKS requires private subnets." πŸ”Ή Fix: Ensure subnets are correctly labeled as private in AWS tags.


2️⃣ Create Public and Private Subnets

  1. Go to VPC Dashboard β†’ Subnets β†’ Create Subnet

  2. Subnets:

    • Public Subnet 1 (for Load Balancer): 10.0.1.0/24

    • Public Subnet 2 (for Load Balancer): 10.0.2.0/24

    • Private Subnet 1 (for Worker Nodes): 10.0.3.0/24

    • Private Subnet 2 (for Worker Nodes): 10.0.4.0/24

  3. Click Create Subnets

βœ… Common Issue: "EKS workloads cannot access the internet." πŸ”Ή Fix: Ensure NAT Gateway is configured for private subnets.


3️⃣ Set Up an Internet Gateway (IGW) & NAT Gateway

  1. Go to VPC Dashboard β†’ Internet Gateways β†’ Create Internet Gateway

  2. Attach it to EKS-VPC

  3. For Private Subnets:

    • Go to NAT Gateway β†’ Create NAT Gateway

    • Attach it to a public subnet

    • Associate with private subnet route table

βœ… Common Issue: "Pods in private subnet can't access the internet." πŸ”Ή Fix: Ensure NAT Gateway is properly routing outbound traffic.


4️⃣ Create an EKS Cluster

  1. Go to EKS Console β†’ Create Cluster

  2. Cluster Name: Production-EKS

  3. Select VPC: EKS-VPC

  4. Choose Subnets: (Private Subnets)

  5. Click Create Cluster

βœ… Common Issue: "Cluster creation fails." πŸ”Ή Fix: Ensure IAM roles and networking configurations are correct.


5️⃣ Set Up EKS Node Groups (Worker Nodes)

  1. Go to EKS Console β†’ Node Groups β†’ Create Node Group

  2. Node Group Name: Worker-Group

  3. AMI Type: Amazon Linux 2

  4. Select Private Subnets

  5. Instance Type: m5.large

  6. Auto Scaling: Enable

  7. Click Create

βœ… Common Issue: "Nodes not joining the cluster." πŸ”Ή Fix: Ensure correct IAM roles and security groups are attached.


6️⃣ Configure Ingress Using AWS ALB

  1. Install ALB Ingress Controller

  2. Deploy an Ingress Rule

βœ… Common Issue: "Ingress controller not creating ALB." πŸ”Ή Fix: Ensure IAM roles for ALB Controller have correct permissions.


7️⃣ Monitoring & Scaling with CloudWatch & Prometheus

  1. Go to AWS Console β†’ CloudWatch β†’ Create Log Group

  2. Install Prometheus for EKS monitoring

  3. Enable Horizontal Pod Autoscaler (HPA)

βœ… Common Issue: "HPA not scaling workloads." πŸ”Ή Fix: Ensure metrics server is installed.


πŸ”Ή Summary of AWS EKS Infrastructure

βœ” VPC with Public & Private Subnets βœ” EKS Cluster with Node Groups in Private Subnets βœ” NAT Gateway for Private Subnet Internet Access βœ” ALB for Ingress Traffic Handling βœ” Auto Scaling & Monitoring for High Availability


πŸ”₯ Next Steps

Do you want to configure EKS networking policies or RBAC for security? Let me know! πŸš€

Last updated