• 第七章 HTTP流量管理(二) URL 重写


    URL 重定向功能

    浏览器中输入  http://<host_name>:31380/v1/service-A/XXXX

    经过下面的重定向,实际调用的是serviceA的/v1/XXXX接口。

    浏览器中输入  http://<host_name>:31380/v1/service-B/XXXX

    经过下面的重定向,实际调用的是serviceB的/v1/XXXX接口。

    apiVersion: networking.istio.io/v1alpha3
    kind: VirtualService
    metadata:
      name: galaxyvs
    spec:
      hosts:
      - "*"
      gateways:
      - galaxygateway
      http:
      - match:
        - uri:
            prefix: /v1/service-A/
        rewrite:
          uri: /v1/
        route:
        - destination:
            host: serviceA.forecasting-platform-dev.svc.cluster.local
            
      - match:
        - uri:
            prefix: /v1/service-B/
        rewrite:
          uri: /v1/
        route:
        - destination:
            host: serviceB.forecasting-platform-dev.svc.cluster.local
  • 相关阅读:
    开发日记1
    探索需求2
    探索需求1
    周总结8
    周总结7
    周总结6
    周总结5
    周总结4
    周总结3
    周总结2
  • 原文地址:https://www.cnblogs.com/liufei1983/p/10447264.html
Copyright © 2020-2023  润新知