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: /
相关推荐
ALex_zry2 小时前
Docker Compose运维技术实战分享:从安装到架构解析
运维·docker·架构
roman_日积跬步-终至千里7 小时前
【Docker】Docker Stop 后到底发生了什么?——从信号机制到优雅停机
运维·docker·容器
z***6268 小时前
Docker:基于自制openjdk8镜像 or 官方openjdk8镜像,制作tomcat镜像
docker·容器·tomcat
❀͜͡傀儡师11 小时前
Docker部署视频下载器
docker·容器·音视频
热爱学习的小怪兽12 小时前
docker的一些常用指令
运维·docker·容器
w***765513 小时前
用docker启动mysql步骤
mysql·docker·容器
p***q7814 小时前
docker离线安装及部署各类中间件(x86系统架构)
docker·中间件·系统架构
d***956214 小时前
docker 安装 mysql
mysql·adb·docker
陌生人~16 小时前
docker安装redis
redis·docker
qq_21539789717 小时前
docker 安装 opengauss 高斯数据库
运维·docker·容器