您好我尝试通过fabric8
访问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
然后询问浏览器:for http://172.17.0.9:8080 要么 http://100.0.0.200:8080
我显然错过了一些东西,文档也没有给我任何提示。请问有什么想法吗? 谢谢你的帮助。
答案 0 :(得分:0)
您尝试访问的两个地址(172. *和10. *)都是私有IP,无法通过公共Internet直接访问。
您的服务将外部IP列为未决。
EXTERNAL-IP
<pending>
一旦云提供商填写了该值,该值就是您应该用作浏览器中地址的公共端点。不要忘记添加任何必要的端口8080