External ip for kubernetes shows <nodes> in minikube

蹲街弑〆低调 提交于 2019-12-14 03:40:45

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/44112150/external-ip-for-kubernetes-shows-nodes-in-minikube

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!