Skip to content

トラフィックミラーリング

Traffic Mirroring(またはShadow Traffic)は、本番トラフィックをリアルタイムで複製して、新しいバージョンをテストする手法です。

目次

  1. トラフィックミラーリングの概要
  2. 基本設定
  3. 部分ミラーリング
  4. 実践例
  5. ベストプラクティス

トラフィックミラーリングの概要

基本設定

yaml
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: reviews-mirror
spec:
  hosts:
  - reviews
  http:
  - route:
    - destination:
        host: reviews
        subset: v1
      weight: 100
    mirror:
      host: reviews
      subset: v2
    mirrorPercentage:
      value: 100  # 100% mirroring

部分ミラーリング

yaml
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: reviews-partial-mirror
spec:
  hosts:
  - reviews
  http:
  - route:
    - destination:
        host: reviews
        subset: v1
      weight: 100
    mirror:
      host: reviews
      subset: v2
    mirrorPercentage:
      value: 10  # Mirror only 10%

参考資料