🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsWindows Authentication SMS not received or working(12.09.2026 um 11:54 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
🕵️ SicherheitslückenDefender 0-Day ShieldBreak (CVE-2026-69414) nicht sauber gepatcht - BornCity(11.09.2026 um 12:52 Uhr)
🪟 Windows TippsServertimeout in Outlook über 10 Minuten verlängern(12.09.2026 um 15:10 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsWindows Authentication SMS not received or working(12.09.2026 um 11:54 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
🕵️ SicherheitslückenDefender 0-Day ShieldBreak (CVE-2026-69414) nicht sauber gepatcht - BornCity(11.09.2026 um 12:52 Uhr)
🪟 Windows TippsServertimeout in Outlook über 10 Minuten verlängern(12.09.2026 um 15:10 Uhr)

🔧 Programmierung 🕛 vor 3 Monaten 4 Min Lesezeit
0

Deploying a Dockerized Node.js Application on Kubernetes 🚀

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

After containerizing an application with Docker, the next logical step is deploying it on Kubernetes.



Kubernetes helps automate application deployment, scaling, networking, and management of containerized workloads. Instead of manually running containers, Kubernetes ensures your application remains available and can easily scale when needed.



In this guide, we'll deploy a Docker image of a Node.js application on Kubernetes using a Deployment and a Service.









Prerequisites



Before starting, make sure you have:




  • Docker installed

  • Kubernetes cluster running (Docker Desktop Kubernetes, Minikube, Kind, EKS, etc.)

  • kubectl configured

  • A Docker image pushed to Docker Hub



In my case, the image was:




CODE
madhavnaks/node-app:latest












Why Kubernetes?



Running a container using Docker is straightforward:




CODE
docker run -p 3000:3000 madhavnaks/node-app:latest






However, in production environments we need much more than simply running a container.



Kubernetes provides:




  • High availability

  • Self-healing containers

  • Load balancing

  • Service discovery

  • Horizontal scaling

  • Rolling updates



This makes it the industry standard for container orchestration.









Understanding the Kubernetes Architecture for This Deployment



For this deployment, we'll use two Kubernetes resources:






Deployment



A Deployment is responsible for:




  • Creating Pods

  • Maintaining desired replica count

  • Recreating failed Pods automatically

  • Managing updates and rollbacks






Service



A Service provides a stable network endpoint for Pods.



Since Pod IPs change frequently, Services allow applications and users to communicate reliably with Pods.









Deployment and Service Manifest



Create a file named:




CODE
app.yaml






Add the following configuration:




CODE
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-app

spec:
replicas: 2

selector:
matchLabels:
app: node-app

template:
metadata:
labels:
app: node-app

spec:
containers:
- name: node-app
image: madhavnaks/node-app:latest

ports:
- containerPort: 3000

---

apiVersion: v1
kind: Service

metadata:
name: node-app

spec:
selector:
app: node-app

type: NodePort

ports:
- port: 123
targetPort: 3000
nodePort: 32000












Understanding the Deployment Configuration






Replica Count






CODE
replicas: 2






Kubernetes will maintain two running Pod instances of the application.



If one Pod crashes, Kubernetes automatically creates another one to maintain the desired state.









Docker Image






CODE
image: madhavnaks/node-app:latest






Kubernetes pulls the image directly from Docker Hub and uses it to create containers.









Container Port






CODE
containerPort: 3000






This specifies the port on which the Node.js application listens inside the container.









Understanding the Service Configuration



The Service exposes our Pods to network traffic.






Service Port






CODE
port: 123






This is the port exposed by the Kubernetes Service inside the cluster.









Target Port






CODE
targetPort: 3000






Traffic arriving at the Service is forwarded to port 3000 inside the container.









NodePort






CODE
nodePort: 32000






This exposes the application outside the cluster.



Requests reaching:




CODE
<Node-IP>:32000






are forwarded to:




CODE
Service Port → Target Port → Container






which means:




CODE
32000 → 123 → 3000












Deploying the Application



Apply the manifest:




CODE
kubectl apply -f complete.yaml






Expected output:




CODE
deployment.apps/node-app created
service/node-app created












Verify the Deployment



Check Deployments:




CODE
kubectl get deployments






Example output:




CODE
NAME       READY   UP-TO-DATE   AVAILABLE
node-app 2/2 2 2









Check Pods:




CODE
kubectl get pods






Example:




CODE
NAME                        READY   STATUS
node-app-xxxxx 1/1 Running
node-app-yyyyy 1/1 Running






Notice that Kubernetes created two Pods because we specified:




CODE
replicas: 2









Check Services:




CODE
kubectl get svc






Example:




CODE
NAME         TYPE       CLUSTER-IP      PORT(S)
node-app NodePort 10.x.x.x 123:32000/TCP












Accessing the Application



To access the application:




CODE
http://localhost:32000






Or:




CODE
http://<Node-IP>:32000






depending on your Kubernetes setup.



The request flow looks like:




CODE
User


NodePort (32000)


Service Port (123)


Target Port (3000)


Node.js Container












Benefits of Using a Deployment



Deployments provide several production-grade capabilities:






Self-Healing



If a Pod crashes:




CODE
kubectl delete pod <pod-name>






Kubernetes automatically creates a replacement Pod.









Scaling



Increase replicas easily:




CODE
replicas: 5






Apply again:




CODE
kubectl apply -f complete.yaml






Kubernetes creates additional Pods automatically.









Rolling Updates



When a new Docker image version is pushed:




CODE
image: madhavnaks/node-app:v2






Applying the updated manifest performs a rolling update with minimal downtime.









Key Takeaways



✅ Deployments manage Pods automatically



✅ Replica count ensures high availability



✅ Services provide stable networking



✅ NodePort exposes applications outside the cluster



✅ Kubernetes continuously maintains the desired state of the application









Conclusion



Deploying a containerized application on Kubernetes is a major step toward building production-ready cloud-native applications.



Using a Deployment and Service, Kubernetes can automatically manage application availability, networking, scaling, and recovery without manual intervention.



Once you're comfortable with these fundamentals, the next topics to explore are ConfigMaps, Secrets, Ingress, Persistent Volumes, and Helm Charts.



Happy Learning and Happy Kubernetes! 🚀

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
The Gemini desktop app is now available for Windows
1 Quelle
Windows Authentication SMS not received or working
1 Quelle
Windows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Deploying a Dockerized Node.js Application on Kubernetes 🚀

Thematisch verwandte Begriffe: Deploying, Dockerized, Nodejs, Application · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...