NodePort
A Service type that opens the same port, by default in the range 30000 to 32767, on every node and forwards it to the Service.
It exposes the Service on every node's address, which may be reachable from outside the cluster.
In more detail
Anyone who can reach any node on that port reaches the Service, so it widens the traffic boundary to the whole node network. It still has a ClusterIP and the same selector. It is useful for local clusters and as a building block for external load balancers.
Example
type: NodePort
ports:
- port: 80
targetPort: 8080
nodePort: 30080Related terms
- Kubernetes Service — The Kubernetes object that gives a changing set of pods one stable name and address, and spreads traffic across the ready ones.
- ClusterIP — The default Service type: a stable virtual IP address reachable only from inside the cluster.
- LoadBalancer Service — A Service type that asks the platform, usually a cloud provider, to create an external load balancer with its own address pointing at the Service.
Related guides
Taught in
- Which IP Answers: Pods, Services And NodePorts — Certified Kubernetes Administrator (CKA) Exam Prep
- Mock Exam: Seventeen Tasks Against The Clock — Certified Kubernetes Administrator (CKA) Exam Prep
- Debugging Applications In Kubernetes — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Services And Empty Endpoints — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Services And Networking: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Mock Exam: Sixteen Tasks Against The Clock — Certified Kubernetes Application Developer (CKAD) Exam Prep
- The Host Footprint: Six Doors On A Worker — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Network Exposure: NodePorts, Host Firewalls And Egress — Certified Kubernetes Security Specialist (CKS) Exam Prep
- A Name That Outlives Its Pods: Services And DNS — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Orchestration Sprint: Four Fixes, No Walls Removed — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Port 30080 On Every Node: kube-proxy, Networking And Clients — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Component Sprint: The Reference Build — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- NodePort, LoadBalancer And ExternalName — Kubernetes: Production-Grade Container Orchestration
References
Certification courses
- CKA course and practice exam: Certified Kubernetes Administrator
- CKAD course and practice exam: Certified Kubernetes Application Developer
- CKS course and practice exam: Certified Kubernetes Security Specialist
- KCNA course and practice exam: Kubernetes and Cloud Native Associate
- KCSA course and practice exam: Kubernetes and Cloud Native Security Associate