10

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?

Akash
  • 939
  • 1
  • 8
  • 27

1 Answers1

25

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.

Javier Salmeron
  • 8,365
  • 2
  • 28
  • 23
  • That worked ! In case I am not using miniKube, can you please explain how to resolve the above issue ? – Akash May 22 '17 at 13:09
  • I got it, I just need to ping the node ip address, it is that what it means, the node ip address. – Akash Jul 24 '17 at 08:10
  • This meaning of must be documented somewhere - is there a link for that? – Elliott Beach Sep 24 '17 at 01:49
  • @Elliott As I mentioned in the previous comment. means it is directing you to ping the IP Address of the nodes that are present in the minikube cluster. `minikube ip` gets you the node ip address of the only minikube node running in the minikube cluster. In general, you must ping the node's ip address only after you have declared a service that is exposed as NodePort or LoadBalancer (this is a special case in which you might need to ping the external address of the load balancer itself). – Akash Sep 26 '17 at 04:12
  • 1
    @Akash thanks for the explanation. What I really meant in the comment was that there is some documentation I should have read to learn what the terse expression `` means, but I don't see it anywhere. – Elliott Beach Sep 26 '17 at 04:19