有两套基于istio的网关,一个higress,另一个istio,分别在不同的命名空间。同一份virtualservice配置,要同时适用于两套网关。
virtualservice配置
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: demo-vs
namespace: default
spec:
gateways:
- default/gw2
- default/gw1
hosts:
- demo.abc
- demo.abc.def.com
http:
- match:
- authority:
prefix: demo.abc
gateways:
- default/gw1
retries: {}
route:
- destination:
host: demo-ping.default.svc.cluster.local
port:
number: 8888
- match:
- authority:
prefix: demo.abc.def.com
gateways:
- default/gw2
retries: {}
route:
- destination:
host: demo-ping.default.svc.cluster.local
port:
number: 8888
其中有两个gw
istio的gateway
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: gw1
namespace: default
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- '*'
port:
name: http
number: 8081
protocol: HTTP
higress的gateway
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: gw2
namespace: default
spec:
selector:
app: higress-gateway
servers:
- hosts:
- '*'
port:
name: http
number: 80
protocol: HTTP