kubernetes的外部ip显示< nodes>在minikube [英] External ip for kubernetes shows <nodes> in 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 除其他数据外,code>将向您显示节点的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显示< nodes>在minikube的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!