Microservices deployment in EKS
Amit Kumar
AWS Solution Architect | 3X AWS | Terraform | Kubernetes | EKS | DXC Diamond Award Winner
?? Deploying Orders & Products Microservices in AWS EKS:
Let’s do a hands-on deployment of Orders & Products microservices in AWS EKS, and I’d love to share the key steps of this deployments! This was a great exercise in containerization, orchestration, and leveraging AWS-managed services. Here’s how I made it happen:
?? 1. Application Overview
It's an simple Orders & Products application using Node.js, where:
?? 2. Containerizing the Microservices:
Using a Dockerfile, I containerized both services and created Docker images. Below are the Orders & products Docker file which is being used to create a orders image in ECR.
Orders docker file:
Products Docker File:
Let’s build the image using the below commands in CLI:
docker build -t orders:latest .
docker build -t products:latest .
?? 3. Storing Images in AWS ECR
To prepare for deployment in EKS, I:
Retrieve an authentication token and authenticate your Docker client to your registry. Use the AWS CLI:
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <AWS Account ID>.dkr.ecr.us-east-1.amazonaws.com
Tag your image so you can push the image to this repository:
docker tag products:latest <AWS Account ID>.dkr.ecr.us-east-1.amazonaws.com/products:latest
Run the below command to push this image to your newly created AWS repository:
docker push <AWS Account ID>.dkr.ecr.us-east-1.amazonaws.com/products:latest
?? 4. Setting Up the EKS Cluster:
Using eksctl, I spun up an EKS cluster with managed nodes using below command:
eksctl create cluster --name ecommerce-cluster?? --region us-east-1?? --version 1.29?? --nodegroup-name ecommerce-nodes?? --node-type t3.large?? --nodes 2?? --nodes-min 2?? --nodes-max 5?? --managed
领英推荐
?? 5. Creating Kubernetes Namespace:
To organize my microservices, I created a dedicated namespace:
?? 6. Deploying Microservices with Kubernetes Manifests:
Since it’s a load balancer service hence it provisioned the elastic load balancer behind the scenes to route the external traffic to orders & product microservice running in EKS pods.
Let’s deploy a pods using Orders & Products manifest file:
?? 7. Validating the Deployment:
Finally, I tested the services using the Load Balancer DNS URL, and everything worked smoothly!
?My orders microservice has two endpoints & product has one endpoint and It’s successfully generated the response using load balancer urls.
It concludes the deployment of orders & product microservices in EKS.
Key Takeaways:
? Seamless deployment of microservices in EKS.
? Scalability & flexibility with AWS-managed Kubernetes.
? Microservices architecture for independent scaling & management.
I hope this will be an insightful hands-on experience, reinforcing best practices in containerization, deployment automation, and cloud-native microservices.
In next article, I will show you how you can use a ingress controller and resource to use only one load balancer for all traffic routing to different pods.
#AWS #EKS #Microservices #Kubernetes #DevOps #CloudComputing #Docker #ECR #CloudNative
Actively Looking For Contract Cloud DevOps/SRE Engineer ?? roles| AWS Certified Solutions Architect | Aws Certified SysOps Administrator | 3x Aws | 2x Azure | Kubernetes | Azure DevOps | Docker | Jenkins | IAC | Ansible|
1 个月Very helpful
Software developer at Infibeam Avenues
1 个月Thankyou for the sharing your knowledge !
Senior AWS Cloud Architect at Capgemini
1 个月Interesting
Immediate joiner, DevOps Engineer experience in implementing and automating CI/CD pipelines using Jenkins. Proficient in AWS cloud, infrastructure management, containerization technologies (Docker, Kubernetes)
1 个月Very helpful
Industry Cloud Competency Head - Digital Engineering Service @ Tech Mahindra across Manufacturing, Automotive, HLS & MedTech and BFSI | Large Deal Pursuit Team
1 个月Very informative