https://github.com/swapnilmali101/full-stack-chatapp
Kubernetes manifests for deploying a full-stack chat application on a local Docker Desktop (Windows) environment with Kubernetes enabled on a single-node cluster.
https://github.com/swapnilmali101/full-stack-chatapp
docker dockerdesktop k8s k8s-cluster k8s-deployment kubernetes kubernetes-cluster kubernetes-deployment kubernetes-manifests kubernetes-setup
Last synced: 23 days ago
JSON representation
Kubernetes manifests for deploying a full-stack chat application on a local Docker Desktop (Windows) environment with Kubernetes enabled on a single-node cluster.
- Host: GitHub
- URL: https://github.com/swapnilmali101/full-stack-chatapp
- Owner: swapnilmali101
- License: mit
- Created: 2026-04-07T02:44:47.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2026-05-12T02:02:13.000Z (2 months ago)
- Last Synced: 2026-05-12T04:08:30.410Z (2 months ago)
- Topics: docker, dockerdesktop, k8s, k8s-cluster, k8s-deployment, kubernetes, kubernetes-cluster, kubernetes-deployment, kubernetes-manifests, kubernetes-setup
- Homepage: https://github.com/swapnilmali101/full-stack-chatapp
- Size: 39.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π Full Stack Chat Application
Kubernetes manifests for deploying a **Full Stack Chat Application** on a local Docker Desktop (Windows) environment with Kubernetes enabled on a single-node cluster.
-----
## π Table of Contents
- [Overview](#overview)
- [Architecture](#architecture)
- [Prerequisites](#prerequisites)
- [Project Structure](#project-structure)
- [Getting Started](#getting-started)
- [Deployment](#deployment)
- [Accessing the Application](#accessing-the-application)
- [Teardown](#teardown)
- [Troubleshoots](#troubleshoots)
- [License](#license)
-----
## π Overview
This repository contains all the Kubernetes manifest files needed to spin up a full-stack chat application locally. The stack includes:
- **Frontend** β Web UI served via a dedicated deployment and service
- **Backend** β REST/WebSocket API server
- **MongoDB** β Persistent database with a PersistentVolume and PersistentVolumeClaim
- **Ingress** β NGINX Ingress Controller to route external traffic to services
- **Secrets** β Kubernetes secrets for sensitive configuration (e.g. DB credentials)
All resources are scoped to the `k8s-chatapp` namespace.
-----
## ποΈ Architecture
```
βββββββββββββββββββββββββββββββββββββββββββ
β k8s-chatapp Namespace β
β β
Browser βββΊ Ingress βββΊ Frontend Pod βββΊ Backend Pod β
β β β
β MongoDB Service β
β β β
β MongoDB Pod β
β (PV + PVC mounted) β
βββββββββββββββββββββββββββββββββββββββββββ
```
-----
## βοΈ Prerequisites
Ensure the following are installed and running before deploying:
|Tool |Version|Notes |
|-----------------------------------------------------------------|-------|-----------------------------|
|[Docker Desktop](https://www.docker.com/products/docker-desktop/)|Latest |Enable Kubernetes in settings|
|[kubectl](https://kubernetes.io/docs/tasks/tools/) |v1.25+ |Kubernetes CLI |
|NGINX Ingress Controller |Latest |Required for ingress routing |
### Enable Kubernetes on Docker Desktop
1. Open Docker Desktop β **Settings** β **Kubernetes**
1. Check **Enable Kubernetes**
1. Click **Apply & Restart**
### Install NGINX Ingress Controller
```bash
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.0/deploy/static/provider/cloud/deploy.yaml
```
-----
## π Project Structure
```
full-stack-chatapp/
βββ k8s-manifests/
β βββ namespace.yaml # Namespace: k8s-chatapp
β βββ secrets.yaml # Kubernetes Secrets (DB credentials, etc.)
β βββ mongodb-pv.yaml # PersistentVolume for MongoDB
β βββ mongodb-pvc.yaml # PersistentVolumeClaim for MongoDB
β βββ mongodb-deployment.yaml # MongoDB Deployment
β βββ mongodb-service.yaml # MongoDB ClusterIP Service
β βββ backend-deployment.yaml # Backend API Deployment
β βββ backend-service.yaml # Backend ClusterIP Service
β βββ frontend-deployment.yaml # Frontend Deployment
β βββ frontend-service.yaml # Frontend ClusterIP Service
β βββ ingress.yaml # NGINX Ingress rules
βββ .env # Environment variables (local use only)
βββ .gitignore
βββ LICENSE
βββ README.md
```
-----
## β‘Getting Started
### 1. Clone the Repository
```bash
git clone https://github.com/swapnilmali101/full-stack-chatapp.git
cd full-stack-chatapp
```
### 2. Configure Environment Variables
Copy or review the `.env` file and update any values as needed. Sensitive values should be base64-encoded and placed in `secrets.yaml`.
```bash
# Example: base64 encode a secret value
echo -n "your-password" | base64
```
-----
## π·ββοΈ Deployment
Apply all manifests in the following order from the `k8s-manifests/` directory:
```bash
cd k8s-manifests
```
### Step 1 β Create Namespace
```bash
kubectl create -f namespace.yaml
kubectl get ns
```
### Step 2 β Create Persistent Storage for MongoDB
```bash
kubectl apply -f mongodb-pv.yaml
kubectl apply -f mongodb-pvc.yaml
kubectl get pvc,pv -n k8s-chatapp
```
### Step 3 β Deploy MongoDB
```bash
kubectl apply -f mongodb-deployment.yaml
kubectl apply -f mongodb-service.yaml
```
### Step 4 β Apply Secrets
```bash
kubectl apply -f secrets.yaml
```
### Step 5 β Deploy Backend
```bash
kubectl apply -f backend-deployment.yaml
kubectl apply -f backend-service.yaml
```
### Step 6 β Deploy Frontend
```bash
kubectl apply -f frontend-deployment.yaml
kubectl apply -f frontend-service.yaml
```
### Step 7 β Apply Ingress
```bash
kubectl apply -f ingress.yaml
```
### Verify Everything Is Running
```bash
kubectl get pods -n k8s-chatapp
kubectl get svc -n k8s-chatapp
kubectl get ingress -n k8s-chatapp
kubectl get pods -n ingress-nginx
kubectl get svc -n ingress-nginx
```
All pods should show `Running` status before proceeding.
-----
## π Accessing the Application
### Via Ingress (Recommended)
Forward traffic from the NGINX Ingress Controller to your local machine:
```bash
kubectl port-forward svc/ingress-nginx-controller -n ingress-nginx 80:80
```
Then open your browser at:
### Direct Backend Port-Forward (for debugging)
```bash
kubectl port-forward svc/backend 5001:5001 -n k8s-chatapp
```
Backend API available at:
-----
## βοΈβπ₯ Teardown
To remove all deployed resources and clean up the namespace:
```bash
kubectl delete namespace k8s-chatapp
kubectl get ns
```
> β οΈ This will delete **all** resources in the `k8s-chatapp` namespace, including PersistentVolumeClaims and their data.
-----
## π Troubleshoots
___[refer repo β troubleshooting-plunges](https://github.com/swapnilmali101/troubleshooting-plunges)___
---
## π License
This project is open source and available under the [MIT License](LICENSE).
-----
## βοΈ Author
SWAPNIL MALI.
π¨π»βπ»CS Engineer | AWS & DevOps Specialist -π―focused on building reliable, observable, and scalable systems.
---