Skip to main content
Nauman Munir
Back to Projects
PortfolioE-commerceInfrastructure as CodeCloud Cost & Performance Optimization

Kubernetes-Based Microservices Delivery on AWS EKS

AMJ Cloud Technologies deployed User Management and Notification microservices on AWS EKS for CloudTrend Systems, integrating AWS RDS, SES, ALB Ingress, and External DNS for a scalable e-commerce platform.

7 min read
1 month

Technologies

AWS EKSAWS RDSAWS Simple Email Service (SES)AWS Load Balancer ControllerKubernetes IngressExternal DNSAWS Route 53AWS Certificate ManagerDocker

Kubernetes-Based Microservices Delivery on AWS EKS for CloudTrend Systems

AMJ Cloud Technologies implemented a microservices architecture on Amazon Elastic Kubernetes Service (EKS) for CloudTrend Systems, an e-commerce company, to deploy User Management and Notification microservices. The solution automated user account creation with email notifications, leveraging AWS RDS for database storage, AWS Simple Email Service (SES) for email delivery, AWS Load Balancer Controller for ALB Ingress, and External DNS for Route 53 DNS registration. The microservices were accessible at services.cloudtrendsystems.com and ums.cloudtrendsystems.com, ensuring a scalable and secure e-commerce platform.

What are Microservices?

Microservices are an architectural approach where applications are composed of small, independent services that communicate over APIs. Each service focuses on a specific business function, enabling scalability, flexibility, and independent deployment. For CloudTrend Systems, we deployed:

  • User Management Service: Handles user account creation and listing, integrated with an AWS RDS MySQL database.
  • Notification Service: Sends email notifications via AWS SES when users are created, triggered by the User Management Service.

Project Overview

CloudTrend Systems required a robust microservices deployment on EKS to support their e-commerce platform. AMJ deployed two microservices:

  • User Management Service: Creates users and integrates with the Notification Service to send confirmation emails.
  • Notification Service: Sends emails using AWS SES, accessible via a ClusterIP service.

The solution used AWS RDS for persistent storage, ALB Ingress for external access, External DNS for Route 53 integration, and SES for email notifications, replacing manual processes with an automated, scalable workflow.

Technical Implementation

Step 01: Prerequisites - AWS RDS, ALB Ingress Controller, and External DNS

  • AWS RDS Database:
    • Used an existing MySQL RDS instance (usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com) created for CloudTrend’s e-commerce platform.
    • Configured an ExternalName service to point to the RDS instance.
  • ALB Ingress Controller:
    • Installed AWS Load Balancer Controller (v2.8.1) on the EKS cluster (ecommerce-cluster, version 1.31):
      helm install load-balancer-controller eks/aws-load-balancer-controller -n kube-system --set clusterName=ecommerce-cluster --set image.tag=v2.8.1
  • External DNS:
    • Installed External DNS to register DNS records in Route 53:
      helm install external-dns external-dns/external-dns -n kube-system --set provider=aws --set aws.region=us-east-1
  • Verification:
    • Checked ALB Ingress Controller and External DNS pods:
      kubectl get pods -n kube-system
      kubectl get pods

Step 02: Create SES SMTP Credentials

  • Created SES SMTP credentials for the Notification Service:
    • Navigated to AWS SES → SMTP Settings → Create My SMTP Credentials.
    • Named IAM user cloudtrend-microservice-ses.
    • Downloaded credentials and updated environment variables in NotificationMicroservice-Deployment.yml:
      - name: AWS_MAIL_SERVER_HOST
        value: "smtp-service"
      - name: AWS_MAIL_SERVER_USERNAME
        value: "<SES-USERNAME>"
      - name: AWS_MAIL_SERVER_PASSWORD
        value: "<SES-PASSWORD>"
      - name: AWS_MAIL_SERVER_FROM_ADDRESS
        value: "<from-email>"
  • Verified email addresses in SES:
    • From Address: <from-email>.
    • To Address: <to-email>.
    • Sent verification requests and confirmed via email links.

Step 03: Create Notification Microservice SMTP ExternalName Service

  • Manifest (NotificationMicroservice-SMTP-externalName-Service.yml):
    apiVersion: v1
    kind: Service
    metadata:
      name: smtp-service
    spec:
      type: ExternalName
      externalName: email-smtp.us-east-1.amazonaws.com

