首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从istio bookinfo示例中获取404

从istio bookinfo示例中获取404
EN

Stack Overflow用户
提问于 2019-12-25 00:42:17
回答 1查看 783关注 0票数 1

我正在尝试阅读Istio快速入门指南,但在使用step confirm the app is accessible from outside the cluster时遇到了问题。

我使用的是mac,运行的是桌面docker,而不是minikube。

我也在一个代理后面工作,但即使我绕过了代理,我也会得到以下错误:

代码语言:javascript
复制
$ curl http://${GATEWAY_URL}/productpage -v
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connection failed
* connect to 127.0.0.1 port 30489 failed: Connection refused
* Failed to connect to 127.0.0.1 port 30489: Connection refused
* Closing connection 0

curl: (7) Failed to connect to 127.0.0.1 port 30489: Connection refused

pod正在运行:

代码语言:javascript
复制
$ kubectl get pods
NAME                             READY   STATUS    RESTARTS   AGE
details-v1-c5b5f496d-ccw5f       2/2     Running   0          18h
productpage-v1-c7765c886-xm2jd   2/2     Running   0          18h
ratings-v1-f745cf57b-5df2q       2/2     Running   0          18h
reviews-v1-75b979578c-jtc5l      2/2     Running   0          18h
reviews-v2-597bf96c8f-g7bzd      2/2     Running   0          18h
reviews-v3-54c6c64795-gbqqj      2/2     Running   0          18h

我可以在豆荚里卷起它:

代码语言:javascript
复制
$ kubectl exec -it $(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- curl productpage:9080/productpage | grep -o "<title>.*</title>"
<title>Simple Bookstore App</title>

我不确定我可能做错了什么。任何指导都是非常感谢的!

EN

回答 1

Stack Overflow用户

发布于 2019-12-25 04:31:09

多亏了this post,我在istio社区中发现了这种困惑。在帖子中,他们提到为了找到入口端口,他们正在运行以下命令:

代码语言:javascript
复制
export INGRESS_PORT=$(kubectl -n istio-system get service istio- ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')

这不同于在步骤3中要求您转到here以确定入口主机和端口时,您需要在bookinfo tutorial上执行的操作。在那里,如果你在本地运行,并且没有公共负载均衡器,你会被告知像这样拉取nodeport:

代码语言:javascript
复制
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')

如果我将json元素改为'port‘,它就能完美地工作!

代码语言:javascript
复制
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')

教程中的卷曲示例:

代码语言:javascript
复制
$ curl -v -s http://127.0.0.1:80/productpage | grep -o "<title>.*</title>"
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET /productpage HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< content-type: text/html; charset=utf-8
< content-length: 4183
< server: istio-envoy
< date: Tue, 24 Dec 2019 20:28:55 GMT
< x-envoy-upstream-service-time: 940
<
{ [4183 bytes data]
* Connection #0 to host 127.0.0.1 left intact
<title>Simple Bookstore App</title>

希望这能帮助像我一样苦苦挣扎的人。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59471493

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档