gpt4 book ai didi

kubectl expose - 我错过了什么吗?

转载 作者:行者123 更新时间:2023-12-02 04:35:07 25 4
gpt4 key购买 nike

您好,我尝试通过 fabric8 访问 th spring-boot 教程应用

之后:

C:\Users\gregor>kubectl expose deployment springboottut --type=LoadBalancer --name=my-service
service "my-service" exposed

C:\Users\gregor>kubectl get services my-service
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
my-service 10.0.0.200 <pending> 8080:30852/TCP,9779:32327/TCP,8778:31587/TCP 19s

C:\Users\gregor>kubectl describe services my-service
Name: my-service
Namespace: default
Labels: group=net.sklorz
project=springboottut
provider=fabric8
version=0.0.1-SNAPSHOT
Annotations: <none>
Selector: group=net.sklorz,project=springboottut,provider=fabric8,version=0.0.1-SNAPSHOT
Type: LoadBalancer
IP: 10.0.0.200
Port: port-1 8080/TCP
NodePort: port-1 30852/TCP
Endpoints: 172.17.0.9:8080
Port: port-2 9779/TCP
NodePort: port-2 32327/TCP
Endpoints: 172.17.0.9:9779
Port: port-3 8778/TCP
NodePort: port-3 31587/TCP
Endpoints: 172.17.0.9:8778
Session Affinity: None
Events: <none>

C:\Users\gregor> kubectl get pods --output=wide
NAME READY STATUS RESTARTS AGE IP NODE
configmapcontroller-4273343753-hfg5q 1/1 Running 17 6d 172.17.0.7 minikube
exposecontroller-1770961830-hbkgg 1/1 Running 17 6d 172.17.0.6 minikube
fabric8-3873669821-rhvw5 2/2 Running 33 6d 172.17.0.2 minikube
fabric8-docker-registry-125311296-ghrl8 1/1 Running 17 6d 172.17.0.11 minikube
fabric8-forge-1088523184-k0q82 1/1 Running 17 6d 172.17.0.4 minikube
gogs-2069416242-nc1j6 1/1 Running 15 6d 172.17.0.8 minikube
jenkins-56914896-5zcl2 1/1 Running 27 6d 172.17.0.5 minikube
nexus-2230784709-1k9kr 1/1 Running 17 6d 172.17.0.12 minikube
springboottut-1863166851-0778n 1/1 Running 0 16m 172.17.0.9 minikube

然后询问浏览器: http://172.17.0.9:8080或者 http://100.0.0.200:8080

  • 连接超时

我显然漏掉了什么,文档也没有再给我任何提示。请问有什么想法吗?感谢您的帮助。

最佳答案

您尝试访问的两个地址(172.* 和 10.*)都是私有(private) IP,无法通过公共(public)互联网直接寻址。

您的服务将外部 IP 列为待处理。

EXTERNAL-IP <pending>

一旦云提供商填写了该值,该值就是您应该用作浏览器地址的公共(public)端点。不要忘记添加任何必要的端口 8080

关于kubectl expose - 我错过了什么吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44163675/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com