Istio-learning-note-about-Traffic Shifting(三)

istio:

If you want use the gateway api recoures "Httproute" to Traffic Shifting your app flow rate,

Here is a yaml about Traffic Shifting within istio.

复制代码
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
...
spec:
  parentRefs:
  - group: ""
    kind: Service
    name: reviews
    port: 9080
  rules:
  - backendRefs:
    - group: ""
      kind: Service
      name: reviews-v1
      port: 9080
      weight: 50
    - group: ""
      kind: Service
      name: reviews-v3
      port: 9080
      weight: 50
    matches:
    - path:
        type: PathPrefix
        value: /

the will lei flow rate %50 to service reviews-v1 and %50 to service reviews-v3.

You can refresh the website to see what happening .

And if you service reviews-v3 is working and have no bug ,you can lei flow rate %100 to reviews-v3.

like :

复制代码
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
...
spec:
  parentRefs:
  - group: ""
    kind: Service
    name: reviews
    port: 9080
  rules:
  - backendRefs:
    - group: ""
      kind: Service
      name: reviews-v3
      port: 9080
    matches:
    - path:
        type: PathPrefix
        value: /
相关推荐
深圳英康仕18 分钟前
ARM工控机openEuler系统Docker安装指南
arm开发·docker·rk3588·工控机
山沐与山31 分钟前
【Docker】Docker容器技术详解
运维·docker·容器
互联网哪些事情1 小时前
Docker 容器化部署宝塔 Linux 面板
linux·docker·容器·宝塔云服务器
坚定信念,勇往无前1 小时前
docker安装mongodb
mongodb·docker·容器
Destiny_where1 小时前
k8s常用指令集合
linux·docker·kubernetes
叮咚侠1 小时前
将已创建的Elasticsearch 8.12.0的docker容器中的数据挂载到宿主机操作步骤
运维·elasticsearch·docker·容器·kibana
wang6021252182 小时前
OCR服务-本地打包docker+docker下载ssh调试
docker·ssh·ocr
wuxingge2 小时前
docker设置代理,通过代理服务器拉取镜像
docker·容器
小池先生2 小时前
docker 安装gitlab
docker·容器·gitlab
Wang's Blog2 小时前
RabbitMQ: 基于Docker技术实施集群部署实战指南
分布式·docker·rabbitmq