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: /
相关推荐
多云的夏天5 小时前
docker容器部署-windows-ubuntu
java·docker·容器
淡泊if7 小时前
1.2GB → 98MB,我的 Docker 镜像瘦身实战记录
运维·docker·容器
Sst的头号粉丝7 小时前
Docker——cgroups
运维·docker·容器
❀͜͡傀儡师8 小时前
Docker 部署Datart BI工具完整指南(PostgreSQL 持久化存储)
docker·postgresql·容器
l1t9 小时前
解决用docker安装umbra数据库遇到的FATAL:Operation not permitted错误
数据库·docker·容器
last demo9 小时前
docker存储
运维·docker·容器
无名-CODING9 小时前
从零开始!Vue3+SpringBoot前后端分离项目Docker部署实战(上):环境搭建与数据库容器化
数据库·spring boot·docker
kabu_Charlie11 小时前
使用Docker运行python程序
运维·docker·容器
包饭厅咸鱼12 小时前
小龙虾openclaw----Windows+Wsl+Docker 安装openclaw 并接入飞书
windows·docker·openclaw·小龙虾
骥龙12 小时前
第五篇:运行时安全——Docker沙箱与命令审批机制
安全·docker·容器