liveBook · Manning

Node port

As explained in Machine Learning Platform Engineering

A NodePort service is a Kubernetes service that exposes an application through a designated port on each cluster node.

A NodePort service exposes an application through a designated port on every Kubernetes cluster node, forwarding requests to matching pods. This stable access layer remains available when pods move during scaling or node failures. section 3.3.4

Configure the traffic path with three ports:

  • targetPort identifies the application port on the pod. section 3.3.4
  • port identifies the service port that forwards to targetPort. section 3.3.4
  • nodePort identifies the externally reachable node port and can range from 30,000 to 32,767. section 3.3.4

Expose an application

A NodePort manifest can map port 30420 on every node to port 80 on the service and port 8083 on pods selected by app: fast-api. Apply it with kubectl create -f node-port-service.yaml, then reach it at http://<node_IP>:30420.

How Machine Learning Platform Engineering covers it

How deep it goes
Explains port roles, selectors, deployment commands, node discovery, external curl testing, and contrasts alternatives.
Examples
Demonstrates a hello-joker service, node IP discovery, kubectl inspection, and curl access on port 30420.
What it assumes
Assumes Kubernetes objects, pods, services, kubectl, and node access; teaches NodePort configuration from its port mappings.
What you can do after
Operate/configure a NodePort service, apply its YAML, inspect nodes, and verify external connectivity with curl.
How it connects
Connects services with pods, ClusterIP for internal access, and LoadBalancer for cloud-provided external routing.

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 Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.