简体   繁体   English

Istio 虚拟服务不适用于 80 和 443 以外的端口

[英]Istio virtual service not working for port other than 80 and 443

I am trying to set up istio virtual service along with the gateway but somehow it's not working.我正在尝试与gateway一起设置istio虚拟服务,但不知何故它不起作用。

Here is my gateway configuration这是我的网关配置

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: nginx-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
    - port:
        name: admin
        number: 9999
        protocol: HTTP
      hosts:
        - nginx.example.com

Virtual service虚拟服务

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: nginx-virtualservice
spec:
  gateways:
    - nginx-gateway
  hosts:
    - nginx.example.com
  http:
    - match:
        - port: 9999
      route:
        - destination:
            host: nginx
            port:
              number: 80

However it works only for port 80 and `443 but not for other ports.但是,它仅适用于端口80和 `443,但不适用于其他端口。

Most likely, when you created the istio-ingressgateway, you used the default values, so only port 80 and 443 are opened.很可能,当您创建 istio-ingressgateway 时,您使用了默认值,因此仅打开端口 80 和 443。 Look at the ingressgateway service/deployment and open the port 9999, you can add it in the operator .查看ingressgateway service/deployment,打开9999端口,在operator中添加即可。 Right now you have the Gateway listening to the port 9999 but probably the traffic can't go through it.现在您的网关正在侦听端口 9999,但 go 流量可能无法通过它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM