Md. Shihabuddin Sadi

Software Engineer specializing in DevOps, Cloud Native technologies, and Platform Engineering. Experienced in Kubernetes, Docker, CI/CD pipelines, and Infrastructure as Code (IaC). Passionate about automating workflows, optimizing developer experience, and building scalable cloud platforms.

View on GitHub
27 October 2025

Building a Full-Stack App on a Single-Node Kubernetes Cluster

by Md. Shihabuddin Sadi

Software Engineer · DevOps & Cloud Native Engineer · Aspiring Platform Engineer
October 26, 2025


Summary

This project showcases how I built a complete full-stack application (React frontend, Node.js backend, MongoDB database) inside a single-node Kubernetes cluster using Minikube.
It demonstrates real-world DevOps practices such as Deployments, Services, Ingress, ConfigMaps, Secrets, and Persistent Volumes, all tied together with a custom automation script that simplifies cluster management.
The goal was to replicate a production-like Kubernetes setup locally, helping me deepen my understanding of cloud-native application deployment and orchestration.

🔗 GitHub Repository: sadishihab/kubernetes-minikube-fullstack


Table of Contents

Key Technologies Used

Kubernetes · Minikube · Docker · Node.js · React · MongoDB · NGINX Ingress · ConfigMaps · Secrets · Persistent Volume · Shell scripting

1. Project Overview

The project demonstrates a three-tier architecture deployed in Minikube using the Docker driver:

Architecture Diagram

               ┌────────────────────────────┐
               │      Browser / User        │
               └──────────────┬─────────────┘
                              │
                              ▼
                    ┌──────────────────┐
                    │     Ingress      │
                    │ (NGINX / Rules)  │
                    └───────┬──────────┘
                            │
            ┌───────────────┴────────────────┐
            │                                │
            ▼                                ▼
 ┌───────────────────┐             ┌───────────────────┐
 │   Frontend Pod    │             │   Backend Pod     │
 │ (React / Node.js) │◄──────────►│ (Node.js / API)   │
 │   ClusterIP SVC   │             │   ClusterIP SVC   │
 └────────┬──────────┘             └────────┬──────────┘
          │                                 │
          │                                 ▼
          │                     ┌───────────────────┐
          │                     │   MongoDB Pod     │
          │                     │ (Database Layer)  │
          │                     │ Persistent Volume │
          │                     └────────┬──────────┘
          │                              │
          │                     ┌───────────────────┐
          │                     │ PVC + PV (Storage)│
          │                     └───────────────────┘
          │
   ┌──────────────────────────┐
   │ ConfigMaps & Secrets     │
   │ (Env vars, credentials)  │
   └──────────────────────────┘


2. Folder Structure

├── frontend/               # Frontend (React)
├── backend/                # Backend (Node.js)
├── k8s/                    # Kubernetes manifests
│   ├── deployments        # Deployment YAMLs
│   ├── services           # Service YAMLs
│   ├── ingress.yaml        # Ingress config
│   ├── pvc.yaml            # MongoDB PVC
│   └── configmaps-secrets  # ConfigMaps & Secrets
└── README.md


3. Setup Instructions

Start Minikube

minikube start --driver=docker
eval $(minikube docker-env)


Apply Configurations

kubectl apply -f k8s/app-configmap.yaml
kubectl apply -f k8s/app-secret.yaml
kubectl apply -f k8s/mongo-pv.yaml
kubectl apply -f k8s/mongo-pvc.yaml
kubectl apply -f k8s/mongo.yaml
kubectl apply -f k8s/backend.yaml
kubectl apply -f k8s/frontend.yaml
kubectl apply -f k8s/ingress.yaml


Verify

kubectl get pods
kubectl get svc
kubectl get ingress


Access the App

minikube tunnel

Then open the browser and visit the Ingress host URL.

4. Automation Script Instructions

To simplify cluster operations, I created a script that can:

Examples:

./k8s-manage.sh --stop
./k8s-manage.sh --start
./k8s-manage.sh --save
./k8s-manage.sh --restore


5. Common Errors & Fixes

❌ Image not updating after rebuild

If you rebuild Docker images but pods still use the old one:

eval $(minikube docker-env)
kubectl rollout restart deployment <deployment-name>

❌ Ingress not working

Ensure Ingress addon is enabled:

minikube addons enable ingress

❌ MongoDB Pod in CrashLoopBackOff

Check logs:

kubectl logs <pod-name>

Possible causes:

❌ Port not accessible

Use:

minikube tunnel
kubectl get ingress

Then open the listed ADDRESS in your browser.

6. Learning Outcomes

References

License

This project is open-source and available under the MIT License

tags: Kubernetes - Minikube - Docker - Node.js - React - MongoDB - Cloud-Native - CI/CD