Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.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
Rest Istio路线规则_Rest_Http_Routes_Istio_Envoyproxy - Fatal编程技术网

Rest Istio路线规则

Rest Istio路线规则,rest,http,routes,istio,envoyproxy,Rest,Http,Routes,Istio,Envoyproxy,我正在尝试设置一些路线规则,在下面的例子中我遇到了一个问题。如果我向服务“service-a”的端口(比如5000)发送HTTP请求,我希望路由规则将请求转发到服务“service-b”的端口5001。可能吗 apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: my-route spec: hosts: - service-a:5000 - service-a - serv

我正在尝试设置一些路线规则,在下面的例子中我遇到了一个问题。如果我向服务“service-a”的端口(比如5000)发送HTTP请求,我希望路由规则将请求转发到服务“service-b”的端口5001。可能吗

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: my-route
spec:
  hosts:
  - service-a:5000
  - service-a
  - service-a.service:5000
  - service-a.service
  - service-a.service.consul:5000
  - service-a.service.consul
  gateways:
  - my-gateway
  http:
  - match:
    - uri:
        prefix: "/v1/service-a"
    rewrite:
      uri: "/v1/ser-a"
    route:
    - destination:
        port:
          number: 5001
        name: service-b
网关的定义如下:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: my-gateway
spec:
  selector:
    app: my-gatweway-controller
  servers:
  - port:
      number: 5000
      name: http
      protocol: HTTP
    hosts:
    - localhost
  - port:
      number: 5001
      name: http
      protocol: HTTP
    hosts:
    - localhost
结果是一个内部错误500,请求降落在端口5000上,而不是5001上。有人知道如何解决这个问题吗

致意


Martin

端口重写在三天前由此PR-修复,它应该出现在Istio的下一版本中。

谢谢您的回答,瓦迪姆!你好,瓦迪姆,新发布的版本已经有发布日期了吗?我没有在网上找到任何东西。我不知道Istio 0.8的发布日期,对不起。