DEV Community

Yash Sonawane
Yash Sonawane

Posted on

🚀 Building a Cloud-Native Microservices Voting System on AWS using Kubernetes (Kind) & Argo CD

👨‍💻 Author: Yash Sonawane
🔗 GitHub Repository: https://github.com/yashsonawane25/k8s-microservices-vote-system
📍 Pune, India


📌 Introduction

Modern applications are built using microservices and deployed using container orchestration platforms like Kubernetes. To gain deep hands-on experience with production-style DevOps workflows, I built and deployed a cloud-native voting system on an AWS EC2 instance using:

  • Kubernetes (Kind)
  • Docker
  • Argo CD
  • Prometheus
  • Grafana
  • Redis
  • PostgreSQL

Instead of using managed Kubernetes services like EKS, I manually configured the cluster using Kind to understand Kubernetes internals, networking, service exposure, and Git-driven deployments.

This article explains the architecture, implementation, monitoring setup, and key learnings from this project.


🏗 System Architecture

Architecture Diagram

Architecture Overview

🔎 Architecture Overview

The application follows a distributed microservices model:

🧩 Components

  • Python Frontend – Allows users to vote between two options
  • Redis – Temporarily stores incoming votes
  • .NET Worker Service – Processes votes asynchronously
  • PostgreSQL Database – Stores persistent vote data
  • Node.js Result Service – Displays live voting results

🔁 Request Flow

  1. User submits vote via frontend
  2. Vote is stored in Redis
  3. Worker consumes vote and writes to PostgreSQL
  4. Result service reads from PostgreSQL and displays updated results
  5. Kubernetes manages scaling and availability
  6. Argo CD syncs application state from GitHub

This architecture simulates real-world distributed systems used in production environments.


☁️ Infrastructure Setup on AWS

Step 1 – Launch EC2 Instance

  • Ubuntu-based EC2 instance
  • Configured Security Groups
  • Installed Docker
sudo apt update
sudo apt install docker.io -y
Enter fullscreen mode Exit fullscreen mode

Step 2 – Install Kind & Create Kubernetes Cluster

Kind allows running Kubernetes clusters inside Docker containers.

curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin/

kind create cluster
Enter fullscreen mode Exit fullscreen mode

Verified cluster setup:

kubectl get nodes
Enter fullscreen mode Exit fullscreen mode

🚀 Deploying Microservices to Kubernetes

Created Kubernetes manifests for:

  • Deployments
  • Services
  • ConfigMaps
  • Persistent Volumes

Applied configuration:

kubectl apply -f k8s/
Enter fullscreen mode Exit fullscreen mode

Verified pod status:

kubectl get pods
Enter fullscreen mode Exit fullscreen mode

🔄 Continuous Deployment using Argo CD

Installed Argo CD inside the cluster:

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Enter fullscreen mode Exit fullscreen mode

Connected the GitHub repository to Argo CD.

Enabled:

  • Automated Sync
  • Self-Healing
  • Version-controlled deployments

Now every Git push updates the Kubernetes cluster automatically.


📊 Observability & Monitoring

Production systems require deep visibility into performance and health.

🔎 Prometheus Metrics

Prometheus Dashboard

Prometheus collects:

  • Pod metrics
  • Node metrics
  • CPU usage
  • Memory utilization
  • Service health

📈 Grafana Dashboards

Grafana Dashboard 1

Grafana Dashboard 2

Grafana provides real-time visualization for:

  • Cluster health
  • Resource consumption
  • Performance monitoring
  • Troubleshooting bottlenecks

🗄 Database & Persistence

Database Architecture

PostgreSQL is configured with persistent volumes to ensure data durability even if pods restart.

This ensures:

  • Data integrity
  • Fault tolerance
  • Reliable state management

🎯 Key DevOps Concepts Applied

✔ Kubernetes cluster provisioning from scratch
✔ Microservices architecture deployment
✔ Container orchestration
✔ Automated Git-based deployments
✔ Monitoring & observability
✔ Self-healing workloads
✔ Persistent storage management


🧠 Challenges Faced & Learnings

During this project, I encountered and resolved:

  • Image pull issues
  • Service exposure and NodePort configuration
  • Container networking challenges
  • Monitoring configuration tuning
  • Kubernetes resource debugging

This hands-on debugging strengthened my real-world DevOps troubleshooting skills.


💼 Why This Project Matters

This project replicates a production-style cloud-native deployment pipeline without relying on managed Kubernetes services.

It demonstrates:

  • Infrastructure setup on cloud VMs
  • Container orchestration
  • Automated application delivery
  • Observability stack integration
  • Scalable microservices design

🔗 Source Code

👉 https://github.com/yashsonawane25/k8s-microservices-vote-system


🚀 Open to Opportunities

I am actively seeking DevOps / Cloud Internship opportunities where I can apply Kubernetes, CI/CD, monitoring, and automation skills in production environments.

If you're hiring or collaborating, let's connect.


Top comments (1)

Collapse
 
john_doe_2862b1c94f1f4719 profile image
John Doe

What was your reason for putting your db in a kubernetes cluster? After reading something like this i wouldn't choose a cluster deployment.