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: /
相关推荐
PC2005-cloud12 小时前
Qdrant 连接失败排查:localhost 解析到 __1,而 Docker 只绑了 IPv4
运维·docker·容器
喵喵爱自由12 小时前
Deepseek Harness镜像离线部署
docker·ai·语言模型
一技安身12 小时前
【信创】Ollama 手动提取 deepseek-r1:1.5b模型迁移到内网机器
服务器·docker·语言模型
程序员老赵13 小时前
Docker 部署觅思文档:搭建私有化文档管理系统
docker·开源·笔记测评
Meta3915 小时前
cenots8安装docker
docker·容器·centos
努力努力再努力wz15 小时前
【Docker入门系列】从 LXC 到 containerd:一文梳理 Docker 容器运行时架构演进与轻量化原理
docker·eureka·架构
CAE虚拟与现实17 小时前
docker desktop中的build功能是要build什么
java·docker·容器
fb_1234517 小时前
Docker入门-第1-2章-容器生态系统与架构详解
docker·容器·架构
allnlei19 小时前
s6-overlay - 装在 Docker 容器里的轻量级管家
java·docker·容器
一技安身1 天前
【Docker】 镜像导出 & 导入,实验环境aarch64(arm64)Linux操作系统
linux·docker·容器