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: /
相关推荐
木卯彳亍40 分钟前
番外-linux系统运行.net framework 4.0的项目
linux·docker·.net
退役小学生呀3 小时前
十一、K8s细粒度权限管理RBAC
linux·docker·云原生·容器·kubernetes·k8s
Jiangnan_Cai7 小时前
Linux 系统 docker 部署 Dify
linux·docker·大模型·dify
LuckyLay7 小时前
使用 Docker 搭建 Rust Web 应用开发环境——AI教你学Docker
前端·docker·rust
mit6.82412 小时前
论容器化 | 分析Go和Rust做医疗的后端服务
docker·golang·rust
东风微鸣12 小时前
Python 脚本最佳实践2025版
docker·云原生·kubernetes·可观察性
不知疲倦的仄仄13 小时前
2025最新版Docker讲解/面试/命令/容器化技术
运维·docker·容器
哈里谢顿17 小时前
修改并重新部署docker项目流程
docker
code喵喵18 小时前
docker-compose安装常用中间件
docker·中间件·容器
山岚的运维笔记19 小时前
AlpineLinux使用docker部署prometheus
docker·容器·prometheus