Nextgen Blog
HomeLearnAIQuantumRoboticsSecuritySpaceAbout
Nextgen Blog

By Anubhav — full stack engineer, IIT Mandi CSE. Deep dives into AI, software engineering, and the technologies shaping the next generation of tech.

Navigate

  • Home
  • Learn
  • Blog
  • Archive
  • About

Topics

  • Artificial Intelligence
  • Quantum Computing
  • Robotics
  • Cybersecurity
  • Space Tech

Connect

Built with ❤️ & By - Anubhav

© 2026 Nextgen Blog by Anubhav. All rights reserved.

Privacy PolicyTerms of Service
Phase 05 · Production & GitOpsChapter 29 of 33
28.
Phase 05Read time ~15 minDifficulty intermediate

Kubernetes on AWS: EKS ☁️

Warrior, now we move from local Kubernetes → production cloud Kubernetes.

In this chapter
  • 01What is Amazon EKS?
  • 02Local Kubernetes vs EKS
  • 03What does AWS manage?
  • 04EKS architecture
  • 05EKS + VPC
  • 06Why multiple Availability Zones?
  • 07Worker Nodes
  • 08Managed Node Groups
  • 09EKS compute options
  • 10Managed node groups
  • 11Self-managed nodes
  • 12AWS Fargate
  • 13EKS Auto Mode
  • 14EKS + ECR
  • 15Why not build images directly inside Kubernetes?
  • 16Real deployment flow
  • 17Step 1
  • 18Step 2
  • 19Step 3
  • 20Step 4
  • 21Step 5
  • 22Step 6
  • 23AWS Load Balancer
  • 24Load Balancer types
  • 25Application Load Balancer — ALB
  • 26Network Load Balancer — NLB
  • 27AWS Load Balancer Controller
  • 28EKS networking is special
  • 29Security Groups
  • 30Security Groups vs NetworkPolicy
  • 31IAM
  • 32IAM vs Kubernetes RBAC
  • 33AWS IAM
  • 34Kubernetes RBAC
  • 35Pod identity
  • 36EKS Secrets
  • 37EKS + RDS
  • 38EKS + ElastiCache
  • 39Production architecture
  • 40HPA on EKS
  • 41Example
  • 42EKS doesn't automatically solve everything
  • 43Monitoring EKS
  • 44Logging EKS
  • 45EKS cost mental model
  • 46EKS cluster creation conceptually
  • 47Connecting kubectl to EKS
  • 48Important: kubectl doesn't become AWS-specific
  • 49EKS deployment example
  • 50The complete production flow
  • 51Most important EKS interview questions
  • 52Q1. What is EKS?
  • 53Q2. EKS vs Kubernetes?
  • 54Q3. EKS vs EC2?
  • 55Q4. What is ECR?
  • 56Q5. What is a managed node group?
  • 57Q6. What is AWS Load Balancer Controller?
  • 58Q7. IAM vs RBAC?
  • 59Q8. How does a Pod access S3 securely?
  • 60The key architecture to remember:
  • 61Next → Chapter 29: Kubernetes on GCP & Azure — GKE + AKS ☁️
In this chapter (61 sections)
01What is Amazon EKS?02Local Kubernetes vs EKS03What does AWS manage?04EKS architecture05EKS + VPC06Why multiple Availability Zones?07Worker Nodes08Managed Node Groups09EKS compute options10Managed node groups11Self-managed nodes12AWS Fargate13EKS Auto Mode14EKS + ECR15Why not build images directly inside Kubernetes?16Real deployment flow17Step 118Step 219Step 320Step 421Step 522Step 623AWS Load Balancer24Load Balancer types25Application Load Balancer — ALB26Network Load Balancer — NLB27AWS Load Balancer Controller28EKS networking is special29Security Groups30Security Groups vs NetworkPolicy31IAM32IAM vs Kubernetes RBAC33AWS IAM34Kubernetes RBAC35Pod identity36EKS Secrets37EKS + RDS38EKS + ElastiCache39Production architecture40HPA on EKS41Example42EKS doesn't automatically solve everything43Monitoring EKS44Logging EKS45EKS cost mental model46EKS cluster creation conceptually47Connecting kubectl to EKS48Important: kubectl doesn't become AWS-specific49EKS deployment example50The complete production flow51Most important EKS interview questions52Q1. What is EKS?53Q2. EKS vs Kubernetes?54Q3. EKS vs EC2?55Q4. What is ECR?56Q5. What is a managed node group?57Q6. What is AWS Load Balancer Controller?58Q7. IAM vs RBAC?59Q8. How does a Pod access S3 securely?60The key architecture to remember:61Next → Chapter 29: Kubernetes on GCP & Azure — GKE + AKS ☁️

