Kubernetes manifests for deploying a Full Stack Chat Application on a local Docker Desktop (Windows) environment with Kubernetes enabled on a single-node cluster.
- Overview
- Architecture
- Prerequisites
- Project Structure
- Getting Started
- Deployment
- Accessing the Application
- Teardown
- Troubleshoots
- License
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.
βββββββββββββββββββββββββββββββββββββββββββ
β k8s-chatapp Namespace β
β β
Browser βββΊ Ingress βββΊ Frontend Pod βββΊ Backend Pod β
β β β
β MongoDB Service β
β β β
β MongoDB Pod β
β (PV + PVC mounted) β
βββββββββββββββββββββββββββββββββββββββββββ
Ensure the following are installed and running before deploying:
| Tool | Version | Notes |
|---|---|---|
| Docker Desktop | Latest | Enable Kubernetes in settings |
| kubectl | v1.25+ | Kubernetes CLI |
| NGINX Ingress Controller | Latest | Required for ingress routing |
- Open Docker Desktop β Settings β Kubernetes
- Check Enable Kubernetes
- Click Apply & Restart
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.0/deploy/static/provider/cloud/deploy.yamlfull-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
git clone https://github.com/swapnilmali101/full-stack-chatapp.git
cd full-stack-chatappCopy or review the .env file and update any values as needed. Sensitive values should be base64-encoded and placed in secrets.yaml.
# Example: base64 encode a secret value
echo -n "your-password" | base64Apply all manifests in the following order from the k8s-manifests/ directory:
cd k8s-manifestskubectl create -f namespace.yaml
kubectl get nskubectl apply -f mongodb-pv.yaml
kubectl apply -f mongodb-pvc.yaml
kubectl get pvc,pv -n k8s-chatappkubectl apply -f mongodb-deployment.yaml
kubectl apply -f mongodb-service.yamlkubectl apply -f secrets.yamlkubectl apply -f backend-deployment.yaml
kubectl apply -f backend-service.yamlkubectl apply -f frontend-deployment.yaml
kubectl apply -f frontend-service.yamlkubectl apply -f ingress.yamlkubectl 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-nginxAll pods should show Running status before proceeding.
Forward traffic from the NGINX Ingress Controller to your local machine:
kubectl port-forward svc/ingress-nginx-controller -n ingress-nginx 80:80Then open your browser at: http://localhost:80
kubectl port-forward svc/backend 5001:5001 -n k8s-chatappBackend API available at: http://localhost:5001
To remove all deployed resources and clean up the namespace:
kubectl delete namespace k8s-chatapp
kubectl get ns
β οΈ This will delete all resources in thek8s-chatappnamespace, including PersistentVolumeClaims and their data.
refer repo β troubleshooting-plunges
This project is open source and available under the MIT License.
|
π¨π»βπ»CS Engineer | AWS & DevOps Specialist -π―focused on building reliable, observable, and scalable systems. |
