🚀 Amazon EKS (Elastic Kubernetes Service) – Managed Kubernetes for Modern Applications

Kubernetes has become the de facto standard for managing containerized applications. It automates deployment, scaling, and management of containers. However, managing Kubernetes clusters manually is complex—you need to handle control plane setup, upgrades, scaling, and high availability.

👉 This is where Amazon EKS (Elastic Kubernetes Service) comes in.

Amazon EKS is a fully managed Kubernetes service on AWS. With EKS, you can run Kubernetes without the heavy lifting of installing and operating your own clusters. AWS manages the control plane, while you focus on applications.


🔑 What is Amazon EKS?

Amazon Elastic Kubernetes Service (EKS) is a managed service that makes it easy to run Kubernetes clusters on AWS and on-premises.

  • Fully compatible with open-source Kubernetes.
  • AWS manages the control plane (masters, etcd, API server).
  • You manage worker nodes (EC2) or use AWS Fargate for serverless nodes.
  • Integrates with AWS services like IAM, CloudWatch, VPC, Load Balancers, and ECR.

⚙️ Core Components of EKS

  1. Cluster → A managed Kubernetes control plane + worker nodes.
  2. Node Groups → EC2 instances or Fargate profiles that run pods.
  3. Pods → Smallest deployable unit in Kubernetes.
  4. Deployments → Define how applications are deployed and scaled.
  5. Services → Expose pods internally or externally.
  6. Ingress → Routes external traffic into services.

📌 Example 1: Creating an EKS Cluster

Python (boto3) Example

import boto3
eks = boto3.client('eks')
response = eks.create_cluster(
name='my-eks-cluster',
roleArn='arn:aws:iam::123456789012:role/EKS-ClusterRole',
resourcesVpcConfig={
'subnetIds': ['subnet-abc123', 'subnet-def456'],
'endpointPublicAccess': True
}
)
print("EKS Cluster Creating:", response['cluster']['name'])

AWS CLI Example

Terminal window
aws eks create-cluster \
--name my-eks-cluster \
--role-arn arn:aws:iam::123456789012:role/EKS-ClusterRole \
--resources-vpc-config subnetIds=subnet-abc123,subnet-def456,endpointPublicAccess=true

Node.js Example

const AWS = require('aws-sdk');
const eks = new AWS.EKS();
eks.createCluster({
name: 'my-eks-cluster',
roleArn: 'arn:aws:iam::123456789012:role/EKS-ClusterRole',
resourcesVpcConfig: {
subnetIds: ['subnet-abc123', 'subnet-def456'],
endpointPublicAccess: true
}
}, (err, data) => {
if (err) console.error(err);
else console.log("Cluster Creating:", data.cluster.name);
});

👉 This spins up an EKS control plane inside your VPC.


📌 Example 2: Creating a Node Group

Python Example

response = eks.create_nodegroup(
clusterName='my-eks-cluster',
nodegroupName='my-node-group',
scalingConfig={'minSize': 1, 'maxSize': 3, 'desiredSize': 2},
subnets=['subnet-abc123'],
instanceTypes=['t3.medium'],
amiType='AL2_x86_64',
nodeRole='arn:aws:iam::123456789012:role/EKS-NodeRole'
)
print("Node Group Created:", response['nodegroup']['nodegroupName'])

AWS CLI Example

Terminal window
aws eks create-nodegroup \
--cluster-name my-eks-cluster \
--nodegroup-name my-node-group \
--scaling-config minSize=1,maxSize=3,desiredSize=2 \
--subnets subnet-abc123 \
--instance-types t3.medium \
--ami-type AL2_x86_64 \
--node-role arn:aws:iam::123456789012:role/EKS-NodeRole

Node.js Example

eks.createNodegroup({
clusterName: 'my-eks-cluster',
nodegroupName: 'my-node-group',
scalingConfig: { minSize: 1, maxSize: 3, desiredSize: 2 },
subnets: ['subnet-abc123'],
instanceTypes: ['t3.medium'],
amiType: 'AL2_x86_64',
nodeRole: 'arn:aws:iam::123456789012:role/EKS-NodeRole'
}, (err, data) => {
if (err) console.error(err);
else console.log("Node Group Created:", data.nodegroup.nodegroupName);
});

👉 This attaches worker nodes to your EKS cluster.


📌 Example 3: Deploying an Application on EKS

After cluster + nodes are ready, use kubectl:

Kubernetes Manifest (nginx.yaml)

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80

Apply the Manifest

Terminal window
kubectl apply -f nginx.yaml

👉 This deploys 2 Nginx pods inside the EKS cluster.


📌 Example 4: Exposing the Application with a Service

Kubernetes Service Manifest

apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
type: LoadBalancer
selector:
app: nginx
ports:
- port: 80
targetPort: 80

Apply It

Terminal window
kubectl apply -f nginx-service.yaml

👉 This provisions an AWS ELB automatically to expose your application.


🧠 How to Remember EKS for Exam & Interview

💡 Trick: E-K-S = Elastic Kubernetes Service

  • E → Elastic (Scales automatically)
  • K → Kubernetes (Industry-standard orchestration)
  • S → Service (Managed by AWS)

👉 Memory Hook: “EKS = AWS-managed Kubernetes, plug and play.”

Common AWS Exam Questions:

  1. Difference between ECS vs EKS.
  2. EKS launch types (EC2 nodes vs Fargate).
  3. How EKS integrates with IAM, ALB, and CloudWatch.

🎯 Why EKS is Important

  1. Standardization → Kubernetes is industry standard; EKS gives AWS-native experience.
  2. Integration → Works seamlessly with IAM, VPC, CloudWatch, ECR.
  3. Flexibility → Choose between EC2 nodes or Fargate.
  4. Scalability → Run thousands of pods automatically.
  5. Security → Fine-grained IAM for service accounts.

🌍 Real-World Use Cases

  • Microservices at Scale → Orchestrating hundreds of services.
  • Hybrid Cloud → Deploy across AWS and on-prem with EKS Anywhere.
  • Data Processing Pipelines → Use Kubernetes jobs and CronJobs.
  • Machine Learning → Train and serve ML models in pods.
  • Gaming → Handle multiplayer game servers with scaling.

📌 Conclusion

Amazon EKS provides the best of both worlds:

  • You get the power of Kubernetes,
  • Without the pain of managing control planes.

👉 For interviews and exams:

  • Remember EKS = Elastic Kubernetes Service.
  • AWS manages the control plane, you manage applications.
  • Know how EKS integrates with IAM, ALB, and Fargate.

Whether you’re building microservices, ML pipelines, or web apps, EKS offers scalability, security, and simplicity.