You already know:

Docker → Image → Deployment → Pod → Service → Ingress

Now we'll see how the same concepts work on AWS EKS (Elastic Kubernetes Service).


1. What is Amazon EKS?#

Amazon Web Services EKS is AWS's managed Kubernetes service.

In simple words:

AWS runs the Kubernetes control plane for you, while you run/manage the workloads and worker capacity.

Instead of manually building:

Kubernetes API Server
etcd
Scheduler
Controller Manager

AWS manages the Kubernetes control-plane infrastructure for an EKS cluster.

Your responsibility is still to understand and operate:

Deployments
Pods
Services
Ingress
ConfigMaps
Secrets
RBAC
Networking
Scaling
Monitoring

2. Local Kubernetes vs EKS#

Previously:

Your PC
   ↓
Docker Desktop
   ↓
Kubernetes

With EKS:

AWS Cloud
   ↓
EKS Cluster
   ↓
Worker Capacity
   ↓
Pods

A simplified production architecture:

                    AWS
                     │
              ┌──────┴──────┐
              │             │
         EKS Control      VPC
           Plane            │
                            │
                    ┌───────┴───────┐
                    ↓               ↓
                 Node            Node
                  │                │
                Pods             Pods

3. What does AWS manage?#

A major EKS benefit is the managed Kubernetes control plane.

Conceptually:

AWS manages
────────────────────
API Server
etcd
Scheduler
Controller Manager
Control-plane availability
Control-plane infrastructure

You manage or configure:

────────────────────────
Worker nodes / node groups
Pods
Deployments
Services
Ingress
Applications
Resources
RBAC
Network policies
Application configuration

The exact responsibility boundary varies with the EKS compute model and AWS-managed features you're using.


4. EKS architecture#

A simplified architecture:

                    Internet
                       │
                       ↓
                AWS Load Balancer
                       │
                       ↓
                  EKS Cluster
                       │
             ┌─────────┴─────────┐
             │                   │
         Worker Node         Worker Node
             │                   │
        ┌────┴────┐         ┌────┴────┐
        ↓         ↓         ↓         ↓
       Pod       Pod       Pod       Pod

Behind this is AWS networking:

VPC
 │
 ├── Subnet A
 │    └── Node
 │
 ├── Subnet B
 │    └── Node
 │
 └── Subnet C
      └── Node

5. EKS + VPC#

One of the most important AWS concepts is:

EKS runs inside an AWS networking environment based on a VPC.

VPC = Virtual Private Cloud.

Think of it as your private AWS network.

Example:

VPC
│
├── Availability Zone A
│   ├── Public Subnet
│   └── Private Subnet
│
├── Availability Zone B
│   ├── Public Subnet
│   └── Private Subnet
│
└── Availability Zone C
    ├── Public Subnet
    └── Private Subnet

For production workloads, worker nodes are commonly placed in private subnets.


6. Why multiple Availability Zones?#

AWS regions contain multiple Availability Zones (AZs).

For example:

Region
│
├── AZ-A
│
├── AZ-B
│
└── AZ-C

If you run all your nodes in one AZ:

AZ-A
 ├── Node
 ├── Node
 └── Node

an AZ-level failure can affect the entire workload.

Instead:

AZ-A          AZ-B          AZ-C
 │             │             │
Node          Node          Node
 │             │             │
Pods          Pods          Pods

This improves fault tolerance.


7. Worker Nodes#

Your Pods need somewhere to run.

Traditionally, EKS worker capacity can be provided by EC2 instances.

Example:

EC2 Node 1
   │
   ├── Pod
   ├── Pod
   └── Pod
 
EC2 Node 2
   │
   ├── Pod
   └── Pod

EKS commonly uses managed node groups to simplify EC2 worker-node lifecycle management.


8. Managed Node Groups#

A managed node group is a group of EC2 instances that AWS helps manage as EKS worker capacity.

