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: /
相关推荐
Xiaoweidumpb2 小时前
Linux Docker docker-compose 部署python脚本
linux·python·docker
Broken Arrows2 小时前
解决同一个宿主机的两个容器无法端口互通报错“No route to host“的问题记录
运维·学习·docker
路漫漫其修远兮sjw4 小时前
llamafactory拉取并启动(本地虚拟机)
docker·模型微调·1024程序员节·模型调用
安卓开发者4 小时前
Docker与Tomcat:一键部署Java Web应用的完美组合
docker
yaoxtao5 小时前
LlamaFactory的docker-compose安装
docker·ai
先做个垃圾出来………5 小时前
Docker容器部署方法
运维·docker·容器
梁萌16 小时前
Linux安装BiliNote
linux·运维·服务器·docker·bilinote
行思理18 小时前
docker新手教程
运维·docker·容器
莫陌尛.21 小时前
docker安装中间件
docker·中间件·容器
tuokuac1 天前
虚拟机挂起,重启后主机连接不上虚拟机docker中的mysql?(docker网络状态假死)
网络·mysql·docker