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: /
相关推荐
遨游DATA2 小时前
容器退出码 126 排查:静态资源镜像层如何改写目录权限
linux·docker·kubernetes·文件权限
有个傻瓜2 小时前
容器里时间凭空差 8 小时:naive 与 aware 时区混用排错复盘与四种方案实测
python·docker·springboot·时区排错·naive/aware
江湖有缘6 小时前
Anchor私有化部署实战:Docker搭建专属个人笔记服务
笔记·docker·容器
奔跑的大白啊11 小时前
对比Dockerfile的copy和docker cp的区别
docker·容器·copy·docker cp·复制文件
جيون داد ناالام ميづ11 小时前
【MQ与中间件】容器内Java服务发不出邮件:docker network connect与JVM的DNS负缓存
java·docker·中间件
雾时之林11 小时前
K8S 的认证与安全
docker·容器·kubernetes
96245612 小时前
Docker 中 MeshCentral 管理员密码丢失:一次保留原账户与设备关系的恢复复盘
运维·docker·容器
早茶cc14 小时前
Docker php文件包含
docker·php
Techblog of HaoWANG1 天前
具身智能机器人专题(4) Docker 实战
linux·运维·ubuntu·docker·容器·机器人·ollama
墨痕诉清风1 天前
docker无法pull镜像问题解决
运维·docker·容器