DEV Community

Babji-Sheik
Babji-Sheik

Posted on

Deploying a Node.js App on Kubernetes with Minikube

published: true
description: "From Docker to Kubernetes — how I built, deployed, debugged, and verified a Node.js app locally using Minikube on Windows. A full hands-on DevOps learning experience."
tags: ["devops", "kubernetes", "docker", "node", "git", "minikube", "windows"]

cover_image: "https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fq4x1xx7y9p8vyt3z8im.png"

🚀 My DevOps Journey: Node.js + Kubernetes (Minikube) on Windows

A personal hands-on walkthrough of Docker, Kubernetes, and Git — how I containerized and deployed a Node.js app locally using Minikube, explored versioning, debugging, and real DevOps workflows.


🌱 Why I Did This

I wanted to move beyond tutorials and actually build and debug something real with Kubernetes.

So I set up Minikube on Windows, deployed a Node.js web app, managed Docker containers, and learned how everything connects — from YAML to running pods.

This project became a deep dive into how DevOps engineers really work.


🧩 Project Overview

Here’s what I built and tested:

  • 🐳 Containerized a Node.js app using Docker
  • ☸️ Deployed it inside Kubernetes (Minikube) cluster
  • 🔗 Exposed the app externally using NodePort
  • 🧪 Verified version metadata (version.json) like in real CI pipelines
  • 🧰 Managed everything using Git + PowerShell on Windows 11 Home

⚙️ Tools I Used

Category Tools & Versions
OS Windows 11 Home
Runtime Node.js (LTS)
Containers Docker
Cluster Kubernetes (Minikube v1.37.0)
Base Image kicbase:v0.0.48
Version Control Git + GitHub
Testing Go (iso_test.go concept)

🧱 Step 1: Setting up Minikube

I started my cluster using Docker as a driver:

minikube start
Enter fullscreen mode Exit fullscreen mode

Minikube downloaded the base image (kicbase:v0.0.48) and booted a control-plane node.

Everything ran on Windows Home — no Hyper-V needed.


🐳 Step 2: Dockerize the Node.js App

I wrote a simple Node.js server (app.js):

const http = require("http");
const PORT = 3000;
const server = http.createServer((req, res) => {
  res.end("Hello from Node.js running inside Kubernetes!");
});
server.listen(PORT, () => console.log(`Server running on port ${PORT}`));
Enter fullscreen mode Exit fullscreen mode

Then, I created a Dockerfile:

FROM node:18-alpine
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["node", "app.js"]
Enter fullscreen mode Exit fullscreen mode

Built the image:

docker build -t node-k8s-demo .
Enter fullscreen mode Exit fullscreen mode

☸️ Step 3: Deploy on Kubernetes

Deployment YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  name: node-k8s-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: node-k8s
  template:
    metadata:
      labels:
        app: node-k8s
    spec:
      containers:
      - name: node-k8s
        image: node-k8s-demo
        ports:
        - containerPort: 3000
Enter fullscreen mode Exit fullscreen mode

Service YAML

apiVersion: v1
kind: Service
metadata:
  name: node-k8s-service
spec:
  type: NodePort
  selector:
    app: node-k8s
  ports:
  - port: 3000
    targetPort: 3000
    nodePort: 30080
Enter fullscreen mode Exit fullscreen mode

Applied configs:

kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
Enter fullscreen mode Exit fullscreen mode

🌐 Step 4: Expose and Access the App

Used Minikube to expose it externally:

minikube service node-k8s-service
Enter fullscreen mode Exit fullscreen mode

✅ Output:

NAMESPACE │       NAME       │ TARGET PORT │            URL            
default   │ node-k8s-service │ 3000        │ http://192.168.49.2:30080 
Enter fullscreen mode Exit fullscreen mode

Then, visiting http://192.168.49.2:30080 opened my app 🎉


🧪 Step 5: Version Verification (ISO Test Concept)

From a real Minikube test example (iso_test.go):

{
  "iso_version": "v1.37.0-1758198818-20370",
  "kicbase_version": "v0.0.48",
  "minikube_version": "v1.37.0",
  "commit": "a4f96d0469d67330691be52a99ff1f91e31ba77f"
}
Enter fullscreen mode Exit fullscreen mode

I learned how build metadata (ISO version, commit IDs) ensures consistency in CI/CD — just like in real production releases.


🔧 Step 6: Debugging, Logs & Restarts

Things didn’t always go perfectly.

  • Sometimes the tunnel didn’t start → fixed by restarting Minikube
  • Verified pods using kubectl get pods
  • Checked logs with kubectl logs <pod>
  • Cleaned up with kubectl delete -f <file>

This taught me real DevOps problem-solving, not just running commands.


🧾 Step 7: Git & Documentation

I documented everything in Git and GitHub:

git init
git add .
git commit -m "Node.js Kubernetes demo setup"
git branch -M main
git remote add origin https://github.com/<your-username>/<repo>.git
git push -u origin main
Enter fullscreen mode Exit fullscreen mode

Also added .gitignore and this detailed README.md (you’re reading the same content now 😉).


💡 What I Learned

  • Kubernetes architecture & Minikube internals
  • Docker image creation & reusability
  • YAML configuration & rolling updates
  • Exposing services via NodePort
  • Debugging tunnels and IP routing
  • CI version validation (version.json check)
  • Proper Git commits and repo structuring
  • Documenting DevOps work cleanly

📚 Full Stack of What I Explored

✅ Minikube lifecycle

✅ Docker build, run, inspect

✅ Kubernetes Deployments & Services

✅ NodePort & local networking

✅ ISO versioning and metadata validation

✅ Windows compatibility handling

✅ Git workflows

✅ Debugging tunnels and pods

✅ CI/CD thinking & test verification


🧠 Final Thoughts

This wasn’t just a “Minikube tutorial.”

It was my complete DevOps learning journey — from writing code to deploying and validating it inside a Kubernetes cluster, all on Windows.

I learned that real DevOps is not about memorizing commands — it’s about understanding how every piece connects.


🧑‍💻 Author

Sheik

💡 DevOps | Kubernetes | Docker | Git | Cloud Automation

📦 Hands-on with containers, clusters, and CI/CD pipelines

📬 Connect: GitHub | LinkedIn


If you found this post helpful, drop a ❤️ or comment your Minikube experience!

Top comments (0)