NodePort IP
IP Address Discovery
Kubernetes Networking
NodePort Tutorial
Kubernetes Services

How to find out the ip address of the nodePort

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

A Kubernetes NodePort service does not have one special IP address of its own. It exposes a port on each node, so the address you use is a node IP plus the allocated node port. To reach the service, you first identify the node port on the service, then identify which node IPs are reachable from your client.

Get the NodePort Value

Start by inspecting the service.

bash
kubectl get svc my-service

Example output might include something like:

text
NAME         TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
my-service   NodePort   10.96.120.10    none          80:31234/TCP     4m

Here, 31234 is the node port. The full external access pattern is NODE_IP:31234.

Get the Node IPs

Next, list the cluster nodes.

bash
kubectl get nodes -o wide

That shows internal and sometimes external IP addresses, depending on the environment. Any reachable node IP can usually accept traffic on the node port and forward it to the service.

Why There Is No Single NodePort IP

A NodePort service is implemented across all nodes. Kubernetes opens the same port on each node, not just on the node currently running a backing pod. So the right mental model is:

  • one service
  • one node port number
  • many possible node IPs

That is why asking for “the NodePort IP” is slightly misleading. The service is reachable through node addresses, not through a dedicated standalone IP owned by the service itself.

Example End-to-End

Suppose the service uses node port 31234, and one of your nodes has IP 192.168.1.50.

bash
curl http://192.168.1.50:31234

If the node is reachable from your machine and firewall rules allow the traffic, that request should reach the service.

Internal IP Versus External IP

Which node IP you should use depends on where the client is located.

  • from inside the same network or VPC, a node internal IP may work
  • from outside the cluster network, you usually need a node external IP or some additional load-balancing layer

Cloud-managed clusters often hide nodes behind other networking components, so a node port may technically exist while still not being directly reachable from the public internet.

Environment-Specific Notes

Local clusters behave differently.

  • on minikube, minikube service my-service --url is often the easiest way to get a reachable address
  • on kind, NodePort may require extra Docker networking considerations
  • on cloud clusters, security groups, firewall rules, or load balancers may affect reachability

The service definition is only part of the path. Network exposure still depends on the platform.

Verify the Service Definition

If you are not sure the service is really a NodePort, inspect the YAML.

bash
kubectl get svc my-service -o yaml

Look for:

yaml
1spec:
2  type: NodePort
3  ports:
4    - port: 80
5      targetPort: 8080
6      nodePort: 31234

That confirms the service type and the exact node port number.

Common Pitfalls

A common mistake is searching for a single dedicated service IP instead of using a node IP. Another is using the cluster IP from kubectl get svc, which is only routable inside the cluster network. Developers also often forget that node internal IPs may not be reachable from their laptop or from the public internet. Finally, firewall or cloud network policy can block the node port even when the service configuration is correct.

Summary

  • A NodePort service is reached through a node IP plus the node port.
  • Find the port with kubectl get svc.
  • Find candidate node IPs with kubectl get nodes -o wide.
  • Do not confuse the service’s cluster IP with a reachable external node address.
  • Reachability depends on your environment, network path, and firewall rules as much as on the Kubernetes service type.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.