Find Node IP Inside Kubernetes


Your service runs in a Kubernetes cluster. Find and address it.

Find the IP of the Node

There is a node in the cluster. To find the IP of that node, run:

$ kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}"
192.168.64.7%

Find the Port of Your App

Your app is running on a port on that node. To find the port for the app, my_app_name, run:

$ kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services my_app_name
31471%