You specify things such as:

Instance type
Minimum nodes
Maximum nodes
Desired nodes
Subnets
AMI / node configuration

Example:

Node Group
 
min = 2
desired = 3
max = 6

Initially:

Node 1
Node 2
Node 3

If capacity needs to increase:

Node 1
Node 2
Node 3
Node 4
Node 5

9. EKS compute options#

You should know that EKS is not limited to one worker model.

Common options include:

Managed node groups#

AWS-managed EC2 worker nodes.

EKS
 ↓
Managed Node Group
 ↓
EC2
 ↓
Pods

Self-managed nodes#

You manage more of the node lifecycle yourself.

AWS Fargate#

Pods can run on serverless compute without you managing traditional worker nodes.

Conceptually:

EKS
 ↓
Fargate
 ↓
Pod

EKS Auto Mode#

AWS also provides a more automated operating model where AWS manages more of the compute infrastructure and scaling decisions.

For learning Kubernetes fundamentals, however, managed node groups are an excellent model to understand first.


10. EKS + ECR#

You need somewhere to store Docker images.

AWS provides:

Amazon ECR — Elastic Container Registry

Architecture:

Developer
    │
    ↓
docker build
    │
    ↓
Docker Image
    │
    ↓
ECR
    │
    ↓
EKS
    │
    ↓
Pod

For example:

ECR Repository
 
node-api
 ├── 1.0.0
 ├── 1.1.0
 └── 1.2.0

11. Why not build images directly inside Kubernetes?#

Normally you don't.

Your CI pipeline builds the image:

Git
 ↓
CI
 ↓
Docker Build
 ↓
ECR

Then Kubernetes pulls it:

EKS
 ↓
Pod
 ↓
ECR
 ↓
Docker/OCI image

The container runtime on the node downloads the image.


12. Real deployment flow#

Suppose you have:

Node.js API

You make a change.

Step 1#

git push

Step 2#

CI runs:

npm test

Step 3#

Docker:

docker build -t node-api:1.5.0 .

Step 4#

Push to ECR:

ECR
└── node-api:1.5.0

Step 5#

Update Kubernetes:

image: ECR_URL/node-api:1.5.0

Step 6#

EKS Deployment starts a rolling update.

v1.4
v1.4
v1.4
 
     ↓
 
v1.4
v1.4
v1.5
 
     ↓
 
v1.4
v1.5
v1.5
 
     ↓
 
v1.5
v1.5
v1.5

13. AWS Load Balancer#

Earlier you learned:

Internet
 ↓
Ingress
 ↓
Service
 ↓
Pods

In AWS, an Ingress/Service integration can provision or use AWS load-balancing infrastructure depending on the controller and configuration.

A common modern architecture uses the AWS Load Balancer Controller.

Conceptually:

Internet
   │
   ↓
AWS Load Balancer
   │
   ↓
Ingress
   │
   ↓
Service
   │
   ↓
Pods

14. Load Balancer types#

AWS commonly provides:

Application Load Balancer — ALB#

Layer 7.

Useful for:

HTTP
HTTPS
Host routing
Path routing

Example:

example.com
     ↓
ALB
     ↓
Ingress

Network Load Balancer — NLB#

Layer 4-oriented load balancing.

Useful for:

TCP
TLS
UDP
high-performance networking

The exact Kubernetes integration depends on the Service/Ingress/controller configuration.


15. AWS Load Balancer Controller#

This component watches Kubernetes resources and configures AWS load-balancing resources accordingly.

For example:

kind: Ingress

can lead to AWS infrastructure being configured.

Conceptually:

Kubernetes Ingress
        │
        ↓
AWS Load Balancer Controller
        │
        ↓
AWS ALB

This is an important bridge between:

Kubernetes API

and:

AWS infrastructure

16. EKS networking is special#

Remember Chapter 11?

Kubernetes needs networking between:

Pod → Pod
Pod → Service
Pod → Internet

AWS commonly uses the Amazon VPC CNI plugin for EKS networking.

This allows Pods to receive IP addresses associated with the VPC networking model.

Conceptually:

VPC
│
├── Node IP
│
├── Pod IP
├── Pod IP
└── Pod IP

This is different from simply imagining a completely isolated overlay network.


17. Security Groups#

AWS Security Groups operate at the AWS network level.

