Deploying MySQL and Microservice on AWS EKS with EBS for HealthSync

AMJ Cloud Technologies deployed a MySQL database and user management microservice with persistent Amazon EBS storage in an AWS EKS cluster for HealthSync Innovations, a healthcare startup, ensuring secure, scalable, and automated storage for their patient data management platform using the EBS CSI Driver and Kubernetes.

July 8, 2025
Scroll to explore

MySQL and User Management Microservice on AWS EKS with Amazon

AMJ Cloud Technologies delivered a secure, scalable MySQL database and user management microservice with persistent Amazon Elastic Block Store (EBS) storage in an Amazon Elastic Kubernetes Service (EKS) cluster for HealthSync Innovations, a healthcare startup. By leveraging the EBS CSI Driver, Kubernetes Storage Classes, Persistent Volume Claims (PVCs), and a microservices architecture, we provided an automated, compliant, and reliable solution for their patient data management platform, addressing challenges with manual storage setups, data persistence, and microservice integration.

Situation

HealthSync Innovations, a healthcare startup focused on patient data management, required a robust MySQL database and a user management microservice to handle authentication and profile data for their cloud-based platform. Their legacy systems relied on manual configurations, risking data loss, scalability limitations, and non-compliance with healthcare data security standards. AMJ Cloud Technologies was engaged to deploy a cloud-native solution on AWS EKS, integrating a MySQL database with persistent EBS storage and a user management microservice to ensure seamless operation and regulatory compliance.

Task

The objective was to implement a Kubernetes-based infrastructure with:

  • A Storage Class for dynamic provisioning of encrypted EBS volumes.
  • A Persistent Volume Claim (PVC) for 4Gi of secure MySQL storage.
  • A ConfigMap to initialize the patientdb database schema.
  • A MySQL Deployment with persistent, encrypted storage and a ClusterIP Service.
  • A User Management Microservice Deployment connected to MySQL, with a NodePort Service for external access.
  • Automated deployment using Kubernetes manifests and API validation with Postman.
  • Completion within three weeks to meet HealthSync’s product launch timeline.

Action

Our DevOps team executed the following steps, adhering to best practices for security, scalability, and microservices:

Setting Up the EBS CSI Driver

  • Deployed the EBS CSI Driver for dynamic EBS volume provisioning:
    kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=master"
    
  • Created an IAM policy with least-privilege permissions for volume management and attached it to the EKS worker node role.

Defining Kubernetes Manifests

  • Storage Class Example (01-storage-class.yml):
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: ebs-sc
    provisioner: ebs.csi.aws.com
    volumeBindingMode: WaitForFirstConsumer
    parameters:
      type: gp3
      encrypted: "true"
    
  • Persistent Volume Claim (02-persistent-volume-claim.yml): Requested 4Gi of encrypted storage.
  • ConfigMap (03-PatientDB-ConfigMap.yml): Initialized the patientdb schema.
  • MySQL Deployment (04-mysql-deployment.yml): Configured with persistent storage and secure credentials.
  • MySQL Service (05-mysql-clusterip-service.yml): Used clusterIP: None for direct pod access.
  • User Management Microservice Example (06-UserManagementMicroservice-Deployment.yml):
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: usermgmt-microservice
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: usermgmt-restapp
      template:
        spec:
          containers:
            - name: usermgmt-restapp
              image: stacksimplify/kube-usermanagement-microservice:1.0.0
              env:
                - name: DB_HOSTNAME
                  value: "mysql"
                - name: DB_NAME
                  value: "patientdb"
    
  • User Management Service Example (07-UserManagement-Service.yml):
    apiVersion: v1
    kind: Service
    metadata:
      name: usermgmt-restapp-service
    spec:
      type: NodePort
      ports:
        - port: 8095
          nodePort: 31231
      selector:
        app: usermgmt-restapp
    

Applying and Verifying the Deployment

  • Applied all manifests:
    kubectl apply -f kube-manifests/
    
  • Verified resources:
    kubectl get sc,pvc,pv
    kubectl get pods
    kubectl get svc
    
  • Tested MySQL and microservice connectivity:
    kubectl run -it --rm --image=mysql:5.6 --restart=Never mysql-client -- mysql -h mysql -u root -pdbpassword11
    

Testing the User Management Microservice

  • Retrieved the EKS worker node public IP:
    kubectl get nodes -o wide
    
  • Tested the health status API:
    curl http://<EKS-WorkerNode-Public-IP>:31231/usermgmt/health-status
    
  • Used Postman with the imported collection (example snippet):
    {
      "info": {
        "name": "AWS-EKS-Masterclass-Microservices",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
      },
      "item": [
        {
          "name": "UserManagement-HealthStatus",
          "request": {
            "method": "GET",
            "url": "{{url}}/usermgmt/health-status"
          }
        },
        {
          "name": "UserManagement-CreateUser",
          "request": {
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\"username\": \"patient1\", \"email\": \"patient1@healthsync.com\", \"role\": \"ROLE_PATIENT\", \"enabled\": true}"
            }
          }
        }
      ]
    }
    
  • Configured Postman environment: url=http://<EKS-WorkerNode-Public-IP>:31231.

Cleanup

  • Removed all resources:
    kubectl delete -f kube-manifests/
    

Result

AMJ Cloud Technologies delivered a robust solution for HealthSync Innovations:

  • Deployment Automation: Fully automated MySQL and microservice provisioning, reducing setup time from weeks to hours.
  • Data Persistence: 100% reliable storage for patient data with encrypted EBS volumes.
  • Scalability: Supported up to 50,000 patient records with dynamic provisioning and microservices.
  • Compliance: Ensured healthcare data security with encrypted storage and secure access.

Technologies Used

  • AWS EKS
  • Amazon EBS
  • EBS CSI Driver
  • Kubernetes Storage Classes
  • MySQL
  • Microservices

Best Practices Followed

  • Security: Encrypted EBS volumes and least-privilege IAM policies for healthcare compliance.
  • Automation: Kubernetes manifests and Postman for repeatable deployments and testing.
  • Scalability: Dynamic provisioning and microservices for growth.
  • Reliability: Noted initContainers as a future enhancement to prevent microservice restarts.
  • Monitoring: Recommended AWS CloudWatch for EBS and pod health.

Project Details

Technologies Used

AWS EKSAmazon EBSEBS CSI DriverKubernetes Storage ClassesMySQLMicroservices

Ready to Transform Your Business?

Contact AMJ Cloud Technologies to optimize your software delivery and drive growth.