Step 04: Create Notification Microservice Deployment

  • Manifest (NotificationMicroservice-Deployment.yml):
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: notification-microservice
      labels:
        app: notification-restapp
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: notification-restapp
      template:
        metadata:
          labels:
            app: notification-restapp
        spec:
          containers:
            - name: notification-service
              image: stacksimplify/kube-notifications-microservice:1.0.0
              ports:
                - containerPort: 8096
              imagePullPolicy: Always
              env:
                - name: AWS_MAIL_SERVER_HOST
                  value: "smtp-service"
                - name: AWS_MAIL_SERVER_USERNAME
                  value: "<SES-USERNAME>"
                - name: AWS_MAIL_SERVER_PASSWORD
                  value: "<SES-PASSWORD>"
                - name: AWS_MAIL_SERVER_FROM_ADDRESS
                  value: "<from-email>"

Step 05: Create Notification Microservice ClusterIP Service

  • Manifest (NotificationMicroservice-NodePort-Service.yml):
    apiVersion: v1
    kind: Service
    metadata:
      name: notification-clusterip-service
      labels:
        app: notification-restapp
    spec:
      type: ClusterIP
      selector:
        app: notification-restapp
      ports:
        - port: 8096
          targetPort: 8096

Step 06: Create MySQL ExternalName Service

  • Manifest (MySQL-externalName-Service.yml):
    apiVersion: v1
    kind: Service
    metadata:
      name: mysql
    spec:
      type: ExternalName
      externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com

Step 07: Create User Management Microservice Deployment

  • Manifest (UserManagementMicroservice-Deployment.yml):
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: usermgmt-microservice
      labels:
        app: usermgmt-restapp
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: usermgmt-restapp
      template:
        metadata:
          labels:
            app: usermgmt-restapp
        spec:
          initContainers:
            - name: init-db
              image: busybox:1.31
              command:
                [
                  "sh",
                  "-c",
                  'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e "  >> MySQL DB Server has started";',
                ]
          containers:
            - name: usermgmt-restapp
              image: stacksimplify/kube-usermanagement-microservice:1.0.0
              ports:
                - containerPort: 8095
              env:
                - name: DB_HOSTNAME
                  value: "mysql"
                - name: DB_PORT
                  value: "3306"
                - name: DB_NAME
                  value: "usermgmt"
                - name: DB_USERNAME
                  value: "dbadmin"
                - name: DB_PASSWORD
                  valueFrom:
                    secretKeyRef:
                      name: mysql-db-password
                      key: db-password
                - name: NOTIFICATION_SERVICE_HOST
                  value: "notification-clusterip-service"
                - name: NOTIFICATION_SERVICE_PORT
                  value: "8096"
              livenessProbe:
                exec:
                  command:
                    - /bin/sh
                    - -c
                    - nc -z localhost 8095
                initialDelaySeconds: 60
                periodSeconds: 10
              readinessProbe:
                httpGet:
                  path: /usermgmt/health-status
                  port: 8095
                initialDelaySeconds: 60
                periodSeconds: 10
    ---
    apiVersion: v1
    kind: Secret
    metadata:
      name: mysql-db-password
    type: Opaque
    data:
      db-password: ZGJwYXNzd29yZDEx

Step 08: Create User Management NodePort Service

  • Manifest (UserManagement-NodePort-Service.yml):
    apiVersion: v1
    kind: Service
    metadata:
      name: usermgmt-restapp-nodeport-service
      labels:
        app: usermgmt-restapp
      annotations:
        alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status
    spec:
      type: NodePort
      selector:
        app: usermgmt-restapp
      ports:
        - port: 8095
          targetPort: 8095

Step 09: Create ALB Ingress Service

  • Manifest (ALB-Ingress-SSL-Redirect-ExternalDNS.yml):
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: eks-microservices-demo
      labels:
        app: usermgmt-restapp
        runon: fargate
      namespace: ns-ums
      annotations:
        alb.ingress.kubernetes.io/load-balancer-name: eks-microservices-demo
        alb.ingress.kubernetes.io/scheme: internet-facing
        alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
        alb.ingress.kubernetes.io/healthcheck-port: traffic-port
        alb.ingress.kubernetes.io/healthcheck-interval-seconds: "15"
        alb.ingress.kubernetes.io/healthcheck-timeout-seconds: "5"
        alb.ingress.kubernetes.io/success-codes: "200"
        alb.ingress.kubernetes.io/healthy-threshold-count: "2"
        alb.ingress.kubernetes.io/unhealthy-threshold-count: "2"
        alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}, {"HTTP":80}]'
        alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:<account-id>:certificate/<certificate-id>
        alb.ingress.kubernetes.io/ssl-redirect: "443"
        external-dns.alpha.kubernetes.io/hostname: services.cloudtrendsystems.com,ums.cloudtrendsystems.com
    spec:
      ingressClassName: my-aws-ingress-class
      rules:
        - http:
            paths:
              - path: /
                pathType: Prefix
                backend:
                  service:
                    name: usermgmt-restapp-nodeport-service
                    port:
                      number: 8095