Think:

Security Group
      ↓
AWS network traffic

Whereas:

NetworkPolicy
      ↓
Kubernetes Pod network traffic

These are complementary.

For example:

Internet
   ↓
Security Group
   ↓
Load Balancer
   ↓
Kubernetes NetworkPolicy
   ↓
Pod

18. Security Groups vs NetworkPolicy#

Very important interview question.

Security Group NetworkPolicy
AWS networking Kubernetes networking
AWS resource/network interfaces Pods
AWS infrastructure level Kubernetes workload level
Controls allowed network traffic Controls Pod traffic
AWS-specific Kubernetes API abstraction

Don't think:

"NetworkPolicy replaces Security Groups."

It doesn't.

They operate at different layers.


19. IAM#

AWS IAM means:

Identity and Access Management.

It answers:

Who can access AWS resources?

For example:

Developer
   ↓
IAM
   ↓
Can access EKS?
Can access ECR?
Can access S3?

20. IAM vs Kubernetes RBAC#

Another very important interview topic.

AWS IAM#

Controls access to AWS resources.

IAM
 ↓
EKS
ECR
S3
EC2
RDS
Secrets Manager

Kubernetes RBAC#

Controls access to Kubernetes API resources.

RBAC
 ↓
Pods
Deployments
Services
Secrets
ConfigMaps

So:

AWS IAM
     +
Kubernetes RBAC

are often both involved.


21. Pod identity#

Your application may need AWS permissions.

Suppose:

Node.js Pod
     ↓
S3 bucket

You should not casually put AWS access keys inside:

ConfigMap
Secret
Dockerfile
source code

Modern EKS deployments can use AWS workload identity mechanisms, including EKS Pod Identity and IAM roles for service accounts (IRSA) depending on the setup.

Conceptually:

Pod
 ↓
Kubernetes ServiceAccount
 ↓
AWS identity mapping
 ↓
IAM Role
 ↓
S3

This is much safer than embedding long-lived credentials in the container.


22. EKS Secrets#

You might have:

DATABASE_PASSWORD
JWT_SECRET
OPENAI_API_KEY

Don't put these into:

Dockerfile

or:

Git repository

Instead, you can integrate Kubernetes Secrets with AWS secret-management systems.

A common production pattern:

AWS Secrets Manager
        ↓
External Secrets / secret integration
        ↓
Kubernetes Secret
        ↓
Pod

Or your application can access Secrets Manager using an appropriate IAM identity.


23. EKS + RDS#

Very common architecture:

                     Internet
                        │
                        ↓
                     ALB
                        │
                        ↓
                     Ingress
                        │
                        ↓
                   Node.js Pods
                     │     │
                     ↓     ↓
                  Redis    RDS

Notice:

PostgreSQL doesn't necessarily need to run inside Kubernetes.

You can use:

Amazon RDS PostgreSQL

for managed relational database infrastructure.

This removes much of the database operational burden from Kubernetes.


24. EKS + ElastiCache#

Similarly, Redis can be provided by:

Amazon ElastiCache

Architecture:

Node.js
   │
   ├── PostgreSQL → RDS
   │
   └── Redis → ElastiCache

This can be preferable to running production PostgreSQL/Redis directly inside your application cluster, depending on your operational requirements.


25. Production architecture#

A realistic AWS architecture could look like:

                         Internet
                            │
                            ↓
                      Route 53 / DNS
                            │
                            ↓
                       AWS ALB
                            │
                            ↓
                    EKS Ingress
                            │
                ┌───────────┴───────────┐
                ↓                       ↓
          Next.js Service          API Service
                ↓                       ↓
          Next.js Pods             Node.js Pods
                                        │
                              ┌─────────┼─────────┐
                              ↓         ↓         ↓
                           RDS       Redis     AWS APIs
                         Postgres   Cache      / S3

Infrastructure:

AWS Region
│
└── VPC
    │
    ├── Private Subnet
    │    ├── EKS Node
    │    └── EKS Node
    │
    ├── Private Subnet
    │    ├── EKS Node
    │    └── EKS Node
    │
    └── Public/edge networking
         └── Load Balancer

26. HPA on EKS#

You already learned HPA.

The architecture becomes:

Traffic ↑
   ↓
CPU ↑
   ↓
Metrics
   ↓
