DevOpsLesson
DevOpsLesson

Free, comprehensive DevOps tutorials and learning roadmaps. Master Docker, Kubernetes, CI/CD, and more.

Stay Updated

Get notified about new tutorials and features.

Tutorials

  • What is DevOps?
  • Docker Tutorial
  • Terraform Tutorial
  • CI/CD Pipeline
  • All Tutorials

Roadmaps

  • DevOps Engineer
  • Cloud Engineer
  • SRE Path
  • All Roadmaps

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 DevOpsLesson. All rights reserved.

DOCKERKUBERNETESTERRAFORMAWSCI/CDLINUXGITDEVOPS ROADMAPCLOUD ROADMAPSRE ROADMAPGIT CHEATSHEETDOCKER CHEATSHEETK8S CHEATSHEETTF CHEATSHEETLINUX CHEATSHEETDOCKERFILE LINTERYAML VALIDATORCRON PARSERREGEX TESTER

Kubernetes Tutorial

Introduction to Kubernetes
Kubernetes Architecture
Installing Kubernetes
kubectl Basics
Kubernetes Pods
Kubernetes Deployments
Kubernetes Services
ConfigMaps and Secrets
Kubernetes Storage
Kubernetes Namespaces
Kubernetes Resource Management
Helm for Kubernetes
Kubernetes Monitoring

Kubernetes Service: NodePort

PreviousPrev
Next

Expose a Service on a fixed port across every node and understand how traffic flows from outside the cluster to pods.

What Is NodePort?

A NodePort Service exposes your application on every node IP at a static port, usually in the range 30000–32767.

Traffic Flow

Service → Endpoints → Pods

Client

other pod / user

Service

my-svc:80

stable IP · DNS name

Endpoints

10.0.0.1:8080 · 10.0.0.2:8080

Pod A

Pod B

NodePort builds on top of the internal Service model. Kubernetes still load balances to matching pods.

Full YAML Example

apiVersion: v1
kind: Service
metadata:
  name: web-nodeport
spec:
  selector:
    app: web
  ports:
    - port: 80
      targetPort: 8080
      nodePort: 30080
  type: NodePort

Why It Exists

NodePort is simple and works even when you do not have a cloud load balancer. It is common in local labs and some bare-metal environments.

Limitations

LimitationWhy it matters
High port rangeNot user-friendly for public traffic
Node awarenessClients need a node IP
Basic exposure modelLess flexible than Ingress for HTTP routing
Security concernsPublicly reachable ports need careful control

When to Use It

Use NodePort when you need quick external access for testing or when another system will route to node IPs and ports.

Think of NodePort as giving every building entrance the same special side door number. It works, but it is rarely the cleanest front entrance for users.

Exercise

NodePort Range

What port range is typically used by NodePort Services?

Exercise

Flow Understanding

In a NodePort setup, external traffic usually reaches pods through which chain?

PreviousPrev
Next

Continue Learning

Kubernetes Rollbacks

Inspect Deployment revision history, undo rollouts, annotate change causes, and pause or resume updates safely.

18 min·Easy

Kubernetes Services

Understand why Services exist, how selectors connect them to pods, and how stable networking hides pod churn.

16 min·Easy

Kubernetes Service: ClusterIP

Learn the default internal Service type, when to use it, and how DNS and endpoints make in-cluster communication reliable.

18 min·Easy

Explore Related Topics

Do

Docker Tutorials

Build the containers Kubernetes orchestrates

Te

Terraform Tutorials

Provision Kubernetes clusters as code

Try the Tool

YAML Validator

Validate Kubernetes manifests and any YAML files instantly.

On This Page

What Is NodePort?Traffic FlowFull YAML ExampleWhy It ExistsLimitationsWhen to Use It