searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

vs配置如何支持两套istio网关

2024-04-30 07:32:48
8
0

有两套基于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
0条评论
作者已关闭评论
a****k
16文章数
0粉丝数
a****k
16 文章 | 0 粉丝
原创

vs配置如何支持两套istio网关

2024-04-30 07:32:48
8
0

有两套基于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
文章来自个人专栏
云组件
16 文章 | 1 订阅
0条评论
作者已关闭评论
作者已关闭评论
0
0