简体   繁体   中英

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.

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.

Most likely, when you created the istio-ingressgateway, you used the default values, so only port 80 and 443 are opened. Look at the ingressgateway service/deployment and open the port 9999, you can add it in the operator . Right now you have the Gateway listening to the port 9999 but probably the traffic can't go through it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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