HPA
   ↓
Pods increase
   ↓
Node capacity insufficient
   ↓
Cluster/node autoscaling
   ↓
New node capacity

So:

HPA
 ↓
Pods

and:

Node autoscaling
 ↓
Nodes

These are different layers.


27. Example#

Suppose:

Node group:
 
min = 2
desired = 3
max = 10

And:

HPA:
 
minReplicas = 2
maxReplicas = 20

Traffic increases.

HPA wants:

2 Pods → 8 Pods

But existing nodes don't have enough capacity.

Some Pods become:

Pending

Node autoscaling can add nodes.

Then:

New nodes
   ↓
Scheduler
   ↓
Pending Pods
   ↓
Running

28. EKS doesn't automatically solve everything#

This is an important misconception.

Creating an EKS cluster doesn't automatically give you:

Perfect security
Perfect autoscaling
Monitoring
Logging
CI/CD
Backups
Disaster recovery
Cost optimization

You still need to design these.

EKS provides the Kubernetes managed control-plane foundation.


29. Monitoring EKS#

A production environment needs metrics.

You could use:

Prometheus
Grafana
CloudWatch
AWS Managed Prometheus

Architecture:

EKS
 │
 ├── Node metrics
 ├── Pod metrics
 ├── Application metrics
 └── Kubernetes metrics
        │
        ↓
   Prometheus
        │
        ↓
     Grafana

AWS also provides managed observability integrations.


30. Logging EKS#

A common architecture:

Pods
 │
 ↓
stdout/stderr
 │
 ↓
Log collector
 │
 ↓
CloudWatch / Loki / Elasticsearch

AWS environments often use CloudWatch-based logging, but other centralized logging systems are possible.


31. EKS cost mental model#

EKS isn't simply:

"One Kubernetes server = one price"

Your total cost can include:

EKS control-plane/service charges
+
EC2 or other compute
+
Load Balancers
+
EBS storage
+
NAT Gateway
+
Data transfer
+
RDS
+
ElastiCache
+
CloudWatch
+
Other AWS services

A surprisingly important production skill is understanding the networking bill.

For example:

NAT Gateway

can become a meaningful cost in some architectures.


32. EKS cluster creation conceptually#

There are several ways to create EKS.

For example:

AWS Console
AWS CLI
eksctl
Terraform
CloudFormation

For learning, eksctl is convenient because it abstracts a lot of infrastructure setup.

Conceptually:

eksctl create cluster ...

It can create/configure resources such as:

EKS cluster
VPC/networking
Node groups
IAM configuration

The exact command/options should be checked against the current EKS/eksctl documentation before running in a real AWS account because versions and defaults change.


33. Connecting kubectl to EKS#

After creating an EKS cluster, your local:

kubectl

needs credentials/configuration to communicate with the cluster.

Conceptually:

Your PC
 │
 └── kubectl
       │
       ↓
   AWS authentication
       │
       ↓
   EKS API Server

AWS CLI can update your kubeconfig for an EKS cluster.

Typical command:

aws eks update-kubeconfig \
  --region <region> \
  --name <cluster-name>

Then:

kubectl get nodes

34. Important: kubectl doesn't become AWS-specific#

This is a beautiful Kubernetes concept.

Locally:

kubectl get pods

EKS:

kubectl get pods

GKE:

kubectl get pods

AKS:

kubectl get pods

The Kubernetes API is standardized.

Cloud providers provide infrastructure around it.


35. EKS deployment example#

Suppose ECR contains:

123456789.dkr.ecr.ap-south-1.amazonaws.com/node-api:1.5.0

Deployment:

apiVersion: apps/v1
kind: Deployment
 
metadata:
  name: node-api
 
spec:
  replicas: 3
 
  selector:
    matchLabels:
      app: node-api
 
  template:
    metadata:
      labels:
        app: node-api
 
    spec:
      containers:
        - name: node-api
          image: 123456789.dkr.ecr.ap-south-1.amazonaws.com/node-api:1.5.0
 
          ports:
            - containerPort: 3000
 
          resources:
            requests:
              cpu: "250m"
              memory: "256Mi"
 
            limits:
              cpu: "500m"
              memory: "512Mi"
 
          readinessProbe:
            httpGet:
              path: /health
              port: 3000
 
            initialDelaySeconds: 5
            periodSeconds: 10

