Microservices deployment in EKS

Microservices deployment in EKS

?? 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:

  • The Orders service listens on port 3003
  • The Products service listens on port 3004
  • Below are the application endpoints in local:


?? 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:

  • Created Amazon ECR repositories for Orders & Products
  • Pushed the images to their respective repositories
  • Push commands:

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:

  • I created Kubernetes Deployments for both microservices
  • Configured LoadBalancer services to expose them externally




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

Saran Kamandula

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

Nidhi Kapoor

Software developer at Infibeam Avenues

1 个月

Thankyou for the sharing your knowledge !

回复
Anant Wakchoure

Senior AWS Cloud Architect at Capgemini

1 个月

Interesting

Sham Gulajkar

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

Surajit Dasgupta

Industry Cloud Competency Head - Digital Engineering Service @ Tech Mahindra across Manufacturing, Automotive, HLS & MedTech and BFSI | Large Deal Pursuit Team

1 个月

Very informative

要查看或添加评论,请登录

Amit Kumar的更多文章

  • ?? Deploying Microservices in AWS EKS using Ingress resource

    ?? Deploying Microservices in AWS EKS using Ingress resource

    In my previous article, I demonstrated how to deploy separate Load Balancer services for each microservice in AWS EKS…

    1 条评论
  • What is Disaster in terms of cloud computing?

    What is Disaster in terms of cloud computing?

    A disaster refers to any unexpected event or situation that disrupts the normal operations of cloud-based systems…

    4 条评论
  • Monolith to microservice

    Monolith to microservice

    Let’s discuss the difference between monolith and microservice first, 1. Architecture: In Monolith arch, application is…

    6 条评论
  • AWS Well-Architected Framework

    AWS Well-Architected Framework

    AWS Well-Architected Framework Overview The AWS Well-Architected Framework is a set of best practices designed to help…

    2 条评论
  • ALL ABOUT AWS LAMBDA SERVICE

    ALL ABOUT AWS LAMBDA SERVICE

    AWS Lambda Overview AWS Lambda is a serverless compute service provided by Amazon Web Services (AWS). It allows to run…

    7 条评论
  • Taco Bell's Event-Driven Architecture with AWS Serverless Services

    Taco Bell's Event-Driven Architecture with AWS Serverless Services

    Taco Bell serves over 42 million customers weekly across 7,000+ restaurants. To streamline and optimize their order…

    3 条评论
  • AWS Elastic Container Service (ECS)

    AWS Elastic Container Service (ECS)

    Overview of ECS AWS Elastic Container Service (ECS) is a scalable container management service that allows you to…

  • Building a Secure and Scalable API Architecture for Enterprise Applications

    Building a Secure and Scalable API Architecture for Enterprise Applications

    In this article, I am trying to explain a secure, scalable, and resilient API architecture which I implemented for my…

    2 条评论
  • Common Amazon API Gateway Patterns for microservice architecture:

    Common Amazon API Gateway Patterns for microservice architecture:

    API Gateway: API Gateway is a fully managed service that allows to create RESTful and WebSocket APIs at any scale. API…

  • EC2 Cost Optimization

    EC2 Cost Optimization

    Let’s focus on smart savings, not just cutting costs indiscriminately. Remember, not all savings are truly beneficial.

    6 条评论

社区洞察

其他会员也浏览了