Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker 从istio bookinfo示例获取404_Docker_Kubernetes_Istio_Docker Desktop_Docker For Mac - Fatal编程技术网

Docker 从istio bookinfo示例获取404

Docker 从istio bookinfo示例获取404,docker,kubernetes,istio,docker-desktop,docker-for-mac,Docker,Kubernetes,Istio,Docker Desktop,Docker For Mac,我试图在这里阅读Istio快速入门指南,但在这一步上遇到了问题 我在mac上运行docker for desktop而不是minikube 我在工作中也支持代理,但即使我绕过代理,也会出现以下错误: $ 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: C

我试图在这里阅读Istio快速入门指南,但在这一步上遇到了问题

我在mac上运行docker for desktop而不是minikube

我在工作中也支持代理,但即使我绕过代理,也会出现以下错误:

$ 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正在运行:

$ 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
我可以在一个豆荚里卷曲它:

$ 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>
$kubectl exec-it$(kubectl get pod-l app=ratings-o jsonpath='{.items[0].metadata.name}')-c ratings--curl-productpage:9080/productpage | grep-o“。”
简单书店应用程序

我不确定我可能做错了什么。非常感谢您的指导

多亏了istio社区,我发现了这种混乱。在那篇文章中,他们提到要找到入口端口,他们正在运行以下命令:

export INGRESS_PORT=$(kubectl -n istio-system get service istio- ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
这与第3步要求您确定入口主机和端口时,bookinfo上指示您执行的操作不同。在这里,如果您在本地运行,并且没有公共负载平衡器,则会告诉您按如下方式拉取节点端口:

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”,它将非常有效

export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
教程中的样例卷曲:

$ 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>
$curl-v-shttp://127.0.0.1:80/productpage |grep-o“*”
*正在尝试127.0.0.1。。。
*TCP_节点集
*连接到127.0.0.1(127.0.0.1)端口80(#0)
>GET/productpage HTTP/1.1
>主持人:127.0.0.1
>用户代理:curl/7.54.0
>接受:*/*
>

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

如果有人想否决我,请解释原因,以便我能解决它。