Apply:

kubectl apply -f deployment.yaml

Check:

kubectl get pods

36. The complete production flow#

Now connect everything you've learned:

                Developer
                    │
                    ↓
                  Git
                    │
                    ↓
                   CI
                    │
              ┌─────┴─────┐
              ↓           ↓
             Test       Build
                          │
                          ↓
                    Docker Image
                          │
                          ↓
                         ECR
                          │
                          ↓
                        EKS
                          │
                    Deployment
                          │
                    ReplicaSet
                          │
                 ┌────────┼────────┐
                 ↓        ↓        ↓
                Pod      Pod      Pod
                 │        │        │
                 └────────┼────────┘
                          ↓
                       Service
                          ↓
                       Ingress
                          ↓
                    AWS Load Balancer
                          ↓
                       Internet

That is the architecture you should now be able to explain in an interview.


37. Most important EKS interview questions#

Q1. What is EKS?#

Amazon EKS is AWS's managed Kubernetes service. AWS manages the Kubernetes control-plane infrastructure while users deploy and operate workloads on supported compute resources.


Q2. EKS vs Kubernetes?#

Kubernetes is the open-source orchestration platform.

EKS is AWS's managed service for running Kubernetes.

Kubernetes = technology
EKS = AWS managed offering

Q3. EKS vs EC2?#

They are different layers.

EKS
 ↓
Kubernetes management

while:

EC2
 ↓
Compute instances

EKS can use EC2-based worker capacity.


Q4. What is ECR?#

Amazon Elastic Container Registry.

It stores container images.

Docker image → ECR → EKS Pods

Q5. What is a managed node group?#

A group of EC2 worker nodes whose lifecycle is managed more directly by EKS/AWS.


Q6. What is AWS Load Balancer Controller?#

A Kubernetes controller that integrates Kubernetes resources with AWS load-balancing services.


Q7. IAM vs RBAC?#

IAM
 ↓
AWS permissions
 
RBAC
 ↓
Kubernetes API permissions

Q8. How does a Pod access S3 securely?#

Use an AWS workload identity mechanism such as EKS Pod Identity or IRSA, depending on your architecture, rather than embedding long-lived AWS access keys inside the Pod.


🧠 Chapter 28 Cheat Sheet#

EKS
 ↓
Managed Kubernetes on AWS
 
VPC
 ↓
AWS private networking
 
EC2
 ↓
Worker compute
 
Managed Node Group
 ↓
Group of EC2 worker nodes
 
ECR
 ↓
Container image registry
 
ALB/NLB
 ↓
AWS load balancing
 
IAM
 ↓
AWS permissions
 
RBAC
 ↓
Kubernetes permissions
 
RDS
 ↓
Managed PostgreSQL/MySQL
 
ElastiCache
 ↓
Managed Redis/Memcached
 
HPA
 ↓
Pod scaling
 
Node autoscaling
 ↓
Node capacity scaling

The key architecture to remember:#

                  AWS
                   │
              ┌────┴────┐
              │   EKS   │
              └────┬────┘
                   │
            ┌──────┴──────┐
            ↓             ↓
        Node Group     Node Group
            │             │
          Pods           Pods
            │
            ↓
         Service
            │
            ↓
         Ingress
            │
            ↓
      AWS Load Balancer
            │
            ↓
        Internet

And the production application stack:

Next.js
   ↓
Node.js
   ↓
Redis / RDS
   ↓
S3 / AWS Services

all running around an EKS-based platform.


Next → Chapter 29: Kubernetes on GCP & Azure — GKE + AKS ☁️#

We'll compare:

AWS EKS
GCP GKE
Azure AKS

and learn:

  • EKS vs GKE vs AKS
  • Control-plane management
  • Worker nodes
  • Networking
  • Load Balancers
  • Container registries
  • IAM / Workload Identity
  • Autoscaling
  • Cloud-specific Kubernetes differences
  • How to deploy the same Kubernetes YAML across AWS, GCP and Azure
  • Which parts of Kubernetes stay the same and which parts change.

Finished this chapter?

Mark it as complete to track your mastery.

Previous ChapterChapter 27 — Local Kubernetes 🖥️Next ChapterChapter 29 — Kubernetes on GCP & Azure ☁️
PrevNext