liveBook · Manning

Node port

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A NodePort is a Kubernetes service type that exposes a service on a port of each cluster node.

A NodePort Service exposes a Service for external traffic through a static port on each cluster node while continuing to route traffic to its Pods. The node IP and exposed port are required; NodePort ports use the 30000–32768 range. section 6.4.2

Create and inspect a NodePort with these operational steps:

  • Generate a manifest imperatively with kubectl create svc nodeport no --node-port 30000 --tcp 443:80 --dry-run=client -o yaml > nodeport.yaml. section 6.4.2
  • Set the Service type to NodePort and add nodePort: 30000 under ports, then apply it with kubectl apply -f nodeport.yaml. section 6.4.2
  • Use NodePort for testing, but account for node-address and port knowledge, direct Pod exposure risk, and the absence of headless-Service support. section 6.4.2

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Defines exposure, port range, commands, YAML changes, verification, and limitations without detailing networking internals.
Examples
Uses kubectl commands, port 30000, node address 100.96.95.252, and kubectl get svc output.
What it assumes
Assumes familiarity with Pods, Services, kubectl, and basic declarative YAML.
What you can do after
Apply it via kubectl, expose a Service on a chosen node port, and verify the resulting Service mapping.
How it connects
Connects Services to Pods, ClusterIP, LoadBalancer, ingress, and CoreDNS.

Also explained in

Compare how 6 books explain node port →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.