kubernetes的外部ip显示< nodes>在minikube [英] External ip for kubernetes shows <nodes> in minikube

查看:1470
本文介绍了kubernetes的外部ip显示< nodes>在minikube的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Kubernetes相当新,我最近使用 NodePort 类型使用miniKube公开了一项服务。我想测试我的应用程序的运行,但我没有看到任何外部IP但只有端口。以下是我的输出:

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>

在这种情况下,外部IP 是什么?所以我可以使用 curl 来暴露我的应用程序的输出,我在笔记本电脑上工作时遵循了教程: https://kubernetes.io/docs/tutorials/kubernetes-basics/expose-interactive/

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/.

PS:< nodes> 获取服务的输出中是什么意思命令外部IP

推荐答案

当你正在使用 minikube ,命令 minikube ip 将返回您要查找的IP。

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

如果您不使用 minikube kubectl get nodes -o yaml 将向您显示节点的IP地址。

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

这篇关于kubernetes的外部ip显示&lt; nodes&gt;在minikube的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