External ip for kubernetes shows <nodes> in minikube

Akash picture Akash · May 22, 2017 · Viewed 8.7k times · Source

I am fairly new to Kubernetes and I have recently exposed a service using miniKube using NodePort type. I want to test the running of my application but I dont see any external ip but the port only. Here is the output of my:

$kubectl get service
NAME                  CLUSTER-IP   EXTERNAL-IP   PORT(S)          AGE
kubernetes            10.0.0.1     <none>        443/TCP          1h
kubernetes-bootcamp   10.0.0.253   <nodes>       8080:31180/TCP   20m


$kubectl describe services/kubernetes-bootcamp
Name:           kubernetes-bootcamp
Namespace:      default
Labels:         run=kubernetes-bootcamp
Annotations:        <none>
Selector:       run=kubernetes-bootcamp
Type:           NodePort
IP:         10.0.0.253
Port:           <unset> 8080/TCP
NodePort:       <unset> 31180/TCP
Endpoints:      172.17.0.2:8080
Session Affinity:   None
Events:         <none>

What is the External IP in this case so that I can use curl to get the output of my app exposed, I followed the tutorial while working on my laptop : https://kubernetes.io/docs/tutorials/kubernetes-basics/expose-interactive/.

P.S : What does that <nodes> means in the output of the get service command under External-IP?

Answer

Javier Salmeron picture Javier Salmeron · May 22, 2017

As you are using minikube, the command minikube ip will return the IP you are looking for.

In case you are not using minikube, kubectl get nodes -o yaml will show you, amongst other data, the IP address of the node.