All Projects

MERN Chat App - Kubernetes Deployment & Containerization

Production-ready Kubernetes deployment of a real-time MERN chat application with persistent storage and service orchestration

A comprehensive DevOps project featuring containerization and Kubernetes orchestration of an existing MERN stack real-time chat application. Includes multi-stage Docker builds, custom Kubernetes manifests for deployments and services, persistent volume claims for MongoDB data persistence, secrets management for JWT authentication, ConfigMaps for Nginx configuration, health checks, resource limits, and deployment on Kind cluster for local testing.

ROLEDevOps Engineer
KubernetesKindDockerDocker Composekubectl
Real-time chat application interface running on Kubernetes
Kind cluster setup and configuration

Tech Stack

The engine behind the experience

KubernetesKindDockerDocker ComposekubectlYAMLMongoDBNode.jsReactNginxExpressSocket.ioJWTPersistent VolumesSecrets ManagementConfigMaps

OVERVIEW

A complete end-to-end DevOps project demonstrating production-grade containerization and Kubernetes deployment practices. This project involved taking an existing MERN stack real-time chat application and transforming it into a cloud-native, containerized solution ready for Kubernetes orchestration. The original application consisted of a React frontend with Vite build system, Node.js/Express backend with Socket.io for real-time messaging, and MongoDB for data persistence. The application featured JWT authentication, user profile management with image uploads, and real-time chat capabilities. Key DevOps implementations include multi-stage Docker builds for both frontend and backend services, optimizing image sizes and build efficiency. The frontend uses a Node.js build stage to compile React assets, then serves them via Nginx Alpine in production. The backend Dockerfile implements security best practices with non-root user execution and health checks. Kubernetes deployment architecture includes custom YAML manifests for all components: namespace isolation for resource organization, MongoDB deployment with persistent volume claims (PVC) ensuring data persistence across pod restarts, backend deployment with environment variable configuration and secrets management for sensitive JWT keys, frontend deployment with ConfigMap-mounted Nginx configuration for reverse proxy setup, ClusterIP service for MongoDB internal communication, NodePort services for frontend and backend external access, resource limits and requests for CPU and memory management, readiness and liveness probes for automatic health monitoring and pod recovery, and Kind cluster configuration for local Kubernetes testing with port mappings. The project follows Kubernetes best practices including proper secret management using Kubernetes Secrets API, persistent storage with ReadWriteOnce (RWO) access mode for MongoDB data, service discovery and internal networking between pods, namespace-based resource isolation, and declarative configuration management through YAML manifests. Deployment workflow includes creating a Kind cluster with custom configuration, applying namespace and base resources, setting up persistent storage and secrets, deploying MongoDB with data persistence, deploying backend service with proper environment configuration, deploying frontend service with Nginx reverse proxy, and verifying all services are running and communicating correctly. Built as a DevOps learning project, this demonstrates proficiency in container orchestration, infrastructure as code, cloud-native application deployment patterns, and production-ready Kubernetes practices. The deployment successfully containerized and orchestrated an existing application without modifying the application code, showcasing the power of DevOps tooling in modern software deployment.