Step 10: Deploy Microservices Manifests

  • Deployed all manifests:
    kubectl apply -f Microservices/

Step 11: Verify Deployment

  • Checked pods:
    kubectl get pods
  • Viewed logs:
    • User Management Service:
      kubectl logs -f $(kubectl get po | egrep -o 'usermgmt-microservice-[A-Za-z0-9-]+')
    • Notification Service:
      kubectl logs -f $(kubectl get po | egrep -o 'notification-microservice-[A-Za-z0-9-]+')
    • External DNS:
      kubectl logs -f $(kubectl get po | egrep -o 'external-dns-[A-Za-z0-9-]+')
  • Verified Ingress:
    kubectl get ingress

Step 12: Verify Microservices Health Status

  • Tested health endpoints via browser:
    • User Management Service:
      https://services.cloudtrendsystems.com/usermgmt/health-status
    • Notification Service (via User Management):
      https://services.cloudtrendsystems.com/usermgmt/notification-health-status
      https://services.cloudtrendsystems.com/usermgmt/notification-service-info

Step 13: Test Microservices with Postman

  • Imported Postman project and set environment URL:
    https://services.cloudtrendsystems.com
  • Tested User Management Service:
    • Create User: Verified email notification received at <to-email>.
    • List User: Confirmed newly created user appeared in the list.

Step 14: Rollout New Deployment - Set Image Option

  • Updated Notification Service to version 2.0.0:
    kubectl set image deployment/notification-microservice notification-service=stacksimplify/kube-notifications-microservice:2.0.0 --record=true
  • Verified rollout:
    kubectl rollout status deployment/notification-microservice
    kubectl get rs
    kubectl rollout history deployment/notification-microservice
  • Tested updated application:
    https://services.cloudtrendsystems.com/usermgmt/notification-health-status
  • Rolled back to version 1.0.0:
    kubectl rollout undo deployment/notification-microservice
  • Re-tested:
    https://services.cloudtrendsystems.com/usermgmt/notification-health-status

Step 15: Rollout New Deployment - kubectl Edit

  • Edited Notification Service deployment to version 2.0.0:
    kubectl edit deployment/notification-microservice
  • Verified rollout:
    kubectl rollout status deployment/notification-microservice
    kubectl get rs
    kubectl rollout history deployment/notification-microservice
  • Tested updated application:
    https://services.cloudtrendsystems.com/usermgmt/notification-health-status
  • Rolled back to version 1.0.0:
    kubectl rollout undo deployment/notification-microservice
  • Re-tested:
    https://services.cloudtrendsystems.com/usermgmt/notification-health-status

Step 16: Rollout New Deployment - Update Manifest & kubectl Apply

  • Updated NotificationMicroservice-Deployment.yml to use stacksimplify/kube-notifications-microservice:2.0.0.
  • Applied updated manifest:
    kubectl apply -f Microservices/
  • Verified rollout:
    kubectl rollout status deployment/notification-microservice
    kubectl get rs
    kubectl rollout history deployment/notification-microservice
  • Tested updated application:
    https://services.cloudtrendsystems.com/usermgmt/notification-health-status

Technical Highlights

  • Microservices Architecture: Deployed independent User Management and Notification Services, communicating via APIs.
  • AWS RDS Integration: Used ExternalName service to connect to MySQL RDS for persistent storage.
  • SES for Notifications: Configured SES SMTP for reliable email delivery.
  • ALB Ingress: Enabled secure HTTPS access with SSL redirect and Route 53 DNS registration.
  • Deployment Flexibility: Demonstrated multiple rollout strategies (set image, edit, apply manifest) with rollback capabilities.

Client Impact

For CloudTrend Systems, this microservices deployment reduced operational overhead, improved scalability, and ensured reliable user notifications. The EKS-based solution supported their e-commerce platform’s growth, with secure access via HTTPS and automated DNS management.

Technologies Used

  • AWS EKS
  • AWS RDS
  • AWS Simple Email Service (SES)
  • AWS Load Balancer Controller
  • Kubernetes Ingress
  • External DNS
  • AWS Route 53
  • AWS Certificate Manager
  • Docker

Need a Similar Solution?

I can help you design and implement similar cloud infrastructure and DevOps solutions for your organization.