Routing GKE istio ingressgateway需要帮助排除HTTP错误503

Routing GKE istio ingressgateway需要帮助排除HTTP错误503,routing,google-kubernetes-engine,istio,Routing,Google Kubernetes Engine,Istio,在过去的一周里,我一直在尝试在Google的Kubernetes引擎中与Istio一起设置sock shop演示应用程序。但是,当我使用curl-i http://${gateway\u URL}/卷曲到我的入口网关的外部IP地址时(其中${gateway\u URL}对应于我运行kubectl get service istio ingresgateway-n istio system时收到的外部IP),我得到以下响应: HTTP/1.1 503 Service Unavailable dat

在过去的一周里,我一直在尝试在Google的Kubernetes引擎中与Istio一起设置sock shop演示应用程序。但是,当我使用
curl-i http://${gateway\u URL}/
卷曲到我的入口网关的外部IP地址时(其中${gateway\u URL}对应于我运行
kubectl get service istio ingresgateway-n istio system
时收到的外部IP),我得到以下响应:

HTTP/1.1 503 Service Unavailable
date: Mon, 22 Jul 2019 13:50:11 GMT
server: envoy
transfer-encoding: chunked
kubectl logs-n istio系统istio-ingressgateway-64d6cfc6cb-m4sbx的输出如下所示:

[2019-07-22T13:50:12.021Z] "HEAD /HTTP/1.1" 503 NR 0 0 2 - "10.132.0.4" "curl/7.52.1" "25ea898e-0f51-4997-b3bc-a08f586dcf8a" "35.240.37.125" "-" - - 10.4.0.4:80 10.132.0.4:52250
我为sock shop使用以下部署(它基本上是传统的sock shop,除了我在端口80上侦听的服务端口中添加了
http-
-前缀):

使用以下网关
gateway.yaml

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
以及virtualservice
virtual.yaml

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: external-services
spec:
  hosts:
  - "*"
  gateways:
  - gateway                      # 1
  http:
  - route:
    - destination:
        host: front-end             # 2
        port:
          number: 80

我不知道前面提到的503错误的原因是什么。日志的输出状态为“NR”,这表明它没有找到任何适用的路由,但这就是virtualservice的用途,因此我认为这就是我犯错误的地方,但我无法弄清楚它到底是什么。

在您的部署中,您使用了命名空间sock shop

因此,您需要指定指向此服务的虚拟服务:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: external-services
spec:
  hosts:
  - "*"
  gateways:
  - gateway                      # 1
  http:
  - route:
    - destination:
        host: front-end             # 2
        port:
          number: 80
- destination:
    host: front-end.sock-shop.svc.cluster.local