Back to Blog
devops11 min read

Kubernetes Deployment Guide for Node.js Applications

Step-by-step guide to deploying Node.js on Kubernetes — Deployments, Services, HPA, health checks, and zero-downtime rollouts.

V
By Ventra Rocket
·Published on 5 March 2026
#Kubernetes#Docker#DevOps#Node.js#Deployment

Kubernetes is the industry standard for container orchestration. This guide covers deploying Node.js applications with production-grade configuration.

1. Deployment Manifest

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-server
spec:
  replicas: 3
  selector:
    matchLabels:
      app: api-server
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: api-server
    spec:
      containers:
        - name: api-server
          image: ghcr.io/ventrarocket/api-server:1.0.0
          ports:
            - containerPort: 3000
          resources:
            requests:
              cpu: "100m"
              memory: "128Mi"
            limits:
              cpu: "500m"
              memory: "512Mi"
          livenessProbe:
            httpGet:
              path: /health
              port: 3000
            initialDelaySeconds: 15
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /ready
              port: 3000
            initialDelaySeconds: 5
            periodSeconds: 10

2. Service and ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: api-config
data:
  NODE_ENV: "production"
  PORT: "3000"
---
apiVersion: v1
kind: Service
metadata:
  name: api-svc
spec:
  selector:
    app: api-server
  ports:
    - port: 80
      targetPort: 3000
  type: ClusterIP

3. Horizontal Pod Autoscaler

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: api-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: api-server
  minReplicas: 2
  maxReplicas: 10
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 60

4. Health Endpoints in Node.js

import express from "express";
import { db } from "./db";

const app = express();

app.get("/health", (req, res) => {
  res.json({ status: "ok", uptime: process.uptime() });
});

app.get("/ready", async (req, res) => {
  try {
    await db.query("SELECT 1");
    res.json({ status: "ready" });
  } catch {
    res.status(503).json({ status: "not ready" });
  }
});

5. Zero-Downtime Rollout

# Update image tag, monitor, and rollback if needed
kubectl set image deployment/api-server api-server=ghcr.io/ventrarocket/api-server:1.1.0
kubectl rollout status deployment/api-server
kubectl rollout undo deployment/api-server  # if issues arise

Conclusion

Kubernetes gives Node.js applications enterprise-grade reliability: rolling updates, autoscaling, self-healing. Ventra Rocket uses Kubernetes for all production microservices.

Related Articles

Kubernetes Deployment Guide for Node.js Applications | Ventra Rocket