How to Use AWS Elastic Kubernetes Service (EKS) for Containerized Applications

π Software Geek | DevOps Engineer π οΈ Hi, I'm Sahil Patil, a passionate DevOps wizard dedicated to transforming code into cash by building scalable, high-performing, and reliable systems. With a knack for solving complex problems, I thrive on turning chaos into cloud-based efficiency through the seamless integration of DevOps practices and cloud solutions.My toolkit includes Kubernetes π³, Docker π, and Terraform βοΈ, which I use to design robust, secure, and efficient infrastructure. Linux π§ is my playground, where I excel in troubleshooting and optimizing environments. AWS βοΈ serves as my canvas for crafting innovative cloud architectures.π Achievements: π Awarded with Prime Minister Scholarship with All India Rank 2032.πΌ Selected for an internship at LRDE DRDO, Bengaluru.π Received Gaurav Puraskar from Defence Welfare, India.π Received KSB Scholarships from Kendriya Sainik Board, New Delhi.π± What Drives Me: I'm committed to continuous learning and staying ahead in the ever-evolving tech landscape. I actively participate in DevOps and cloud community meetups π€ to network with industry experts and exchange insights, helping me refine my skills and broaden my perspective.Letβs connect and collaborate to build something remarkable! π
How to Use AWS Elastic Kubernetes Service (EKS) for Containerized Applications π
AWS Elastic Kubernetes Service (EKS) is a managed Kubernetes service that makes it easy to run containerized applications on AWS. It eliminates the complexity of managing Kubernetes clusters while ensuring high availability, scalability, and security. In this guide, weβll cover how to deploy a containerized application on EKS step by step.
What is AWS EKS? π€
AWS EKS is a managed Kubernetes service that allows you to run, scale, and operate Kubernetes applications without needing to maintain control planes or worker nodes manually. It integrates seamlessly with AWS services like IAM, VPC, and CloudWatch for security, networking, and monitoring.
Why Use AWS EKS?
β
Fully managed - No need to set up or manage the Kubernetes control plane.
β
Highly available - EKS runs across multiple AWS Availability Zones (AZs).
β
Scalability - Easily scale your cluster and applications.
β
Security - Integrates with AWS IAM, VPC, and KMS for security.
β
Built-in Monitoring - Works with AWS CloudWatch and Prometheus for monitoring.
Step 1: Prerequisites π οΈ
Before deploying applications on EKS, ensure you have:
πΉ An AWS account with required permissions.
πΉ AWS CLI installed and configured.
πΉ kubectl installed (Kubernetes command-line tool).
πΉ eksctl installed (EKS cluster management tool).
πΉ Docker installed for containerizing applications.
π To install these tools, follow the official AWS documentation:
AWS CLI
kubectl
eksctl
Step 2: Create an EKS Cluster ποΈ
We will use eksctl to create an EKS cluster. Run the following command:
eksctl create cluster \
--name my-cluster \
--region us-east-1 \
--nodegroup-name my-nodegroup \
--node-type t3.medium \
--nodes 2
π Explanation:
--name my-cluster: Names the cluster.--region us-east-1: Specifies the AWS region.--nodegroup-name my-nodegroup: Names the worker node group.--node-type t3.medium: Selects instance type for worker nodes.--nodes 2: Creates 2 worker nodes.
This process takes 10-15 minutes to complete. You can verify your cluster using:
kubectl get nodes
Step 3: Deploy a Containerized Application π³
Let's deploy a simple Nginx web server on EKS.
1οΈβ£ Create a Deployment YAML file:
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
2οΈβ£ Apply the deployment:
kubectl apply -f nginx-deployment.yaml
3οΈβ£ Check if the pods are running:
kubectl get pods
You should see 2 running pods.
Step 4: Expose the Application π
To make the Nginx service accessible, we create a LoadBalancer service:
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer
Apply the service:
kubectl apply -f nginx-service.yaml
Check the service status:
kubectl get svc nginx-service
Once the EXTERNAL-IP is available, open it in your browser to see the running Nginx web server! π
Step 5: Scale the Application π
Need more replicas? Scale your deployment with:
kubectl scale deployment nginx-deployment --replicas=5
Verify the new pods:
kubectl get pods
Step 6: Monitor the Cluster π
Using kubectl:
Check pod logs:
kubectl logs <pod-name>
Check pod status:
kubectl describe pod <pod-name>
Using AWS CloudWatch:
EKS integrates with CloudWatch for centralized logging. Enable logging using:
aws eks update-cluster-config \
--name my-cluster \
--logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}'
Step 7: Cleanup Resources ποΈ
When done, delete the cluster to avoid extra costs:
eksctl delete cluster --name my-cluster
Final Thoughts π‘
AWS EKS simplifies Kubernetes management, making it easy to deploy, scale, and monitor applications. By following this guide, you have:
β
Created an EKS cluster.
β
Deployed a containerized Nginx application.
β
Exposed it using a LoadBalancer.
β
Scaled the application.
β
Monitored the cluster.






