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: /
相关推荐
GHL28427109037 分钟前
Docker Desktop 启动报错“Virtualization support not detected“
c++·docker·容器
susu10830189112 小时前
docker启动kafka
docker·容器·kafka
何以不说话3 小时前
记录一下学习日常⑩(docker)
linux·运维·docker·容器
Knight_AL4 小时前
Docker 部署 Milvus 并连接现有 MinIO 对象存储
docker·eureka·milvus
你的不安4 小时前
Docker相关知识
docker·容器
淬炼之火5 小时前
基于Docker Desktop 和 Ubuntu 在 Windows上部署轻量化大模型(Qwen-LLM)
笔记·ubuntu·docker·语言模型·容器
是火云哦6 小时前
打包你的开发环境:Docker 从入门到上瘾
运维·docker·容器
小明_GLC6 小时前
关于租用阿里云服务器拉取Docker镜像的问题
docker
今晚打佬虎6 小时前
精准阻断 Docker 容器映射端口:流量路径诊断与 iptables 配置
运维·docker·容器
那年一路北6 小时前
基于 Maven + Docker 的 WebApp 打包与部署
docker·maven·web app