NodeJsAdvanced Docker with Kubernetes

Kubernetes is a container orchestration system that automates scaling, deployment, and management of Node.js containers. It is ideal for microservices and cloud-native applications.

// deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nodejs-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nodejs-app
  template:
    metadata:
      labels:
        app: nodejs-app
    spec:
      containers:
      - name: nodejs-app
        image: my-node-app:latest
        ports:
        - containerPort: 3000